* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* 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;
    background: #091528;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid #2563eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand span {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.head-links {
    display: flex;
    gap: 20px;
}

.head-links a {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    transition: 0.3s;
}

.head-links a:hover {
    color: #38bdf8;
}

.menu-toggle,
.close-drawer {
    border: none;
    background: transparent;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.back-headcourses {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    transition: 0.3s;
}

.back-headcourses:hover {
    color: #38bdf8;
}

.header-label {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(37, 99, 235, 0.4);
}

/* DRAWER SIDEBAR */
.lesson-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    padding: 25px;
    background: #0c1e38;
    color: #e2e8f0;
    z-index: 1200;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.lesson-drawer.active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.sidebar-course {
    padding: 18px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(15, 23, 42, 0.4));
}

.course-label,
.nav-heading {
    color: #64748b;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    display: block;
    margin-bottom: 8px;
}

.sidebar-course h3 {
    font-size: 16px;
    color: #38bdf8;
    margin-top: 4px;
}

.sidebar-course h3 i {
    color: #f43f5e;
    margin-right: 6px;
}

.sidebar-course p {
    color: #94a3b8;
    font-size: 11px;
    margin-top: 6px;
}

.lesson-navigation {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lesson-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #cbd5e1;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    transition: 0.25s;
}

.lesson-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.lesson-link.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.lesson-number {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.back-courses {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 35px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
    transition: 0.2s;
}

.back-courses:hover {
    background: rgba(37, 99, 235, 0.2);
    color: #38bdf8;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    backdrop-filter: blur(3px);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MAIN CONTENT LAYOUT */
.content-wrapper {
    max-width: 1050px;
    margin: 0 auto;
    padding: 45px 5%;
}

.lesson-topline {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.lesson-category {
    color: #2563eb;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.lesson-heading h1 {
    font-size: clamp(28px, 4vw, 38px);
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 800;
}

.lesson-heading p {
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
    max-width: 700px;
}

/* LESSON SECTION CARD */
.lesson-section {
    margin-top: 30px;
    padding: 35px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.intro-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
    color: white;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.15);
}

.intro-banner span {
    color: #38bdf8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.intro-banner h2 {
    color: #ffffff !important;
    font-size: 24px;
    margin: 8px 0;
}

.intro-banner p {
    color: rgb(206, 214, 215) !important;
    font-size: 12px;
    line-height: 1.6;
    max-width: 500px;
}

.banner-icon {
    font-size: 75px;
    color: #38bdf8;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.lesson-section h2 {
    font-size: 20px;
    color: #0f172a;
    margin: 25px 0 12px;
}

.lesson-section p {
    font-size: 13px;
    color: #475569;
    line-height: 1.8;
    margin-bottom: 15px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    margin: 20px 0;
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    color: #1e40af;
    font-size: 12px;
    line-height: 1.7;
}

.info-box i {
    font-size: 18px;
    margin-top: 2px;
}

/* CODE EXAMPLE BOXES */
.code-example-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.code-example,
.code-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.code-example {
    background: #0f172a;
    border-color: #334155;
}

.code-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 11px;
    border-bottom: 1px solid #334155;
}

.code-example pre {
    padding: 18px;
    color: #e2e8f0;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
    overflow-x: auto;
}

.code-preview {
    background: white;
    display: flex;
    flex-direction: column;
}

.preview-header-title {
    background: #f1f5f9;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.example-preview-frame {
    width: 100%;
    height: 100%;
    min-height: 160px;
    border: none;
    padding: 12px;
}

/* TAKEAWAYS & MISTAKES */
.takeaways,
.mistakes {
    margin-top: 25px;
    padding: 25px;
    border-radius: 14px;
    background: white;
    border: 1px solid #e2e8f0;
}

.takeaways h2 {
    color: #2563eb;
    font-size: 16px;
    margin-bottom: 12px;
}

.mistakes h2 {
    color: #d97706;
    font-size: 16px;
    margin-bottom: 12px;
}

.takeaways ul,
.mistakes ul {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #475569;
}

/* LESSON QUIZ SECTION */
.quiz-section {
    margin-top: 25px;
    padding: 28px;
    border-radius: 16px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.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 #e2e8f0;
}

.quiz-header h2 {
    font-size: 18px;
    color: #0f172a;
    margin-top: 4px;
}

.quiz-header h2 i {
    color: #2563eb;
    margin-right: 6px;
}

.quiz-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-progress-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.hearts-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 6px 12px;
    border-radius: 20px;
}

.heart-icon {
    color: #ef4444;
    font-size: 14px;
    transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.heart-icon.lost {
    color: #cbd5e1;
    opacity: 0.55;
    transform: scale(0.88);
}

.quiz-question-text {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 16px;
    line-height: 1.6;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    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;
    transition: 0.2s ease;
}

.quiz-option:hover:not(:disabled) {
    border-color: #2563eb;
    background: #eff6ff;
}

.quiz-option.correct {
    border-color: #16a34a;
    background: #dcfce7;
    color: #14532d;
    font-weight: 600;
}

.quiz-option.wrong {
    border-color: #dc2626;
    background: #fee2e2;
    color: #7f1d1d;
    font-weight: 600;
}

.quiz-feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
}

.quiz-feedback.correct {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.quiz-feedback.wrong {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.quiz-footer-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.quiz-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s ease;
}

.quiz-btn:hover {
    background: #1d4ed8;
}

.quiz-btn.retry-btn {
    background: #0d9488;
}

.quiz-btn.retry-btn:hover {
    background: #0f766e;
}

.quiz-summary {
    text-align: center;
    padding: 18px 12px;
}

.quiz-summary h3 {
    font-size: 18px;
    color: #0f172a;
    margin-bottom: 8px;
}

.quiz-summary p {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
}

/* PRACTICE PLAYGROUND SECTION */
.practice-section {
    margin-top: 35px;
}

.practice-heading {
    margin-bottom: 20px;
}

.practice-heading h2 {
    font-size: 26px;
    color: #0f172a;
    margin: 8px 0;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.preset-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: 0.2s;
}

.preset-btn:hover,
.preset-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* SIDE-BY-SIDE EDITOR CONTAINER */
.editor-container {
    display: flex;
    flex-direction: row;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #334155;
    height: 480px;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #334155;
    background: #0f172a;
}

.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.editor-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.editor-file {
    color: #cbd5e1;
    font-size: 12px;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: #334155;
    color: white;
    font-size: 11px;
    font-weight: 500;
    transition: 0.2s;
}

.editor-actions button:hover {
    opacity: 0.9;
}

.editor-actions .run-button {
    background: #2563eb;
}

.CodeMirror {
    height: 100% !important;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

.preview-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid #334155;
}

#htmlPreview {
    flex: 1;
    width: 100%;
    height: 100%;
    background: white;
    border: none;
}

/* NAVIGATION BOTTOM */
.lesson-navigation-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px;
}

.lesson-navigation-bottom button {
    padding: 12px 20px;
    border: none;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.previous-button {
    background: #e2e8f0;
    color: #475569;
}

.next-button,
.complete-button {
    background: #2563eb;
    color: white;
}

.complete-button {
    background: #0d9488;
}

/* CSS ERROR HIGHLIGHT */
.cm-css-error-highlight {
    background: rgba(239, 68, 68, 0.20);
    border-bottom: 2px solid #ef4444;
}

/* CREATOR OF CSS CARD */
.creator-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    margin: 22px 0 26px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    background: #f8fafc;
}

.creator-avatar-wrap {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: #eff6ff;
    border: 2px solid #2563eb;
    color: #2563eb;
    display: grid;
    place-items: center;
    font-size: 28px;
}

.creator-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.creator-fallback-icon {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #2563eb;
}

.creator-fallback-icon.show-fallback {
    display: flex;
}

.creator-role {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 4px;
}

.creator-info h3 {
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 4px;
}

.creator-info p {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 600px) {
    .creator-card {
        flex-direction: column;
        text-align: center;
    }
}

/* MOBILE RESPONSIVE - CSS PAGE */
@media (max-width: 900px) {
    .top-header {
        padding: 0 16px;
        gap: 10px;
    }

    .head-links {
        gap: 12px;
    }

    .content-wrapper {
        padding: 28px 16px;
    }

    .lesson-section {
        padding: 22px 18px;
    }

    .intro-banner {
        flex-direction: column;
        text-align: center;
        padding: 22px 18px;
    }

    .banner-icon {
        font-size: 56px;
    }

    .code-example-container {
        grid-template-columns: 1fr !important;
    }

    .editor-container {
        flex-direction: column !important;
        height: auto !important;
    }

    .editor-pane {
        border-right: none !important;
        border-bottom: 1px solid #334155;
    }

    .CodeMirror {
        height: 260px !important;
    }

    #htmlPreview {
        min-height: 240px;
    }
}

@media (max-width: 600px) {
    .brand {
        font-size: 18px;
    }

    .head-links,
    .header-label {
        display: none;
    }

    .lesson-topline {
        flex-wrap: wrap;
        gap: 6px;
    }

    .lesson-navigation-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .lesson-navigation-bottom button {
        width: 100%;
    }
}