/* JavaScript Theme Colors */
:root {
    --js-yellow: #f7df1e;
    --js-dark: #181818;
    --js-black: #080808;
    --js-white: #ffffff;
    --js-gray: #64748b;
    --js-light: #f8fafc;
    --js-border: #e2e8f0;
    --js-code: #1e1e1e;
    --js-green: #22c55e;
}

* {
    box-sizing: border-box;
}

/* General JavaScript Page */
.javascript-page {
    margin: 0;
    background: var(--js-light);
    color: #1e293b;
    font-family: Arial, sans-serif;
}

/* TOP HEADER */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--js-black);
    color: var(--js-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    border-bottom: 2px solid var(--js-yellow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--js-white);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.brand > span:last-child span {
    color: var(--js-yellow);
}

.js-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.js-logo i {
    color: var(--js-yellow);
    font-size: 26px;
}

.head-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.head-links a {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.25s ease;
    white-space: nowrap;
}

.head-links a:hover {
    color: var(--js-yellow);
}

.back-headcourses {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.25s ease;
    white-space: nowrap;
}

.back-headcourses:hover {
    color: var(--js-yellow);
}

.header-label {
    background: rgba(247, 223, 30, 0.14);
    color: var(--js-yellow);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(247, 223, 30, 0.35);
    white-space: nowrap;
}

.menu-toggle,
.close-drawer {
    display: none;
    border: none;
    background: transparent;
    color: var(--js-white);
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .top-header {
        padding: 0 16px;
        gap: 10px;
    }

    .head-links {
        gap: 12px;
    }
}

@media (max-width: 650px) {
    .menu-toggle,
    .close-drawer {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .brand {
        font-size: 17px;
    }

    .js-logo i {
        font-size: 22px;
    }

    .head-links,
    .back-headcourses,
    .header-label {
        display: none;
    }
}

/* Lesson Layout */
.javascript-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.lesson-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #111827;
    color: var(--js-white);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.lesson-sidebar h3 {
    color: var(--js-yellow);
    margin: 0;
}

.lesson-list {
    flex: 1;
}

/* Lesson Links */
.lesson-link {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    margin-bottom: 7px;
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.25s ease, color 0.25s ease;
}

.lesson-link:hover {
    background: #273449;
    color: var(--js-white);
}

.lesson-link.active {
    background: var(--js-yellow);
    color: #111827;
    font-weight: bold;
}

.lesson-link.active .lesson-number {
    background: rgba(17, 24, 39, 0.16);
    color: #111827;
}

/* Lesson Number */
.lesson-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-right: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 12px;
}

/* Main Lesson Content */
.lesson-main {
    flex: 1;
    min-width: 0;
    padding: 30px;
}

/* Lesson Header */
.lesson-header {
    margin-bottom: 25px;
}

.lesson-header h1 {
    font-size: 30px;
    margin: 0 0 10px;
    color: #111827;
}

.lesson-header p {
    margin: 0;
    color: var(--js-gray);
    line-height: 1.7;
}

/* Lesson Category */
.lesson-category {
    display: inline-block;
    background: #fef9c3;
    color: #854d0e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Lesson Content Card */
.lesson-content {
    background: var(--js-white);
    padding: 28px;
    border-radius: 14px;
    border: 1px solid var(--js-border);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

/* Lesson Headings */
.lesson-content h2 {
    color: #111827;
    font-size: 23px;
    margin-top: 28px;
    margin-bottom: 14px;
}

.lesson-content h2:first-child {
    margin-top: 0;
}

.lesson-content h3 {
    color: #1e293b;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Lesson Paragraphs */
.lesson-content p {
    color: #475569;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Lesson Lists */
.lesson-content ul,
.lesson-content ol {
    padding-left: 25px;
    margin-bottom: 20px;
}

.lesson-content li {
    color: #475569;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 7px;
}

/* Inline Code */
.lesson-content p code,
.lesson-content li code {
    background: #f1f5f9;
    color: #b45309;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Introduction Banner */
.intro-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #181818, #303030);
    color: var(--js-white);
    padding: 28px;
    border-radius: 14px;
    margin-bottom: 28px;
}

.intro-banner h2 {
    color: var(--js-white);
    font-size: 25px;
    margin: 0 0 8px;
}

.intro-banner p {
    color: #d1d5db;
    margin: 0;
}

.banner-icon i {
    font-size: 65px;
    color: var(--js-yellow);
}

/* Information Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fefce8;
    border-left: 4px solid var(--js-yellow);
    padding: 17px;
    border-radius: 8px;
    margin: 22px 0;
}

.info-box i {
    color: #ca8a04;
    font-size: 20px;
    margin-top: 2px;
}

.info-box div {
    color: #713f12;
    font-size: 14px;
    line-height: 1.7;
}

/* Code Example Container */
.code-example-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 20px 0 28px;
    align-items: stretch;
}

/* Code Example */
.code-example,
.code-preview {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #334155;
    border-radius: 10px;
    background: var(--js-code);
}

/* Code Header */
.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #111827;
    color: #f8fafc;
    padding: 12px 15px;
    font-size: 12px;
}

.code-header span:first-child {
    font-weight: bold;
}

.code-header span:last-child {
    color: #94a3b8;
}

/* JavaScript Code Area */
.code-example pre {
    background: var(--js-code);
    color: #f8fafc;
    padding: 18px;
    margin: 0;
    min-height: 180px;
    overflow-x: auto;
    white-space: pre;
}

.code-example pre code {
    color: #f8fafc;
    font-family: Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
}

/* Output Preview */
.code-preview {
    background: var(--js-white);
    border-color: var(--js-border);
}

.code-preview .code-header {
    background: #e2e8f0;
    color: #1e293b;
}

.code-preview .code-header span:last-child {
    color: #64748b;
}

.example-preview-frame {
    display: block;
    width: 100%;
    height: 180px;
    border: none;
    background: var(--js-white);
}

/* Lesson Takeaways & Common Mistakes */
.takeaway-section,
.mistake-section {
    padding: 22px;
    border-radius: 12px;
    margin-top: 22px;
}

.takeaway-section {
    background: #f0fdf4;
}

.takeaway-section h3 {
    margin: 0 0 12px;
    color: #166534;
}

.takeaway-section ul {
    margin: 0;
    padding-left: 22px;
}

.takeaway-section li {
    color: #166534;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 6px;
}

.mistake-section {
    background: #fef2f2;
}

.mistake-section h3 {
    margin: 0 0 12px;
    color: #991b1b;
}

.mistake-section ul {
    margin: 0;
    padding-left: 22px;
}

.mistake-section li {
    color: #991b1b;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 6px;
}

/* Lesson Navigation Buttons */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 28px;
}

.lesson-navigation button {
    border: none;
    background: var(--js-dark);
    color: var(--js-white);
    padding: 12px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.25s ease, color 0.25s ease;
}

.lesson-navigation button:hover:not(:disabled) {
    background: #ca8a04;
    color: #111827;
}

.lesson-navigation button:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

/* Sidebar Overlay */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 998;
}

.drawer-overlay.active {
    display: block;
}

/* Creator Section */
.creator-section {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 25px;
    background: #fffbeb;
    border-radius: 12px;
    border: 1px solid #fef3c7;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.creator-section h2 {
    margin: 0 0 10px 0;
    color: #92400e;
    font-size: 22px;
}

.creator-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fef3c7;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.creator-info p {
    margin: 0;
    color: #78350f;
    font-size: 15px;
    line-height: 1.7;
    max-width: 600px;
}

@media (min-width: 768px) {
    .creator-section {
        flex-direction: row;
        text-align: left;
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .lesson-sidebar {
        width: 240px;
    }

    .lesson-main {
        padding: 20px;
    }

    .code-example-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .javascript-container {
        display: block;
    }

    .lesson-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100%;
        width: 270px;
        z-index: 999;
        transition: left 0.3s ease;
    }

    .lesson-sidebar.active {
        left: 0;
    }

    .lesson-main {
        padding: 18px;
    }

    .lesson-content {
        padding: 18px;
    }

    .lesson-header h1 {
        font-size: 24px;
    }

    .intro-banner {
        padding: 20px;
    }

    .intro-banner h2 {
        font-size: 20px;
    }

    .banner-icon i {
        font-size: 40px;
    }

    .lesson-navigation button {
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* LESSON QUIZ SECTION (JS THEME) */
.js-quiz-section {
    margin-top: 22px;
    padding: 24px;
    border-radius: 14px;
    background: var(--js-white);
    border: 1px solid var(--js-border);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.js-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--js-border);
}

.js-quiz-badge {
    display: inline-block;
    background: #fef9c3;
    color: #854d0e;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.js-quiz-header h2 {
    font-size: 20px;
    color: #111827;
    margin: 6px 0 0;
}

.js-quiz-header h2 i {
    color: #ca8a04;
    margin-right: 6px;
}

.js-quiz-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.js-quiz-progress-badge {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.js-hearts-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 20px;
}

.js-heart-icon {
    color: #ef4444;
    font-size: 14px;
    transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.js-heart-icon.lost {
    color: #cbd5e1;
    opacity: 0.55;
    transform: scale(0.88);
}

.js-quiz-question-text {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
    line-height: 1.6;
}

.js-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.js-quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}

.js-quiz-option:hover:not(:disabled) {
    border-color: #ca8a04;
    background: #fefce8;
}

.js-quiz-option.correct {
    border-color: #16a34a;
    background: #dcfce7;
    color: #14532d;
    font-weight: 600;
}

.js-quiz-option.wrong {
    border-color: #dc2626;
    background: #fee2e2;
    color: #7f1d1d;
    font-weight: 600;
}

.js-quiz-feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.js-quiz-feedback.correct {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.js-quiz-feedback.wrong {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.js-quiz-footer-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.js-quiz-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--js-dark);
    color: var(--js-yellow);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.js-quiz-btn:hover {
    background: var(--js-yellow);
    color: #111827;
}

.js-quiz-btn.retry-btn {
    background: #0d9488;
    color: #ffffff;
}

.js-quiz-btn.retry-btn:hover {
    background: #0f766e;
}

.js-quiz-summary {
    text-align: center;
    padding: 18px 12px;
}

.js-quiz-summary h3 {
    font-size: 18px;
    color: #111827;
    margin: 0 0 8px;
}

.js-quiz-summary p {
    font-size: 13px;
    color: #475569;
    margin: 0 0 16px;
}

@media (max-width: 650px) {
    .js-quiz-section {
        padding: 18px;
    }
}

