/* =====================================================
   Web Development MOOC - Main Stylesheet
   Clean, professional design with orange theme
   ===================================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #3b5f7a;
    --accent-dark: #2f4b61;
    --accent-light: #6f8aa3;
    --accent-soft: #e7eef3;
}

html, body {
    min-height: 100%;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1.7;
}

#main-layout {
    height: 100%;
    width: 100%;
}

/* =====================================================
   HEADER / FOOTER (DHTMLX Layout)
   ===================================================== */
.dhx_layout-cell[data-cell-id="header"],
.dhx_layout-cell[dhx-id="header"] {
    overflow: hidden !important;
}

.dhx_layout-cell[data-cell-id="footer"],
.dhx_layout-cell[dhx-id="footer"] {
    overflow: hidden !important;
}

/* Header row (from IT portal) */
.dhx_layout-cell[dhx-id="header"],
.dhx_layout-cell[data-cell-id="header"] {
    background: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Footer row (from IT portal) */
.dhx_layout-cell[dhx-id="footer"],
.dhx_layout-cell[data-cell-id="footer"] {
    background: #fff !important;
    border-top: 1px solid #e0e0e0 !important;
}

/* ================================================================
   MENU STYLING - 1:1 from IT portal
   ================================================================ */
/* Menu container */
.dhx_widget.dhx_menu.custom {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.18) !important;
    font-family: 'Open Sans', sans-serif !important;
    justify-content: center !important;
}

/* Menu items */
.custom .dhx_menu-item {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 12px 18px !important;
    transition: all 0.3s ease !important;
    border-radius: 6px !important;
    margin: 2px 4px !important;
}

/* Menu item hover effect */
.custom .dhx_menu-item:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Active/selected menu item */
.custom .dhx_menu-item--active,
.custom .dhx_menu-item--selected {
    background: rgba(255, 255, 255, 0.25) !important;
    font-weight: 600 !important;
}

/* Menu icons */
.custom .dhx_menu-item .fas,
.custom .dhx_menu-item .fab {
    font-size: 18px !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
}

/* Submenu dropdown */
.custom .dhx_menu-list {
    background: #ffffff !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    padding: 8px 0 !important;
    margin-top: 4px !important;
}

/* Submenu items */
.custom .dhx_menu-list .dhx_menu-item {
    color: #333333 !important;
    padding: 20px 20px !important;
    margin: 2px 8px !important;
    border-radius: 6px !important;
    min-height: 48px !important;
    line-height: 1.5 !important;
}

/* Submenu item hover */
.custom .dhx_menu-list .dhx_menu-item:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%) !important;
    color: #ffffff !important;
    transform: translateX(5px) !important;
}

/* Submenu separator */
.custom .dhx_menu-separator {
    margin: 8px 12px !important;
    background: #e0e0e0 !important;
    height: 1px !important;
}

/* Custom menu badges */
.menu-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    vertical-align: middle;
    line-height: 1;
}

/* Arrow indicator for nested menus */
.custom .dhx_menu-arrow {
    color: inherit !important;
    margin-left: 8px !important;
}

/* Nested submenu indentation */
.dhx_menu--popup .dhx_menu--popup .dhx_menu-item {
    padding-left: 35px !important;
    background: #fafafa !important;
}
.dhx_menu--popup .dhx_menu--popup .dhx_menu-item:hover {
    background: var(--accent-soft) !important;
}
.dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu-item {
    padding-left: 50px !important;
    background: #f5f5f5 !important;
}
.dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu-item:hover {
    background: var(--accent-soft) !important;
}

/* 4th level submenu - for deeply nested regulatory content */
.dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu-item {
    padding-left: 70px !important;
    background: #eeeeee !important;
    font-size: 13px !important;
}
.dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu--popup .dhx_menu-item:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%) !important;
    color: #ffffff !important;
    transform: translateX(5px) !important;
}

/* Font Awesome icon colors in menu */
.dhx_menu-item .fas,
.dhx_menu-item .far,
.dhx_menu-item .fab {
    margin-right: 8px !important;
}

/* Portal main menu icons */
.fa-award { color: #ff9800 !important; }
.fa-file-contract { color: #9c27b0 !important; }
.fa-laptop-code { color: #2196f3 !important; }
.fa-microchip { color: #f44336 !important; }
.fa-square-root-alt { color: #00bcd4 !important; }
.fa-user { color: #4caf50 !important; }

/* Navigation icons */
.fa-arrow-left { color: #757575 !important; }
.fa-arrow-right { color: #757575 !important; }
.fa-home { color: #ff9800 !important; }
.fa-search { color: #2196f3 !important; }
.fa-sitemap { color: #9c27b0 !important; }

/* Web Development icons */
.fa-globe { color: #03a9f4 !important; }
.fa-html5 { color: #e34c26 !important; }
.fa-css3-alt { color: #264de4 !important; }
.fa-js { color: #f7df1e !important; }
.fa-react { color: #61dafb !important; }
.fa-node-js { color: #339933 !important; }
.fa-npm { color: #cb3837 !important; }
.fa-database { color: #ff5722 !important; }

#content-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #fff;
}

#content-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#welcome-content {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #fff;
    display: block;
}

/* =====================================================
   LAYOUT CELLS
   ===================================================== */
.dhx_layout-cell {
    overflow: hidden !important;
}

.dhx_layout-cell[data-cell-id="content"] {
    overflow: hidden !important;
}

/* =====================================================
   SIDEBAR - Clean MOOC Style with Expandable Menus
   ===================================================== */
.dhx_sidebar,
.mooc-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5e5e5 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Sidebar scrollbar */
.dhx_sidebar::-webkit-scrollbar {
    width: 6px;
}

.dhx_sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dhx_sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Main menu items */
.dhx_sidebar .dhx_navbar-item {
    color: #333 !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    min-height: auto !important;
}

.dhx_sidebar .dhx_navbar-item:hover {
    background: #f5f5f5 !important;
    color: #333 !important;
}

.dhx_sidebar .dhx_navbar-item--selected {
    background: #f0f0f0 !important;
    color: #333 !important;
    border-left: 3px solid var(--accent) !important;
}

/* Item text */
.dhx_sidebar .dhx_navbar__title {
    color: inherit !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Hide default icons */
.dhx_sidebar .dhx_navbar__icon {
    display: none !important;
}

/* Expand arrow for items with children */
.dhx_sidebar .dhx_navbar__expand-icon {
    color: #999 !important;
    font-size: 12px !important;
    margin-left: auto !important;
}

/* Sub-items (expanded sections) */
.dhx_sidebar .dhx_navbar-item--parent .dhx_navbar__title {
    font-weight: 500 !important;
}

.dhx_sidebar .dhx_navbar-item[data-level="1"] {
    padding-left: 30px !important;
    font-size: 13px !important;
    color: #555 !important;
    background: #fafafa !important;
}

.dhx_sidebar .dhx_navbar-item[data-level="1"]:hover {
    background: #f0f0f0 !important;
    color: var(--accent) !important;
}

.dhx_sidebar .dhx_navbar-item[data-level="1"].dhx_navbar-item--selected {
    background: #f0f0f0 !important;
    color: var(--accent) !important;
    border-left-color: var(--accent) !important;
}

/* Sidebar Title/Logo */
.sidebar-title {
    padding: 20px 16px;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-title h2 {
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* Sidebar Section Headers */
.sidebar-section {
    padding: 16px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-transform: none;
    border-top: 1px solid #e5e5e5;
    margin-top: 8px;
    background: #fff;
}

/* Sidebar separator */
.dhx_sidebar .dhx_navbar-separator {
    margin: 8px 16px !important;
    background: #e5e5e5 !important;
    height: 1px !important;
}

/* =====================================================
   MAIN CONTENT AREA
   ===================================================== */
.content-wrapper {
    padding: 40px 30px;
    max-width: 900px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
    background: #ffffff;
}

/* Part Title */
.part-title {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
}

/* Section List Box */
.section-box {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 25px 30px;
    margin-bottom: 30px;
}

.section-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.section-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e5e5e5;
    font-size: 15px;
    color: #333;
}

.section-list li:last-child {
    border-bottom: none;
}

.section-list a {
    color: #333;
    text-decoration: none;
    display: block;
}

.section-list a:hover {
    color: var(--accent);
}

/* Expandable Exercises Box */
.exercises-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-top: 20px;
}

.exercises-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #333;
}

.exercises-header:hover {
    background: #f9f9f9;
}

.exercises-header .arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.exercises-header.open .arrow {
    transform: rotate(180deg);
}

.exercises-content {
    display: none;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
}

.exercises-content.show {
    display: block;
}

/* =====================================================
   CONTENT TYPOGRAPHY
   ===================================================== */
.content-card {
    background: white;
    padding: 0;
    margin-bottom: 30px;
}

.content-card h2 {
    font-size: 42px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    border: none;
    padding: 0;
}

.content-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px 0;
}

.content-card p {
    color: #333;
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 16px;
}

/* =====================================================
   CODE BLOCKS
   ===================================================== */
.code-block {
    background: #282c34;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.code-header {
    background: #21252b;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header span {
    color: #6b717d;
    font-size: 12px;
    text-transform: uppercase;
}

.code-header button {
    background: transparent;
    color: #6b717d;
    border: 1px solid #6b717d;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.code-header button:hover {
    background: #6b717d;
    color: #282c34;
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #abb2bf;
}

/* =====================================================
   INTERACTIVE CODE EDITOR - MOOC STYLE
   ===================================================== */
.exercise-editor {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}

/* CodeMirror container */
.exercise-editor .CodeMirror {
    height: auto;
    min-height: 150px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px solid #444;
}

.exercise-editor .CodeMirror-scroll {
    min-height: 150px;
}

/* Editor action buttons bar */
.editor-actions {
    display: flex;
    gap: 8px;
    padding: 12px 15px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.editor-actions button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
    color: #333;
}

.editor-actions button:hover {
    background: #f0f0f0;
}

.editor-actions .btn-run {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.editor-actions .btn-run:hover {
    background: #1565c0;
}

.editor-actions .btn-run .play-icon {
    font-size: 10px;
}

.editor-actions .btn-test {
    background: #fff;
    color: #666;
    border-color: #ddd;
}

.editor-actions .btn-test:hover {
    background: #f5f5f5;
    color: #333;
}

.editor-actions .btn-reset {
    background: #fff;
    color: #666;
}

.editor-actions .btn-model {
    background: #fff;
    color: #666;
    margin-left: auto;
}

/* Output area */
.editor-output {
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    min-height: 60px;
}

.editor-output .output-label {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.editor-output pre {
    color: #333;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    margin: 0;
    white-space: pre-wrap;
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.editor-output.success pre {
    color: #2e7d32;
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.editor-output.error pre {
    color: #c62828;
    background: #ffebee;
    border-color: #ffcdd2;
}

/* Loading state */
.output-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 13px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Legacy code-editor class support */
.code-editor {
    background: #272822;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}

.code-editor .editor-header {
    background: #1e1e1e;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-editor .editor-header .title {
    color: #888;
    font-size: 12px;
}

.code-editor .editor-header .actions {
    display: flex;
    gap: 8px;
}

.code-editor .editor-header .actions button {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.code-editor .editor-textarea {
    width: 100%;
    min-height: 150px;
    background: #272822;
    color: #f8f8f2;
    border: none;
    padding: 15px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.code-editor .editor-textarea:focus {
    outline: none;
}

.code-editor .editor-output {
    background: #1e1e1e;
    padding: 12px 15px;
}

.code-editor .editor-output .label {
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.code-editor .editor-output pre {
    color: #a6e22e;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    margin: 0;
    white-space: pre-wrap;
}

/* =====================================================
   EXERCISE BOX - ORANGE STYLE FOR WEB DEV
   ===================================================== */
.exercise-box {
    background: #fff;
    border-radius: 8px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 10px 30px rgba(194, 84, 80, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.exercise-box .exercise-header {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-box .exercise-header .exercise-icon {
    font-size: 24px;
    margin-right: 12px;
}

.exercise-box .exercise-header .exercise-title {
    flex: 1;
}

.exercise-box .exercise-header .exercise-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.exercise-box .exercise-header h4 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.exercise-box .exercise-header .points {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.exercise-box .exercise-content {
    padding: 20px;
}

.exercise-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0,0,0,0.18), 0 16px 36px rgba(194, 84, 80, 0.16);
}
.exercise-box .exercise-content p {
    color: #333;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
}

/* =====================================================
   WEB EDITOR COMPONENT (HTML/CSS/JS Tabs)
   ===================================================== */
.web-editor {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
}

.editor-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.editor-tab {
    padding: 12px 24px;
    cursor: pointer;
    background: #f5f5f5;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    flex: 1;
    text-align: center;
}

.editor-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.editor-tab.active {
    background: white;
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
}

.editor-panels {
    position: relative;
    min-height: 300px;
}

.editor-panel {
    display: none;
    height: 400px;
}

.editor-panel.active {
    display: block;
}

.editor-panel .CodeMirror {
    height: 400px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
}

.preview-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
}

.preview-iframe {
    width: 100%;
    height: 400px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: white;
}

.console-output {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Courier New', monospace;
    padding: 10px;
    height: 400px;
    overflow-y: auto;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.console-output > div {
    padding: 2px 0;
    border-bottom: 1px solid #2d2d2d;
}

/* =====================================================
   MOTION & EFFECTS
   ===================================================== */
@keyframes riseIn {
    0% { opacity: 0; transform: translateY(12px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* =====================================================
   INFO BOXES
   ===================================================== */
.info-box {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 0 4px 4px 0;
    padding: 15px 20px;
    margin: 20px 0;
}

.info-box.tip {
    background: #e8f5e9;
    border-color: #4caf50;
}

.info-box.warning {
    background: #ffebee;
    border-color: #f44336;
}

.info-box h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f57c00;
}

.info-box.tip h5 {
    color: #2e7d32;
}

.info-box.warning h5 {
    color: #c62828;
}

.info-box p {
    font-size: 14px;
    margin: 0;
}

/* =====================================================
   LEARNING OBJECTIVES
   ===================================================== */
.learning-objectives {
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px 25px;
    margin-bottom: 25px;
}

.learning-objectives h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.learning-objectives ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.learning-objectives li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
    font-size: 14px;
    color: #555;
}

.learning-objectives li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.section-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.section-nav button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
    color: #333;
    transition: all 0.2s;
}

.section-nav button:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.section-nav .next-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.section-nav .next-btn:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* =====================================================
   SAMPLE OUTPUT BOX
   ===================================================== */
.sample-output {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.sample-output .output-header {
    background: #e8e8e8;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    border-bottom: 1px solid #e0e0e0;
}

.sample-output pre {
    margin: 0;
    padding: 12px 15px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: #333;
    background: #f9f9f9;
    white-space: pre-wrap;
}

.sample-output.error pre {
    color: #c62828;
    background: #ffebee;
}

.sample-output.error {
    border-color: #ffcdd2;
}

.sample-output.error .output-header {
    background: #ffcdd2;
    color: #c62828;
}

/* Code output (legacy) */
.code-output {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 15px 0;
}

.code-output pre {
    margin: 0;
    padding: 12px 15px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: #333;
}

/* =====================================================
   EXERCISE BOX ENHANCEMENTS
   ===================================================== */
.exercise-box .exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.exercise-box .exercise-header h4 {
    margin-bottom: 0;
}

.exercise-box .points {
    background: #1565c0;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* =====================================================
   NEXT SECTION NAVIGATION
   ===================================================== */
.next-section {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px 25px;
    margin-top: 40px;
    text-align: center;
}

.next-section p {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.next-section a {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.2s;
}

.next-section a:hover {
    background: var(--accent-dark);
}

/* =====================================================
   SECTION CONTENT TYPOGRAPHY
   ===================================================== */
.section-content,
.content-section {
    padding: 0;
}

/* Headings */
.content-wrapper h1 {
    font-family: 'Roboto Slab', serif;
    font-size: 42px;
    font-weight: 700;
    color: #333;
    margin: 0 0 22px 0;
}

.content-wrapper h2,
.section-content h2,
.content-section h2 {
    font-family: 'Roboto Slab', serif;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0 0 22px 0;
}

.content-wrapper h3,
.section-content h3,
.content-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 34px 0 14px 0;
}

.content-wrapper h4,
.section-content h4,
.content-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 22px 0 10px 0;
}

/* Text + lists */
.content-wrapper p,
.section-content p,
.content-section p {
    color: #333;
    line-height: 1.7;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.content-wrapper ul,
.content-wrapper ol,
.section-content ul,
.section-content ol,
.content-section ul,
.content-section ol {
    margin: 15px 0 15px 25px;
    color: #333;
}

.content-wrapper li,
.section-content li,
.content-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Inline code (avoid styling code inside pre blocks) */
.content-wrapper :not(pre) > code,
.section-content :not(pre) > code,
.content-section :not(pre) > code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--accent);
}

/* Links */
.content-wrapper a,
.section-content a,
.content-section a {
    color: var(--accent);
    text-decoration: none;
}

.content-wrapper a:hover,
.section-content a:hover,
.content-section a:hover {
    text-decoration: underline;
}

/* Content blocks (Parts 2-3) */
.content-block {
    background: #fafafa;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    padding: 18px 22px;
    margin: 18px 0;
}

.content-block pre,
.code-example pre,
pre.code-example {
    background: #282c34;
    color: #abb2bf;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 14px 0;
}

.content-block pre code,
.code-example pre code,
pre.code-example code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Part intro text */
.part-intro {
    font-size: 17px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 25px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
    .content-wrapper {
        padding: 30px 40px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px;
    }

    .part-title,
    .content-card h2 {
        font-size: 28px;
    }

    .section-nav {
        flex-direction: column;
        gap: 10px;
    }

    .section-nav button {
        width: 100%;
        justify-content: center;
    }

    .preview-split {
        grid-template-columns: 1fr;
    }

    .editor-tabs {
        overflow-x: auto;
    }
}
