/* ==========================================================================
   Language Learning Platform - Site CSS
   Design: Sky blue, soft coral, clean white
   Typography: Nunito (headings) + Quicksand (body) - warm rounded sans-serif
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --primary: #5BA4E6;
    --primary-dark: #3B8AD0;
    --primary-light: #EBF4FC;
    --secondary: #1E2A3A;
    --coral: #F08C7A;
    --coral-dark: #D96B58;
    --coral-light: #FDE8E4;
    --accent: #F0A500;
    --purple: #8B6FC0;
    --purple-light: #F0EBFA;
    --text: #3A4A5C;
    --text-light: #7A8A9C;
    --bg: #FFFFFF;
    --bg-alt: #F7FAFD;
    --border: #E4EBF2;
    --success: #4CAF7D;
    --success-light: #E8F5EE;
    --warning: #E6A817;
    --warning-dark: #C08E10;
    --warning-light: #FFF8E6;
    --danger: #E05555;
    --danger-light: #FDE8E8;
    --info: #5BA4E6;
    --info-light: #EBF4FC;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(30, 42, 58, 0.06);
    --shadow: 0 4px 20px rgba(30, 42, 58, 0.08);
    --shadow-lg: 0 8px 40px rgba(30, 42, 58, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Dyslexia-friendly mode ---------- */
body.dyslexia-mode {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Quicksand', sans-serif !important;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
    line-height: 1.8 !important;
}
body.dyslexia-mode h1, body.dyslexia-mode h2, body.dyslexia-mode h3,
body.dyslexia-mode h4, body.dyslexia-mode h5, body.dyslexia-mode h6 {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Nunito', sans-serif !important;
    letter-spacing: 0.02em;
}

/* ---------- Base Styles ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    font-weight: 500;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', 'Quicksand', sans-serif;
    color: var(--secondary);
    line-height: 1.3;
}

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

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ---------- Utility Classes ---------- */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-sm { font-size: 0.875rem; }
.tiny { font-size: 0.75rem; }
.text-coral { color: var(--coral) !important; }
.text-coral-dark { color: var(--coral-dark) !important; }
.text-purple { color: var(--purple) !important; }
.text-primary { color: var(--primary) !important; }
.text-warning-dark { color: var(--warning-dark) !important; }

.bg-coral { background-color: var(--coral) !important; color: #fff; }
.bg-coral-light { background-color: var(--coral-light) !important; }
.bg-sky-light { background-color: var(--primary-light) !important; }
.bg-primary-light { background-color: var(--primary-light) !important; }
.bg-success-light { background-color: var(--success-light) !important; }
.bg-warning-light { background-color: var(--warning-light) !important; }
.bg-danger-light { background-color: var(--danger-light) !important; }
.bg-purple-light { background-color: var(--purple-light) !important; }
.bg-info-light { background-color: var(--info-light) !important; }
.bg-light-alt { background-color: var(--bg-alt) !important; }

/* ---------- Navbar ---------- */
.navbar {
    padding: 1rem 0;
    transition: var(--transition);
    background: transparent;
}
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 0;
}
.navbar-brand {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
}
.brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
}
.navbar.scrolled .brand-text,
.navbar .brand-text {
    color: var(--secondary);
}
.nav-link {
    font-weight: 600;
    color: var(--text) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}
.nav-link:hover,
.nav-link[aria-current="page"] {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}
.btn-nav-cta {
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    min-height: 44px;
    min-width: 44px;
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(91, 164, 230, 0.35);
}
.btn-coral {
    background-color: var(--coral);
    border-color: var(--coral);
    color: #fff;
}
.btn-coral:hover {
    background-color: var(--coral-dark);
    border-color: var(--coral-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(240, 140, 122, 0.35);
}
.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}
.btn-outline-light:hover {
    transform: translateY(-2px);
}
.btn-light {
    font-weight: 700;
}
.btn-light:hover {
    transform: translateY(-2px);
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, #1E3A5F 0%, #2B5F9E 50%, #5BA4E6 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(240,140,122,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.min-vh-hero {
    min-height: calc(100vh - 80px);
}
.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.15;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    opacity: 0.9;
    max-width: 520px;
}
.hero-img {
    max-height: 450px;
    object-fit: cover;
    width: 100%;
}

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
    background: linear-gradient(135deg, var(--bg-alt) 0%, var(--primary-light) 100%);
    padding-top: 80px;
}

/* ---------- Cards (General) ---------- */
.path-card, .course-card, .testimonial-card, .resource-card,
.jlpt-card, .instructor-card, .video-card, .podcast-card,
.progress-card, .tool-card, .accreditation-item, .mini-card,
.contact-form-card, .contact-info-card, .business-info-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.path-card:hover, .course-card:hover, .testimonial-card:hover,
.resource-card:hover, .instructor-card:hover, .podcast-card:hover,
.tool-card:hover, .accreditation-item:hover, .mini-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

/* Path Cards */
.path-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Level Badges */
.level-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}
.level-n5 { background: linear-gradient(135deg, #4CAF7D, #3A9D6B); }
.level-n4 { background: linear-gradient(135deg, #5BA4E6, #3B8AD0); }
.level-n3 { background: linear-gradient(135deg, #E6A817, #C08E10); }
.level-n2 { background: linear-gradient(135deg, #F08C7A, #D96B58); }
.level-n1 { background: linear-gradient(135deg, #8B6FC0, #7258AA); }

/* Course Features */
.course-features li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--text);
}

/* ---------- JLPT Cards ---------- */
.jlpt-card {
    position: relative;
    padding-top: 2.5rem;
}
.jlpt-featured {
    border: 2px solid var(--coral);
    box-shadow: var(--shadow);
}
.jlpt-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
    margin: 0 auto;
}
.jlpt-n5n4 { background: linear-gradient(135deg, #4CAF7D, #5BA4E6); }
.jlpt-n3n2 { background: linear-gradient(135deg, #F08C7A, #E6A817); }
.jlpt-n1 { background: linear-gradient(135deg, #8B6FC0, #D96B58); }

/* ---------- Stats Banner ---------- */
.stats-banner {
    background: linear-gradient(135deg, #2B5F9E 0%, #5BA4E6 50%, #F08C7A 100%);
    position: relative;
    overflow: hidden;
}
.stats-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
}
.stat-number {
    font-size: clamp(2rem, 4vw, 3rem);
    font-family: 'Nunito', sans-serif;
}
.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ---------- Feature List (Home) ---------- */
.feature-icon-sm {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ---------- Testimonial Cards ---------- */
.testimonial-text {
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

/* ---------- Instructor Cards ---------- */
.instructor-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-light);
}
.instructor-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

/* ---------- Methodology Steps ---------- */
.method-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    flex-shrink: 0;
}

/* ---------- Video Cards ---------- */
.video-card {
    padding: 0;
    overflow: hidden;
}
.video-placeholder {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.video-placeholder img {
    transition: var(--transition);
}
.video-placeholder:hover img {
    transform: scale(1.05);
}
.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 42, 58, 0.3);
    transition: var(--transition);
}
.play-overlay i {
    font-size: 4rem;
    color: #fff;
    transition: var(--transition);
}
.video-placeholder:hover .play-overlay {
    background: rgba(30, 42, 58, 0.45);
}
.video-placeholder:hover .play-overlay i {
    transform: scale(1.15);
}

/* ---------- Podcast Cards ---------- */
.podcast-card {
    padding: 1.5rem;
}
.podcast-play {
    cursor: pointer;
    transition: var(--transition);
}
.podcast-play:hover {
    transform: scale(1.1);
}

/* ---------- Cultural Icon ---------- */
.cultural-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---------- Resource Cards ---------- */
.resource-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Tool Cards ---------- */
.tool-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- CTA Section ---------- */
.cta-section {
    background: var(--bg-alt);
}
.cta-card {
    background: linear-gradient(135deg, #2B5F9E 0%, #5BA4E6 50%, #F08C7A 100%);
    position: relative;
    overflow: hidden;
}
.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

/* ---------- Accordion (Courses) ---------- */
.accordion-button {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}
.accordion-body {
    background-color: var(--bg-alt);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ---------- Contact Form ---------- */
.contact-form-card {
    background: #fff;
}
.form-control, .form-select {
    border: 2px solid var(--border);
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 164, 230, 0.15);
}
.form-label {
    font-family: 'Nunito', sans-serif;
    color: var(--secondary);
    font-size: 0.95rem;
}

/* ---------- Legal Content ---------- */
.legal-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}
.legal-content h3 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.legal-content p,
.legal-content li {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.8;
}
.legal-content ul {
    padding-left: 1.5rem;
}
.legal-content li {
    margin-bottom: 0.5rem;
}

/* ---------- Quiz Styles ---------- */
.quiz-container {
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}
.quiz-option:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    transform: translateY(-1px);
}
.quiz-option.correct {
    border-color: var(--success);
    background-color: var(--success-light);
    color: var(--success);
    animation: correctBounce 0.5s ease;
}
.quiz-option.incorrect {
    border-color: var(--danger);
    background-color: var(--danger-light);
    color: var(--danger);
    animation: shake 0.4s ease;
}
.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

@keyframes correctBounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
    60% { transform: translateY(-3px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.feedback-icon {
    font-size: 3rem;
}
.feedback-icon.correct {
    color: var(--success);
    animation: correctBounce 0.6s ease;
}
.feedback-icon.incorrect {
    color: var(--coral);
}

/* ---------- Results ---------- */
.results-container {
    background: #fff;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.progress-wheel-container {
    width: 200px;
    height: 200px;
}
.progress-wheel {
    width: 100%;
    height: 100%;
}
.recommendation-card {
    background: var(--primary-light);
    border: 2px solid var(--primary);
}
.schedule-options {
    background: var(--bg-alt);
    border: 1px solid var(--border);
}
.schedule-option {
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.schedule-option:hover,
.schedule-option.selected {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

/* ---------- Footer ---------- */
.site-footer {
    background: #1A2536;
    color: #CBD5E1;
    padding-top: 4rem;
}
.footer-heading {
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}
.footer-links a {
    color: #94A3B8;
    font-size: 0.9rem;
    display: block;
    padding: 0.3rem 0;
    transition: var(--transition);
}
.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}
.footer-contact li {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: #94A3B8;
}
.footer-contact a {
    color: #94A3B8;
}
.footer-contact a:hover {
    color: var(--primary);
}
.footer-divider {
    border-color: rgba(255,255,255,0.1);
}
.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    transition: var(--transition);
    font-size: 1.1rem;
}
.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- Cookie Banner ---------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 37, 54, 0.97);
    backdrop-filter: blur(8px);
    color: #CBD5E1;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}
.cookie-link {
    color: var(--primary) !important;
    text-decoration: underline !important;
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* ---------- Dyslexia Toggle ---------- */
.dyslexia-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--text);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.dyslexia-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.dyslexia-toggle.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---------- Scroll Animations ---------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Progress Bar Animations ---------- */
.progress-bar {
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Spacing Helpers ---------- */
.py-md-6 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

/* ---------- Badge Overrides ---------- */
.badge {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ---------- Focus Styles (Accessibility) ---------- */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Skip to content (screen reader) */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 99999;
}
.skip-link:focus {
    top: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        border-radius: var(--radius);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: var(--shadow);
    }
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
    .btn-nav-cta {
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
    .min-vh-hero {
        min-height: auto;
    }
    .hero-img {
        max-height: 320px;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding-top: 72px;
    }
    .page-hero {
        padding-top: 72px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .py-md-6 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    .path-card, .course-card, .testimonial-card,
    .resource-card, .jlpt-card, .instructor-card,
    .video-card, .podcast-card, .progress-card,
    .tool-card, .mini-card {
        padding: 1.5rem;
    }
    .stat-number {
        font-size: 1.8rem;
    }
    .instructor-img {
        width: 96px;
        height: 96px;
    }
    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
    }
    .dyslexia-toggle {
        bottom: 1.25rem;
        left: 1.25rem;
    }
    .footer-brand {
        text-align: center;
    }
    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 16px;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    .quiz-option {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
    .progress-wheel-container {
        width: 160px;
        height: 160px;
    }
}

/* ---------- Print ---------- */
@media print {
    .navbar, .site-footer, .cookie-banner, .back-to-top, .dyslexia-toggle, .cta-section {
        display: none !important;
    }
    .hero-section {
        background: #fff !important;
        color: var(--text) !important;
    }
}
