/* ===== CSS Variables ===== */
/* Colors extracted from RATi™ logo: 
   - Primary purple: #372652 (light logo) / #3e2253 (dark logo)
   - Background dark: #111216
   - Background light: #ffffff
*/

:root, [data-theme="light"] {
    --primary-color: #4a2c6a;      /* Purple from logo, slightly brightened */
    --primary-dark: #372652;        /* Deep purple from light logo */
    --secondary-color: #6b4d8a;     /* Lighter purple accent */
    --accent-color: #8b5fbf;        /* Vibrant purple for highlights */
    --text-color: #1a1a2e;          /* Dark blue-purple for text */
    --text-light: #5c5c7a;          /* Muted purple-gray */
    --bg-color: #ffffff;
    --bg-alt: #f8f7fa;              /* Subtle purple tint */
    --border-color: #e8e6ed;        /* Purple-tinted border */
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #1a1a2e;           /* Dark footer background */
    --shadow: 0 4px 6px -1px rgba(55, 38, 82, 0.1), 0 2px 4px -1px rgba(55, 38, 82, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(55, 38, 82, 0.1), 0 4px 6px -2px rgba(55, 38, 82, 0.05);
    --radius: 12px;
    --transition: all 0.3s ease;
    --logo-light-display: none;
    --logo-dark-display: block;
    --gradient-start: #4a2c6a;
    --gradient-end: #6b4d8a;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] {
    --primary-color: #9b7bc7;       /* Bright purple for dark mode */
    --primary-dark: #7c5aab;        /* Medium purple */
    --secondary-color: #b794d4;     /* Light purple accent */
    --accent-color: #c9a8e9;        /* Soft purple highlight */
    --text-color: #f0eef4;          /* Light with purple tint */
    --text-light: #a8a3b8;          /* Muted light purple */
    --bg-color: #111216;            /* Dark background from logo */
    --bg-alt: #1a1a24;              /* Slightly lighter dark */
    --border-color: #2d2a3a;        /* Purple-tinted dark border */
    --card-bg: #1a1a24;
    --header-bg: rgba(17, 18, 22, 0.95);
    --footer-bg: #0a0a0d;           /* Very dark footer background */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --logo-light-display: block;
    --logo-dark-display: none;
    --gradient-start: #3e2253;
    --gradient-end: #5a3a75;
}

/* Auto dark mode fallback when no data-theme set */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --primary-color: #9b7bc7;
        --primary-dark: #7c5aab;
        --secondary-color: #b794d4;
        --accent-color: #c9a8e9;
        --text-color: #f0eef4;
        --text-light: #a8a3b8;
        --bg-color: #111216;
        --bg-alt: #1a1a24;
        --border-color: #2d2a3a;
        --card-bg: #1a1a24;
        --header-bg: rgba(17, 18, 22, 0.95);
        --footer-bg: #0a0a0d;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
        --logo-light-display: block;
        --logo-dark-display: none;
        --gradient-start: #3e2253;
        --gradient-end: #5a3a75;
    }
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Header & Navigation ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo a,
.logo .theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1);
}

.logo-img.light {
    display: var(--logo-light-display);
}

.logo-img.dark {
    display: var(--logo-dark-display);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    border: none;
    background: none;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Nav Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-alt);
    padding: 0.25rem;
    border-radius: 8px;
}

.language-switcher a {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-light);
}

.language-switcher a.active,
.language-switcher a:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 10rem 2rem 6rem;
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    color: var(--primary-dark);
}

/* ===== Sections ===== */
.section {
    padding: 5rem 2rem;
}

.alt-bg {
    background: var(--bg-alt);
}

/* ===== About Section ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card .note {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ===== Mission Grid ===== */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    .mission-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .mission-grid {
        grid-template-columns: 1fr;
    }
}

.mission-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mission-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mission-card h3 {
    color: var(--primary-color);
}

.mission-card p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* ===== Program Section ===== */
.program-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.program-card.featured {
    border: 2px solid var(--primary-color);
}

.program-badge {
    position: absolute;
    top: -12px;
    left: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.program-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.program-details {
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.program-details h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.program-details ul {
    list-style: none;
}

.program-details li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.program-details li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.program-note {
    font-style: italic;
    color: var(--text-light);
    padding: 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(8, 145, 178, 0.05) 100%);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.secondary-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
    transition: var(--transition);
}

.secondary-button:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

/* ===== Contact Section ===== */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

/* ===== Footer ===== */
footer {
    background: var(--footer-bg);
    color: white;
    padding: 3rem 2rem 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo-text {
    color: white;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
    margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 0;
        display: none;
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links a {
        display: block;
        padding: 1rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero {
        padding: 8rem 1.5rem 4rem;
        min-height: 60vh;
    }
    
    .section {
        padding: 3rem 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .program-card {
        padding: 2rem 1.5rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .logo-img {
        width: 32px;
        height: 32px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .language-switcher {
        padding: 0.15rem;
        gap: 0.25rem;
    }
    
    .language-switcher a {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .nav-controls {
        gap: 0.5rem;
    }
    
    .hamburger {
        padding: 0.25rem;
    }
    
    .hamburger span {
        width: 20px;
        height: 2px;
    }
}
