* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

button,
a {
    font-family: inherit;
}

button {
    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;
    gap: 16px;
    background: #091528;
    color: #ffffff;
    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: #ffffff;
    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;
    align-items: center;
    gap: 20px;
}

.head-links a {
    text-decoration: none;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.25s ease;
}

.head-links a:hover {
    color: #38bdf8;
}

.back-headcourses {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.25s ease;
}

.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);
    white-space: nowrap;
}

/* MAIN LAYOUT */
.content-wrapper {
    max-width: 1050px;
    margin: 0 auto;
    padding: 40px 5%;
}

.lesson-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 10px;
}

.lesson-category {
    color: #2563eb;
    letter-spacing: 1.2px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    display: inline-block;
}

.lesson-heading h1 {
    font-size: clamp(28px, 4vw, 38px);
    color: #0f172a;
    margin-bottom: 10px;
    font-weight: 800;
}

.lesson-heading p {
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
    max-width: 720px;
}

/* ACTIVITY TASK CARD */
.lesson-section {
    margin-top: 26px;
    padding: 28px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.lesson-section h2 {
    font-size: 20px;
    color: #0f172a;
    margin: 8px 0 10px;
}

.lesson-section p {
    font-size: 13px;
    color: #475569;
    line-height: 1.75;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    margin-top: 16px;
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    color: #1e40af;
    font-size: 12px;
    line-height: 1.65;
}

.info-box i {
    font-size: 16px;
    margin-top: 2px;
}

/* PRACTICE PLAYGROUND */
.practice-section {
    margin-top: 30px;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.preset-btn {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid #334155;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.preset-btn:hover,
.preset-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.editor-container {
    display: flex;
    flex-direction: row;
    background: #0f172a;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
    border: 1px solid #334155;
    height: 460px;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #334155;
    background: #0f172a;
    min-width: 0;
}

.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    min-width: 0;
}

.editor-topbar,
.preview-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 12px;
    border-bottom: 1px solid #334155;
}

.preview-heading {
    font-size: 11px;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.editor-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: #334155;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.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;
}

#htmlPreview {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: none;
}

/* ERROR PANEL */
.error-panel {
    background: #111827;
    border: 1px solid #334155;
    border-top: none;
    border-radius: 0 0 14px 14px;
    color: #e2e8f0;
}

.error-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 18px;
    background: #1e293b;
    font-size: 12px;
    font-weight: 600;
}

.error-panel-header i {
    color: #f87171;
    margin-right: 6px;
}

#cssErrorCount {
    color: #94a3b8;
}

.error-list {
    padding: 12px 18px;
    max-height: 150px;
    overflow-y: auto;
}

.error-item {
    padding: 9px 12px;
    margin-bottom: 8px;
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.6;
}

.error-item strong {
    color: #f87171;
}

.no-errors {
    color: #4ade80;
    font-size: 12px;
}

.no-errors i {
    margin-right: 6px;
}

.cm-css-error-highlight {
    background: rgba(239, 68, 68, 0.22);
    border-bottom: 2px solid #ef4444;
}

/* BOTTOM NAVIGATION */
.lesson-navigation-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.nav-btn-secondary,
.nav-btn-primary {
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.nav-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.nav-btn-secondary:hover,
.nav-btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}
