﻿/* Apple-inspired Modern Design System - Variables */
:root {
    /* Color Palette */
    --primary: #0071e3; /* Apple's signature blue */
    --primary-light: #47a9ff;
    --primary-dark: #0058b0;
    --secondary: #fa5252; /* Vibrant red for attention */
    --accent: #9866ff; /* Light purple for accent */
    --success: #30d158; /* Apple's green */
    --warning: #ff9f0a; /* Apple's orange */
    --error: #ff453a; /* Apple's red */

    /* Background and Surface */
    --background: #f5f5f7; /* Apple's light gray background */
    --surface: #ffffff; /* Clean white for surfaces */
    --surface-secondary: #f0f0f5; /* Slightly different for alt sections */

    /* Text Colors */
    --text-primary: #1d1d1f; /* Almost black for primary text */
    --text-secondary: #6e6e73; /* Medium gray for secondary text */
    --text-tertiary: #86868b; /* Light gray for tertiary text */

    /* Borders and Shadows */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;
    --border-radius-xl: 22px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-normal: 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
}

/* Base styles and resets - Apple style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth; /* Moved from JS to CSS for simplicity */
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { /* General container for content within sections */
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: 2.8rem; /* ~44.8px */
    letter-spacing: -0.025em;
}

h2 {
    font-size: 2rem; /* ~32px */
    letter-spacing: -0.02em;
    margin-top: var(--spacing-xxl); /* Add top margin for section headings */
}
section:first-of-type h2, .hero-section h2 /* No top margin for first h2 or if h2 is in hero */
{
    margin-top: 0;
}


h3 {
    font-size: 1.5rem; /* ~24px */
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 1.0625rem; /* ~17px */
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Button styles - Apple style */
.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.0625rem; /* ~17px */
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    text-decoration: none; 
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.01em;
}

.btn:hover {
    background-color: var(--primary-light);
    text-decoration: none; 
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: scale(0.98) translateY(0);
    box-shadow: 0 0 0 3px rgba(0, 125, 250, 0.15);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--primary);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: var(--surface-secondary);
}


/* Header */
.site-header {
    background-color: var(--surface);
    padding: var(--spacing-md) 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-container {
    max-width: 1200px; 
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem; 
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}
.logo a:hover {
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
    /* UL itself doesn't need active state if .main-nav gets it */
}

.main-nav a {
    font-size: 1rem; 
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-xs) 0; /* Add some padding for better click target */
}

.main-nav a:hover, .main-nav a.active { /* .active can be used for current page link if implemented */
    color: var(--primary);
    text-decoration: none;
}

.nav-toggle { 
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    z-index: 101; /* Above nav items if they overlay */
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    position: relative;
    transition: background-color 0s 0.3s;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    transition: transform var(--transition-normal), top var(--transition-normal) 0.3s;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Active state for hamburger (X icon) */
.nav-toggle.active .hamburger { background-color: transparent; }
.nav-toggle.active .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(-45deg); top: 0; }


/* Hero Section */
.hero-section {
    background-color: var(--surface); 
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-content {
    max-width: 700px;
}

.hero-section h1 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.hero-section p {
    font-size: 1.25rem; 
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

.cta-button {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.25rem; 
    font-weight: 600;
}

.secondary-cta-info {
    font-size: 0.9rem; 
    color: var(--text-tertiary);
    margin-top: var(--spacing-md);
}

/* Content Sections */
.content-section {
    padding: var(--spacing-xxl) var(--spacing-lg);
}
.content-section .container { 
    max-width: 1000px;
    margin: 0 auto;
    padding: 0; 
}
.content-section h2 {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-xl);
    font-size: 1.1rem; 
    color: var(--text-secondary);
}

.alt-bg {
    background-color: var(--surface-secondary); 
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.feature-item {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.feature-icon {
    font-size: 2.5rem; /* 40px */
    margin-bottom: var(--spacing-md);
    display: block;
    color: var(--primary);
}
.feature-item h3 {
    font-size: 1.25rem; 
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}
.feature-item p {
    font-size: 1rem; 
    color: var(--text-secondary);
}


/* How It Works - steps */
.steps-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}
.step-item {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    flex-basis: calc(33.333% - var(--spacing-lg) * 2 / 3); /* Adjust for gap */
    min-width: 250px;
    display: flex;
    flex-direction: column;
}
.step-item .step-number {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto var(--spacing-md) auto;
}
.step-item h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

/* Practice Tips / Test Prep / Why Choose Us - List styling */
.content-section ul {
    list-style: none; 
    padding-left: 0;
}
.content-section li {
    background-color: var(--surface);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    padding-left: calc(var(--spacing-md) + var(--spacing-lg)); /* Space for custom bullet + text padding */
}
.content-section li::before {
    content: '✓'; 
    color: var(--success);
    font-weight: bold;
    position: absolute;
    left: var(--spacing-md);
    top: var(--spacing-md); 
    font-size: 1.2rem;
}
.content-section li h3 { 
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
    padding-top: 0; /* Align with paragraph if only h3 and p */
}
.content-section li p {
    font-size: 1rem;
}


/* Testimonials / Success Stories */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}
.testimonial-item {
    background-color: var(--surface);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg); /* Or remove if using grid gap */
    display: flex;
    flex-direction: column;
}
.testimonial-item blockquote {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    border-left: 3px solid var(--primary);
    padding-left: var(--spacing-md);
    flex-grow: 1;
}
.testimonial-item cite {
    display: block;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: auto; /* Pushes cite to bottom if blockquote is short */
}


/* Footer */
.site-footer {
    background-color: var(--text-primary); 
    color: var(--background); 
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
}
.footer-container {
    max-width: 1000px;
    margin: 0 auto;
}
.footer-nav-links {
    margin-bottom: var(--spacing-md);
}
.footer-nav-links a {
    color: var(--text-tertiary); 
    margin: 0 var(--spacing-sm);
    font-size: 0.9rem;
}
.footer-nav-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}
.social-links {
    margin-bottom: var(--spacing-md);
}
.social-links a {
    color: var(--text-tertiary);
    margin: 0 var(--spacing-sm);
    font-size: 0.9rem;
    display: inline-block; 
}
.social-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}
.site-footer p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-xs);
}
.site-footer p strong { /* Ensure strong in footer is visible */
    color: var(--background);
}


/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        --background: #000000;
        --surface: #1c1c1e;
        --surface-secondary: #2c2c2e;
        --text-primary: #ffffff;
        --text-secondary: #ebebf599; 
        --text-tertiary: #ebebf566; 
        --shadow-sm: 0 2px 6px rgba(255, 255, 255, 0.05);
        --shadow-md: 0 4px 12px rgba(255, 255, 255, 0.08);
    }
    .site-header {
        box-shadow: 0 1px 0 rgba(255,255,255,0.1);
    }
    .feature-item, .step-item, .content-section li, .testimonial-item, .toc { /* Added .toc for dark mode */
         border: 1px solid rgba(255,255,255,0.08); 
         background-color: var(--surface); /* Ensure TOC background consistent */
    }
    .toc { /* Specific dark mode for TOC background if different from general surface */
        background-color: #2c2c2e; /* Or var(--surface-secondary) */
        border-color: rgba(255,255,255,0.1);
    }
    .toc h2 {
        color: var(--primary-light); /* Lighter primary for TOC title in dark mode */
    }
    .toc ul li a {
        color: var(--text-secondary);
    }
    .toc ul li a:hover {
        color: var(--accent); /* Accent color for hover in dark mode */
    }

    .site-footer {
        background-color: #1c1c1e; 
        color: var(--text-secondary);
    }
    .footer-nav-links a, .site-footer p, .social-links a {
        color: var(--text-tertiary);
    }
    .site-footer p strong {
        color: #f5f5f7; /* Light gray for strong text in dark footer */
    }
    .btn-secondary {
        border-color: rgba(255,255,255,0.15);
        color: var(--primary-light);
    }
    .btn-secondary:hover {
        background-color: #2c2c2e; /* Slightly darker surface for hover */
    }
}

/* Mobile First - Responsive adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; } 
    h2 { font-size: 1.75rem; } 
    .hero-section p { font-size: 1.1rem; } 

    /* Styles for the <nav class="main-nav"> element when active */
    .main-nav {
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        right: 0;
        width: 100%;
        background-color: var(--surface);
        box-shadow: var(--shadow-sm);
        transform: translateY(-150%) scaleY(0.8); 
        transform-origin: top;
        opacity: 0;
        visibility: hidden;
        transition: transform var(--transition-normal), opacity var(--transition-normal), visibility 0s var(--transition-normal);
        padding-bottom: var(--spacing-md);
    }
    .main-nav.active { /* This class is toggled by JS on the <nav> element */
        transform: translateY(0) scaleY(1);
        opacity: 1;
        visibility: visible;
        transition: transform var(--transition-normal), opacity var(--transition-normal), visibility 0s 0s;
    }
    /* Styles for the UL inside the .main-nav */
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0; /* Links will have padding making up for gap */
        padding-top: var(--spacing-md);
    }
    .main-nav li {
        width: 100%;
        text-align: center;
    }
    .main-nav a { /* Targets links inside .main-nav ul li */
        display: block;
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1.1rem;
        border-bottom: 1px solid var(--surface-secondary);
    }
    .main-nav li:last-child a {
        border-bottom: none;
    }

    .nav-toggle { /* The hamburger button */
        display: block; 
    }

    .features-grid {
        grid-template-columns: 1fr; 
    }
    .step-item {
        flex-basis: 100%; 
    }
    .content-section li {
        padding-left: calc(var(--spacing-sm) + var(--spacing-lg));
    }
    .content-section li::before {
        left: var(--spacing-sm);
    }
}

/* Basic responsive video styling from original index.html <style> block, now integrated */
/* Ensure this matches the one in index.html or remove from index.html if identical */
.video-container {
    /* For a 9:16 PORTRAIT video, as indicated by original comments and styling */
    width: 100%; 
    max-width: 375px; /* Constrains to a common phone-like width on larger screens. */
    aspect-ratio: 9 / 16; /* CSS property to maintain 9:16 aspect ratio */
    
    /* For a 16:9 LANDSCAPE video, you would use: */
    /* max-width: 700px; /* Or your preferred max width */
    /* aspect-ratio: 16 / 9; */
    
    position: relative; /* Needed if not using CSS aspect-ratio for older browser support with padding-bottom trick */
    /* padding-bottom: 177.77%; /* Fallback for 9:16 if aspect-ratio not supported (16/9 * 100) */
    /* padding-bottom: 56.25%; /* Fallback for 16:9 if aspect-ratio not supported (9/16 * 100) */
    /* height: 0; /* Part of the padding-bottom trick */

    overflow: hidden;
    background: #000;
    margin: var(--spacing-lg) auto;
}
.video-container video {
    position: absolute; /* Covers the container, works with padding-bottom trick or aspect-ratio */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* Ensures the entire video is visible, pillar/letterboxing if aspect mismatch */
    /* Use 'cover' to fill and crop if aspect mismatch is acceptable */
}

.toc {
    background-color: var(--surface-secondary); /* Using alt background for TOC */
    border: 1px solid rgba(0,0,0,0.1); /* Softer border */
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
}
.toc h2 {
    margin-top: 0;
    color: var(--primary); /* Use primary color for TOC title */
    font-size: 1.75rem; /* Slightly smaller than section H2 */
    text-align: left; /* TOC title usually left aligned */
}
.toc ul {
    list-style-type: none;
    padding-left: 0;
}
.toc ul ul { /* For nested lists in TOC */
    padding-left: var(--spacing-md);
}
.toc ul li {
    margin-bottom: var(--spacing-sm);
    background-color: transparent; /* Remove individual li background from TOC */
    box-shadow: none;
    padding: 0; /* Remove padding from li, link will handle it */
    padding-left: 0; /* Override general li styling */
}
.toc ul li::before { /* Remove general li::before styling */
    content: none;
}
.toc ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    display: block; /* Make entire area clickable */
    padding: var(--spacing-xs) 0;
}
.toc ul li a:hover {
    text-decoration: underline;
    color: var(--accent);
}

#faq-maths .faq-item {
    margin-bottom: var(--spacing-md);
    background-color: var(--surface);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}
#faq-maths .faq-item h3 {
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem; /* Slightly smaller h3 for FAQ items */
}
#faq-maths .faq-item p {
    font-size: 1rem;
}