:root {
    --bg-color: #1e1e2e;
    --panel-bg: #282a36;
    --text-color: #f8f8f2;
    --accent: #50fa7b;
    --accent-hover: #40c563;
    --error: #ff5555;
    --border: #44475a;
    --lesson-bg: #44475a;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.header-left h1 { color: var(--accent); margin: 0; font-size: 24px; }
.header-left p { margin: 5px 0 0 0; font-size: 12px; color: #8be9fd; }
#progress-container { width: 250px; text-align: center; }
#progress-text { font-size: 12px; color: var(--accent); font-weight: bold; display: block; margin-bottom: 5px; }
#progress-bar-bg { background-color: var(--border); border-radius: 10px; height: 8px; width: 100%; overflow: hidden; }
#progress-bar-fill { background-color: var(--accent); height: 100%; width: 0%; transition: width 0.4s ease; }
#reset-btn { background-color: var(--error); margin-top: 0; }

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 15px;
    gap: 15px;
}
.panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
}
.sidebar-panel {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}
.sidebar-panel.collapsed {
    width: 50px;
    padding: 15px 0;
    align-items: center;
}
.sidebar-panel.collapsed .sidebar-tabs, 
.sidebar-panel.collapsed .db-subtitle, 
.sidebar-panel.collapsed .sidebar-content {
    display: none !important;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.sidebar-panel.collapsed .sidebar-header {
    justify-content: center;
}
#toggle-sidebar-btn { 
    background: none; 
    border: none; 
    color: var(--text-color); 
    font-size: 16px; 
    cursor: pointer; 
    padding: 5px; 
    margin: 0; 
    border-radius: 4px;
}
.sidebar-panel.collapsed #toggle-sidebar-btn {
    font-size: 20px;
    color: var(--accent);
}
#toggle-sidebar-btn:hover {
    background-color: var(--selection);
}

.workspace-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#level-title { margin: 0 0 15px 0; }

.tab-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.tab-btn {
    background-color: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--border);
    padding: 8px 30px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
    font-weight: bold;
}
.tab-btn.active {
    background-color: var(--border);
    color: #fff;
    border-color: #8be9fd;
}
.tab-btn:hover:not(.active) { background-color: #343746; }

.content-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}
.tab-content { display: none; }
.tab-content.active { display: block; }

.lesson-box { background-color: var(--lesson-bg); padding: 15px; border-radius: 6px; border-left: 4px solid #8be9fd; }
.mission-box { background-color: #191a21; padding: 15px; border-radius: 6px; margin-bottom: 15px; border-left: 4px solid var(--accent); }
.mission-box h3, .lesson-box h3 { margin-top: 0; }

textarea {
    width: 100%; height: 120px; background-color: #191a21; color: var(--accent);
    border: 1px solid var(--border); padding: 10px; font-family: 'Courier New', Courier, monospace;
    font-size: 16px; resize: vertical; box-sizing: border-box; border-radius: 4px;
}
button { background-color: var(--accent); color: #000; border: none; padding: 10px 20px; font-size: 14px; font-weight: bold; cursor: pointer; border-radius: 4px; }
button:hover { background-color: var(--accent-hover); }
.button-group { display: flex; gap: 10px; margin-top: 10px; }
.btn-secondary { background-color: var(--border); color: var(--text-color); }
.btn-secondary:hover { background-color: #575b70; }
#feedback { margin-top: 15px; font-weight: bold; font-size: 16px; min-height: 24px; }
.correct { color: var(--accent); }
.incorrect { color: var(--error); }

#resizer {
    height: 16px;
    background-color: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: ns-resize;
    margin: 10px 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
#resizer::before {
    content: '•••';
    color: #6272a4; /* Comment color in dracula for dots */
    font-size: 14px;
    letter-spacing: 2px;
    line-height: 1;
}
#resizer:hover, #resizer.active { 
    background-color: #343746;
    border-color: #6272a4;
}
#resizer:hover::before, #resizer.active::before {
    color: var(--text-color);
}
#results-container { 
    height: 200px; 
    overflow: auto; 
    background-color: var(--panel-bg); 
    border: 1px solid var(--border); 
    border-radius: 6px; 
    flex-shrink: 0; 
}

table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 8px; text-align: left; }
th { 
    background-color: var(--border); 
    color: #fff; 
    position: sticky; 
    top: -1px; 
    z-index: 1; 
    outline: 1px solid var(--border);
}

.db-subtitle { font-size: 12px; color: #bd93f9; margin-top: 0; }
.db-table-item { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.db-table-item:hover { background-color: var(--border); }
.db-table-name { color: #8be9fd; font-weight: bold; font-size: 14px; }
.db-table-records { font-size: 12px; color: #f1fa8c; }

.w3-syntax { background-color: #191a21; padding: 15px; border-radius: 5px; border-left: 4px solid var(--accent); font-family: 'Courier New', Courier, monospace; font-size: 14px; margin-top: 10px; line-height: 1.5; overflow-x: auto; }
.w3-syntax .keyword { color: #ff79c6; font-weight: bold; }
.w3-syntax .identifier { color: #f8f8f2; }
.w3-syntax .string { color: #f1fa8c; }
/* Modal Styles */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.7); 
}
.modal-content {
    background-color: var(--panel-bg);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 80%; 
    max-width: 400px;
    text-align: center;
}
.close-btn {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover { color: var(--error); }
#streak-btn { background-color: #ffb86c; margin-right: 10px; color: #000; }
#streak-btn:hover { background-color: #ffc991; }

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 15px;
}
.calendar-day {
    padding: 10px 0;
    border-radius: 4px;
    background-color: #343746;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}
.calendar-day.success { background-color: var(--accent); color: #000; }
.calendar-day.today { border: 2px solid #8be9fd; box-sizing: border-box; }
.calendar-header { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 5px;
    margin-bottom: 5px; 
    font-size: 12px; 
    color: #8be9fd; 
    text-align: center; 
}

/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}
.sidebar-tabs button {
    background-color: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}
.sidebar-tabs button.active {
    background-color: var(--accent);
    color: #000;
}
.sidebar-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}
.sidebar-content.active {
    display: block;
}

/* Syllabus List */
#syllabus-list {
    display: flex;
    flex-direction: column;
}
.syllabus-item {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    color: #ccc;
    display: flex;
    justify-content: space-between;
}
.syllabus-item:hover {
    background-color: var(--selection);
}
.syllabus-item.completed {
    color: var(--accent);
}
.syllabus-item.active {
    background-color: var(--selection);
    border-left: 3px solid var(--accent);
    color: #fff;
    font-weight: bold;
}
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbars - Dracula Theme */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--panel-bg); 
}
::-webkit-scrollbar-thumb {
    background: #6272a4; 
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8be9fd; 
}
