/* ========================================
   NGO Website - Custom Styles
   ======================================== */

/* CSS Variables for Theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --dark-color: #1f2937;
    --light-gray: #f3f4f6;
    --text-color: #374151;
    --border-color: #e5e7eb;
    --muted-color: #6b7280;
    --bg-color: #ffffff;
    --footer-bg: #1f2937;

    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;

    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 0.5rem;
    box-shadow: var(--box-shadow);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accessibility-toolbar .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    transition: all var(--transition-speed);
}

.accessibility-toolbar .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* High Contrast Mode */
body.high-contrast {
    background: #000;
    color: #fff;
}

body.high-contrast a {
    color: #ffff00;
}

body.high-contrast .bg-white {
    background: #1a1a1a !important;
}

/* Top Bar */
.top-bar {
    font-size: 0.875rem;
}

.top-bar .social-links a {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.top-bar .social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.navbar {
    padding: 1rem 0;
}

.navbar-brand {
    font-family: var(--font-heading);
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.navbar-nav .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background var(--transition-speed);
}

.navbar-nav .dropdown-item:hover {
    background: var(--light-gray);
    color: var(--primary-color);
}

/* Hero Section */
.hero-carousel {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.hero-carousel .carousel-item {
    height: 600px;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-carousel .carousel-caption {
    bottom: 50%;
    transform: translateY(50%);
    text-align: left;
    left: 10%;
    right: auto;
    max-width: 600px;
}

.hero-carousel .carousel-caption h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-carousel .carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {

    .hero-carousel,
    .hero-carousel .carousel-item {
        height: 400px;
    }

    .hero-carousel .carousel-caption h1 {
        font-size: 2rem;
    }

    .hero-carousel .carousel-caption p {
        font-size: 1rem;
    }
}

/* Section Styles */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title p {
    font-size: 1.125rem;
    color: var(--muted-color);
    max-width: 700px;
    margin: 0 auto;
}

.section-title .underline {
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Impact Metrics */
.impact-metric {
    text-align: center;
    padding: 2rem;
}

.impact-metric .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Navbar & Logo */
.navbar {
    transition: all 0.3s ease;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.navbar.sticky-top {
    top: 0;
    z-index: 1020;
}

.navbar.navbar-scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.navbar-brand {
    padding: 0.5rem 0;
}

.nav-link {
    font-weight: 500;
    color: var(--text-color) !important;
    transition: color 0.2s ease;
}

.impact-metric .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.impact-metric .label {
    font-size: 1.125rem;
    color: var(--muted-color);
}

/* Projects Grid */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card .project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1.5rem 1.5rem;
    color: white;
}

.project-card img {
    transition: transform var(--transition-speed);
}

.project-card:hover img {
    transform: scale(1.1);
}

/* News/Blog Cards */
.news-card {
    height: 100%;
}

.news-card .card-body {
    display: flex;
    flex-direction: column;
}

.news-card .card-text {
    flex-grow: 1;
}

.news-meta {
    font-size: 0.875rem;
    color: var(--muted-color);
    margin-bottom: 0.5rem;
}

.news-meta i {
    margin-right: 0.25rem;
}

/* Team Members */
.team-member {
    text-align: center;
}

.team-member img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 4px solid var(--light-gray);
}

.team-member h4 {
    margin-bottom: 0.5rem;
}

.team-member .position {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.team-member .social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    background: var(--light-gray);
    color: var(--text-color);
    margin: 0 0.25rem;
    transition: all var(--transition-speed);
}

.team-member .social-links a:hover {
    background: var(--primary-color);
    color: white;
}

/* Partners Logo Grid */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    align-items: center;
}

.partner-logo {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed);
}

.partner-logo:hover {
    transform: translateY(-5px);
}

.partner-logo img {
    max-height: 80px;
    filter: grayscale(100%);
    transition: filter var(--transition-speed);
}

.partner-logo:hover img {
    filter: grayscale(0%);
}

/* Footer */
.footer {
    background: var(--footer-bg);
}

.footer h5 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

.social-links-footer a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--box-shadow);
    z-index: 1030;
    transition: all var(--transition-speed);
}

.scroll-to-top.show {
    display: flex;
}

.scroll-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* Form Styles */
.form-control,
.form-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Loading Spinner */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2rem;
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-light-gray {
    background-color: var(--light-gray);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    transform: translateX(-50px);
}

.reveal-right {
    transform: translateX(50px);
}

.reveal-scale {
    transform: scale(0.9);
}

.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .impact-metric .number {
        font-size: 2rem;
    }
}

/* Responsive Typography Fixes */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.25rem !important;
    }

    .display-1 {
        font-size: 3rem !important;
    }

    .display-2 {
        font-size: 2.75rem !important;
    }

    .display-3 {
        font-size: 2.5rem !important;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.25rem !important;
    }

    .lead {
        font-size: 1rem !important;
    }

    .section-title h2 {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    .display-4 {
        font-size: 1.85rem !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.35rem !important;
    }

    .section {
        padding: 40px 0 !important;
    }

    .section-title h2 {
        font-size: 1.5rem !important;
    }
}