/* GO TRAINER v3 */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0; }

body {
    font-family: 'JetBrains Mono', monospace;
    background: #FAF8F5; color: #2D2D2D;
    line-height: 1.6; overflow: hidden; font-size: 13px;
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* ===== HEADER (sections) ===== */
.header {
    background: #2D2D2D; color: #FAF8F5;
    padding: 0 16px; height: 44px;
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
}
.logo { font-size: 15px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

.section-nav {
    flex: 1; display: flex; gap: 2px; overflow-x: auto;
    scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }

.section-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: transparent; border: none; border-bottom: 3px solid transparent;
    color: #999; font-family: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.section-btn:hover { color: #FFF; }
.section-btn.active { color: #FFF; border-bottom-color: #00ADD8; }
.section-btn .sec-icon { font-size: 15px; }

.difficulty-toggle { display: flex; flex-shrink: 0; }
.diff-btn {
    font-family: inherit; font-size: 11px; font-weight: 600;
    padding: 3px 12px; border: 1px solid #555;
    background: transparent; color: #888; cursor: pointer; transition: all 0.15s;
}
.diff-btn:first-child { border-right: none; }
.diff-btn.active { background: #00ADD8; color: #fff; border-color: #00ADD8; }
.diff-btn:hover:not(.active) { background: #444; color: #FFF; }

/* ===== LESSON BAR ===== */
.lesson-bar {
    display: flex; gap: 0;
    background: #F3F0EC; border-bottom: 2px solid #E0DCD7;
    overflow-x: auto; flex-shrink: 0;
    scrollbar-width: thin;
}
.lesson-bar::-webkit-scrollbar { height: 4px; }
.lesson-bar::-webkit-scrollbar-thumb { background: #CCC; }

.lesson-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: transparent; border: none;
    border-bottom: 3px solid transparent;
    font-family: inherit; font-size: 12px;
    color: #777; cursor: pointer; white-space: nowrap;
    transition: all 0.15s;
}
.lesson-chip:hover { background: #EDEAE6; color: #2D2D2D; }
.lesson-chip.active { color: #2D2D2D; border-bottom-color: #00ADD8; background: #E8F4FD; }

.chip-dot { width: 7px; height: 7px; flex-shrink: 0; }
.chip-dot.junior { background: #7CB342; }
.chip-dot.middle { background: #FFA726; }
.chip-dot.senior { background: #EF5350; }

.chip-type {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    padding: 1px 5px; letter-spacing: 0.5px;
}
.chip-type.theory { background: #E0DCD7; color: #666; }
.chip-type.practice { background: #00ADD8; color: #FFF; }

/* ===== MAIN ===== */
.main { display: flex; flex: 1; overflow: hidden; }

/* LEFT PANEL */
.left-panel {
    flex: 1; display: flex; flex-direction: column;
    border-right: 2px solid #E0DCD7; overflow: hidden;
}
.theory-content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.loading { color: #999; font-style: italic; text-align: center; padding-top: 40px; }

/* Typography */
.theory-content h1 { font-size: 24px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 3px solid #2D2D2D; }
.theory-content h2 { font-size: 18px; font-weight: 700; margin: 22px 0 10px; padding-left: 12px; border-left: 4px solid #00ADD8; }
.theory-content h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; color: #444; }
.theory-content h4 { font-size: 14px; font-weight: 600; margin: 12px 0 4px; color: #555; }
.theory-content p { margin-bottom: 10px; }
.theory-content ul, .theory-content ol { margin: 6px 0 12px 22px; }
.theory-content li { margin-bottom: 3px; }

.theory-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; border: 2px solid #2D2D2D; }
.theory-content th { background: #2D2D2D; color: #FAF8F5; padding: 6px 10px; text-align: left; font-weight: 600; }
.theory-content td { padding: 5px 10px; border: 1px solid #E0DCD7; }
.theory-content tr:nth-child(even) td { background: #F3F0EC; }

.theory-content strong { font-weight: 700; color: #1A1A1A; }
.theory-content em { font-style: italic; }
.theory-content a { color: #00ADD8; text-decoration: none; }
.theory-content a:hover { text-decoration: underline; }
.theory-content code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: #EDEAE6; padding: 1px 5px; border: 1px solid #DDD; color: #C7254E; }
.theory-content pre { margin: 12px 0; background: #2D2D2D; border: 2px solid #2D2D2D; overflow-x: auto; }
.theory-content pre code { display: block; padding: 12px; background: #2D2D2D; color: #E8E8E8; border: none; font-size: 13px; line-height: 1.5; }

/* RIGHT PANEL */
.right-panel { flex: 1; display: flex; flex-direction: column; background: #1E1E1E; }

.editor-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 5px 12px; background: #2D2D2D; border-bottom: 2px solid #444;
}
.file-tab { display: flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 12px; color: #CCC; background: #3A3A3A; border: 1px solid #555; }
.tab-icon { font-size: 12px; }
.tab-name { color: #E8E8E8; }

.test-btn {
    font-family: inherit; font-size: 12px; font-weight: 700;
    padding: 4px 14px; background: #00ADD8; color: #fff;
    border: 2px solid #00ADD8; cursor: pointer; transition: all 0.15s;
}
.test-btn:hover { background: #0097B9; border-color: #0097B9; }

.run-btn {
    font-family: inherit; font-size: 12px; font-weight: 700;
    padding: 4px 14px; background: #7CB342; color: #fff;
    border: 2px solid #7CB342; cursor: pointer; transition: all 0.15s;
}
.run-btn:hover { background: #689F38; border-color: #689F38; }

/* Test results */
.test-results { padding: 4px 0; }
.test-summary-pass { color: #B5E878; font-weight: 700; margin-bottom: 6px; }
.test-summary-fail { color: #EF5350; font-weight: 700; margin-bottom: 6px; }
.test-summary-timeout { color: #FFA726; font-weight: 700; }
.test-item { font-size: 12px; padding: 2px 0; color: #CCC; }
.test-item.pass { color: #B5E878; }
.test-item.fail { color: #EF5350; }
.test-error { color: #FF8A80; font-size: 11px; margin-left: 20px; }

.editor-container { flex: 1; overflow: hidden; }
#editor { width: 100%; height: 100%; }

/* Output */
.output-panel { border-top: 2px solid #444; background: #1A1A1A; max-height: 180px; overflow-y: auto; }
.output-header { padding: 3px 12px; font-size: 11px; font-weight: 600; color: #666; background: #222; border-bottom: 1px solid #333; }
.output-content { padding: 8px 12px; color: #CCC; font-size: 13px; }
.output-placeholder { color: #555; font-style: italic; }
.output-running { color: #FFA726; }
.output-success { color: #B5E878; margin: 0; white-space: pre-wrap; word-break: break-word; }
.output-error { color: #EF5350; margin: 0; white-space: pre-wrap; word-break: break-word; }

/* Hints */
.hints-panel { border-top: 2px solid #444; background: #252525; padding: 5px 12px; color: #CCC; }
.hints-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-size: 12px; font-weight: 600; }
.hints-toggle { background: none; border: none; color: #888; cursor: pointer; font-size: 12px; }
.hints-content { display: none; padding-top: 5px; font-size: 12px; }
.hints-content ul { margin-left: 16px; }
.hints-content li { margin-bottom: 2px; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .main { flex-direction: column; }
    .left-panel { border-right: none; border-bottom: 2px solid #E0DCD7; max-height: 45vh; }
    .right-panel { max-height: 55vh; }
    .theory-content { padding: 14px; }
}

@media (max-width: 600px) {
    .logo { font-size: 13px; }
    .section-btn { padding: 4px 8px; font-size: 11px; }
    .lesson-chip { padding: 5px 8px; font-size: 11px; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CCC; }
.right-panel ::-webkit-scrollbar-thumb { background: #555; }
