/* =========================================
   CSS Reset & Variables
   ========================================= */
:root {
    --primary-color: #0f172a;
    /* Deep Blue */
    --accent-color: #f59e0b;
    /* Warm Gold/Amber */
    --accent-hover: #d97706;
    --whatsapp-green: #25D366;
    --whatsapp-hover: #128C7E;
    --text-main: #334155;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --accordion-bg: #f8fafc;
    --top-bar-bg: rgba(255, 255, 255, 0.85);
    /* Light Glassmorphism */

    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --border-radius: 12px;
    --border-radius-lg: 20px;
}

[data-theme='dark'] {
    --primary-color: #f8fafc;
    --accent-color: #fbbf24;
    --text-main: #e2e8f0;
    --text-light: #94a3b8;
    --bg-light: #0f172a;
    --bg-white: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.8);
    --accordion-bg: #0f172a;
    --top-bar-bg: rgba(15, 23, 42, 0.85);
    /* Dark Glassmorphism for Dark Mode */

    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    background-image: url('../images/bg-education.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   Typography & Buttons
   ========================================= */
h1,
h2,
h3,
h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    gap: 10px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.primary-btn:hover {
    background-color: #1e293b;
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.whatsapp-btn {
    background-color: var(--whatsapp-green);
    color: var(--bg-white);
}

.whatsapp-btn:hover {
    background-color: var(--whatsapp-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* =========================================
   Top Bar (Progress & Theme)
   ========================================= */
.top-bar {
    background: var(--top-bar-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.05);
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-direction: row-reverse;
    /* Added to align the first item (logo) to the left due to RTL */
}

/* Logo Styling for Light / Dark themes */
.logo-img {
    height: 80px;
    object-fit: contain;
    /* Light Mode: Invert background and text, then multiply to drop white bg */
    filter: invert(1);
    mix-blend-mode: multiply;
}

[data-theme='dark'] .logo-img {
    /* Dark Mode: Keep original colors, drop black background */
    filter: none;
    mix-blend-mode: screen;
}

.dark-bg-logo {
    filter: none !important;
    mix-blend-mode: screen !important;
}

/* Ensure text is readable */
.top-bar .site-branding,
.top-bar .icon,
.top-bar .progress-text,
.top-bar .progress-percentage {
    color: var(--text-main) !important;
}

.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    color: var(--text-main);
}

.theme-toggle-btn:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

.progress-tracker {
    flex-grow: 1;
    max-width: 400px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--whatsapp-green);
    width: 0%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   Section 1: Hero
   ========================================= */
.hero {
    padding: 100px 0;
    background: transparent;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding: 120px 0 60px 0;
    }
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.badge {
    display: inline-block;
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--accent-hover);
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--accent-color);
    position: relative;
    display: inline-block;
}

.hero h1 span::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(245, 158, 11, 0.3);
    z-index: -1;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.course-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.05rem;
}

.pricing-box {
    background: var(--bg-white);
    padding: 20px 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    display: inline-block;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.price-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.price {
    font-size: 3rem;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 5px;
}

.price .currency {
    font-size: 1.2rem;
    color: var(--text-light);
}

.old-price {
    text-decoration: line-through;
    color: #ef4444;
    font-size: 0.95rem;
}

/* Hero Visual & Glassmorphism */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    width: 100%;
    max-width: 500px;
    height: 350px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.4);
    transition: all 0.3s ease;
    padding-left: 5px;
    /* Visual center for play icon */
}

.play-btn:hover {
    transform: scale(1.1);
}

.blob {
    position: absolute;
    filter: blur(60px);
    z-index: 1;
    border-radius: 50%;
    opacity: 0.6;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background-color: rgba(245, 158, 11, 0.4);
    top: -50px;
    right: -50px;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background-color: rgba(56, 189, 248, 0.4);
    bottom: -20px;
    left: -20px;
}

/* =========================================
   Section 2: Support / Persuasion 
   ========================================= */
.support {
    padding: 80px 0;
    background-color: var(--primary-color);
    color: var(--bg-white);
    /* Keeps the text contrast even in dark mode for this specific section */
    text-align: center;
    position: relative;
}

[data-theme='dark'] .support {
    background-color: #1e293b;
}

[data-theme='dark'] .support h2,
[data-theme='dark'] .support p {
    color: #e2e8f0;
}

.support h2 {
    color: var(--bg-white);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.support p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 40px auto;
    color: #cbd5e1;
}

/* =========================================
   Section 3: Testimonials / Reviews
   ========================================= */
.testimonials {
    padding: 80px 0;
    background-color: rgba(255, 255, 255, 0.5);
    /* semi-transparent to show bg */
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.review-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: transform 0.3s ease;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.reviewer-avatar {
    font-size: 2.5rem;
    background-color: #f1f5f9;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme='dark'] .reviewer-avatar {
    background-color: #334155;
}

.reviewer-info h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

.stars {
    letter-spacing: 2px;
}

.review-text {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.8;
    font-style: italic;
}

/* =========================================
   Section 3.5: Features
   ========================================= */
.features {
    padding: 80px 0;
    background-color: var(--bg-shade);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-theme='dark'] .feature-card {
    background-color: var(--bg-dark);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-light), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* =========================================
   Section 4: Curriculum / Accordion
   ========================================= */
.curriculum {
    padding: 100px 0;
    background-color: transparent;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-desc {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 60px;
}

.accordion-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accordion-item {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    width: 100%;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
    /* RTL */
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: #f1f5f9;
}

.lesson-title-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lesson-desc {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-light);
}

.toggle-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: var(--bg-shade);
}

.accordion-body {
    padding: 20px 25px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    background-color: #cbd5e1;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Sub-Accordion / Nested Accordion Styles */
.sub-accordion {
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background-color: var(--bg-white);
}

.sub-accordion-header {
    width: 100%;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--accordion-bg);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
    transition: background-color 0.3s ease;
}

.sub-accordion-header:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

.sub-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--accent-color);
}

.sub-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: var(--bg-white);
}

.lesson-exercise,
.lesson-audio {
    padding: 20px;
}

.lesson-exercise p {
    color: var(--text-main);
    line-height: 1.8;
}

/* Quiz Styles */
.lesson-quiz {
    padding: 20px;
}

.quiz-question {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.05rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    background-color: var(--bg-white);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    text-align: right;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
    background-color: rgba(148, 163, 184, 0.1);
}

.quiz-option.correct {
    background-color: rgba(37, 211, 102, 0.1);
    color: #16a34a;
    border-color: #16a34a;
    font-weight: 700;
}

.quiz-option.incorrect {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-color: #dc2626;
}

.quiz-feedback {
    margin-top: 15px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    display: none;
    /* Hidden by default */
}

.quiz-feedback.success {
    display: block;
    background-color: rgba(37, 211, 102, 0.15);
    color: #16a34a;
}

.quiz-feedback.error {
    display: block;
    background-color: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.lesson-audio audio {
    width: 100%;
    outline: none;
    border-radius: 50px;
}

.lesson-materials {
    display: flex;
    gap: 15px;
}

.material-btn {
    padding: 8px 16px;
    background-color: #e2e8f0;
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.material-btn:hover {
    background-color: #cbd5e1;
}

/* Accordion Active State */
.accordion-item.active {
    box-shadow: var(--shadow-heavy);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.accordion-item.active .toggle-icon {
    transform: rotate(45deg);
}

/* =========================================
   Section 5: FAQ
   ========================================= */
.faq {
    padding: 80px 0;
    background-color: var(--bg-shade);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-answer {
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* =========================================
   Footer
   ========================================= */
footer {
    background-color: var(--primary-color);
    color: #94a3b8;
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #1e293b;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero h1 span::after {
        left: 50%;
        transform: translateX(-50%);
        width: 120px;
    }

    .course-features {
        justify-content: center;
    }

    .hero-visual {
        margin-top: 40px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 90px 0 30px 0;
    }

    .hero-content {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.35;
    }

    .hero h1 span::after {
        width: 80px;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
        padding: 0 5px;
    }

    .course-features {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .feature {
        font-size: 0.9rem;
    }

    .pricing-box {
        padding: 15px 10px;
        width: 100%;
        box-sizing: border-box;
    }

    .price {
        font-size: 2rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-buttons .cta-button {
        width: 100%;
        margin-bottom: 0 !important;
        box-sizing: border-box;
        padding: 12px 15px;
        font-size: 0.95rem;
        white-space: normal;
        text-align: center;
    }

    .hero-visual .glass-card {
        width: 100%;
        box-sizing: border-box;
    }

    .cta-button {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .accordion-header {
        font-size: 1rem;
        padding: 15px;
    }

    .accordion-body {
        padding: 15px;
    }

    .lesson-materials {
        flex-direction: column;
    }
}