/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* CSS Custom Properties for Theming */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.15);
    --accent-color: #007bff;
    --accent-hover: #0056b3;
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --gradient-primary: linear-gradient(135deg, #0891b2, #06b6d4);
    --gradient-secondary: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-card: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --accent-color: #4dabf7;
    --accent-hover: #339af0;
    --navbar-bg: rgba(26, 26, 26, 0.95);
    --gradient-primary: linear-gradient(135deg, #4dabf7, #339af0);
    --gradient-secondary: linear-gradient(135deg, #404040, #525252);
}

/* Dark mode specific overrides */
[data-theme="dark"] .statement-card p {
    color: #000000;
}

[data-theme="dark"] .mission-card h4 {
    color: #4dabf7;
}

[data-theme="dark"] .mission-card p {
    color: #000000;
}

[data-theme="dark"] .section-subtitle {
    color: #ffffff;
}

[data-theme="dark"] .program-content p {
    color: #ffffff;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.3rem; }

p {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.lead {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0e7490, #0891b2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background: #0891b2;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
    background: var(--navbar-bg);
    box-shadow: 0 2px 20px var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 1.8rem;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    transform: scale(1.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0891b2;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: white;
    text-align: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.wave-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M985.66,92.83C906.67,72,823.78,31,743.84,14.19c-82.26-17.34-168.06-16.33-250.45.39-57.84,11.73-114,31.07-172,41.86A600.21,600.21,0,0,1,0,27.35V120H1200V95.8C1132.19,118.92,1055.71,111.31,985.66,92.83Z' fill='%23ffffff' fill-opacity='0.1'/%3E%3C/svg%3E") repeat-x;
    animation: wave 10s ease-in-out infinite alternate;
    z-index: 2;
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50px); }
}

.hero-content {
    position: relative;
    z-index: 4;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 1000px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Section Styling */
section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    margin: 1rem auto 2rem;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.achievements {
    margin-top: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
}

.achievement-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.achievement-icon i {
    color: white;
    font-size: 1.5rem;
}

.achievement-text h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.achievement-text p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-left: 1rem;
    transform: translateY(-1rem);
}

.about-photo {
    width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-photo:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.image-placeholder {
    width: 400px;
    height: 500px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.image-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Mission Section */
.mission-statement {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.statement-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #0891b2;
}

.statement-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.statement-icon i {
    color: white;
    font-size: 2rem;
}

.statement-card h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-size: 1.8rem;
}

.statement-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.1rem;
}

.values-section {
    margin-top: 3rem;
}

.values-title {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    font-size: 2rem;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
    justify-items: center;
}

/* Center the last two items when there are 4 total */
.mission-grid:has(.mission-card:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(280px, 400px));
    justify-content: center;
}

@supports not selector(:has(*)) {
    /* Fallback for browsers that don't support :has()...stackoverflow is still useful? */
    .mission-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
    }
    
    .mission-card {
        flex: 0 1 320px;
        max-width: 400px;
    }
}

.mission-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.card-icon i {
    color: white;
    font-size: 2rem;
}

.mission-card h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.mission-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Programs Section */
.programs {
    background: var(--bg-secondary);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.program-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px var(--shadow-hover);
}

.program-image {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.program-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.program-overlay {
    position: relative;
    z-index: 2;
    background: var(--accent-color);
    opacity: 0.9;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.program-overlay i,
.program-image > i {
    font-size: 3rem;
    color: white;
}

.program-content {
    padding: 2rem;
}

/* Global Partnership card - remove overlay and improve image scaling */
.program-card:has(.program-bg-image) .program-overlay {
    display: none;
}

.program-card:has(.program-bg-image) .program-image {
    background: none;
}

.program-card:has(.program-bg-image) .program-bg-image {
    opacity: 1;
    object-fit: cover;
    object-position: center;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    .program-image:has(.program-bg-image) .program-overlay {
        display: none;
    }
    
    .program-image .program-bg-image {
        opacity: 1;
    }
}

.program-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.program-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.program-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.program-link:hover {
    color: var(--accent-hover);
}

/* Contact Section */
.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-methods {
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 10px;
}

.contact-method i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    flex-shrink: 0;
}

.contact-method h4 {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.contact-method p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Contact Info Styles - New Structure */
.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-hover);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-details {
    text-align: center;
}

.contact-details h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.contact-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0891b2;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: #06b6d4;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #94a3b8;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #06b6d4;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #334155;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #06b6d4;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: #94a3b8;
    margin-bottom: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        backdrop-filter: blur(10px);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-content {
        padding: 2rem 1.5rem;
        margin: 0 15px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* Hero Image Mobile Optimization */
    .hero {
        height: 70vh;
        min-height: 500px;
    }

    .hero-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .hero-image {
        position: absolute;
        top: 10%;
        left: 5%;
        width: 90%;
        height: 80%;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 10px 30px var(--shadow);
    }

    .hero-bg-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
        opacity: 0.8;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .image-placeholder,
    .about-photo {
        width: 100%;
        height: 300px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    section {
        padding: 60px 0;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .mission-grid,
    .programs-grid {
        grid-template-columns: 1fr;
    }

    .mission-statement {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .statement-card {
        padding: 2rem 1.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-content {
        padding: 1.5rem 1rem;
        margin: 0 10px;
    }

    /* Extra small mobile hero optimization */
    .hero {
        height: 60vh;
        min-height: 400px;
    }

    .hero-image {
        top: 15%;
        left: 8%;
        width: 84%;
        height: 70%;
        border-radius: 10px;
    }

    .hero-bg-image {
        opacity: 0.85;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus States */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}
