/* ==========================================================================
   MICROSERVICES ARCHITECTURE MASTERY PLATFORM - DARK THEME DESIGN SYSTEM
   Author: Antigravity Team
   Language: Bahasa Indonesia
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #080c14;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-sidebar: #0d131f;
    --bg-input: #1b2436;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --border-color: #1f2937;
    --border-highlight: #374151;

    --glass-bg: rgba(17, 24, 39, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Header */
.app-header {
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.brand-icon svg {
    width: 24px;
    height: 24px;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-center {
    flex: 1;
    max-width: 460px;
    margin: 0 20px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.progress-bar-bg {
    width: 140px;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.app-sidebar {
    width: 350px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }

.category-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.category-pill {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill:hover, .category-pill.active {
    background: rgba(99, 102, 241, 0.18);
    color: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

.sidebar-exam-btn {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s ease;
}

.sidebar-exam-btn:hover {
    transform: translateY(-2px);
}

.chapter-item {
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chapter-item:hover {
    border-color: var(--accent-indigo);
    background: var(--bg-card-hover);
}

.chapter-item.active {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: inset 3px 0 0 var(--accent-indigo);
}

.chapter-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chapter-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.chapter-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
}

.chapter-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-glow);
}

.chapter-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.video-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chapter-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.chapter-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.chapter-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-indigo);
    border-bottom-color: var(--accent-indigo);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Article / Theory Content */
.article-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
}

.article-content h3 {
    font-size: 1.25rem;
    color: var(--accent-indigo);
    margin: 20px 0 10px 0;
    border-left: 4px solid var(--accent-indigo);
    padding-left: 10px;
}

.article-content h4 {
    font-size: 1.05rem;
    color: #fff;
    margin: 16px 0 8px 0;
}

.article-content p {
    margin-bottom: 14px;
    color: var(--text-secondary);
}

.article-content ul, .article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 6px;
}

.callout {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.9rem;
    border-left: 4px solid;
}

.callout-info {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--accent-indigo);
    color: var(--text-primary);
}

.callout-tip {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--accent-green);
    color: var(--text-primary);
}

.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--accent-amber);
    color: var(--text-primary);
}

.code-container {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 16px 0;
    overflow: hidden;
}

.code-header {
    background: #111827;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.copy-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}

.copy-btn:hover {
    color: #fff;
    border-color: var(--accent-indigo);
}

.code-container pre {
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e2e8f0;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Video Player */
.video-player-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    border: 1px solid var(--border-color);
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-meta-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}

/* Playground Terminal */
.playground-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.playground-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.playground-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--accent-indigo);
}

.snippet-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.terminal-window {
    background: #050811;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-mono);
    overflow: hidden;
}

.terminal-body {
    padding: 16px;
    min-height: 240px;
    max-height: 380px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.term-line {
    margin-bottom: 6px;
    word-break: break-all;
}

.term-info { color: var(--accent-cyan); }
.term-success { color: var(--accent-green); }
.term-warning { color: var(--accent-amber); }
.term-error { color: var(--accent-red); }
.term-cmd { color: #fff; font-weight: 700; }

.terminal-input-row {
    display: flex;
    align-items: center;
    background: #0b0f19;
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
}

.terminal-prompt {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-right: 8px;
}

.terminal-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.terminal-input:focus {
    outline: none;
}

/* Quiz Container */
.quiz-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.quiz-card {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.quiz-question {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-option-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option-btn:hover {
    border-color: var(--accent-indigo);
    background: var(--bg-card-hover);
}

.quiz-option-btn.selected-correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-green);
    color: #fff;
}

.quiz-option-btn.selected-wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: #fff;
}

.quiz-explanation {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent-indigo);
}

/* Notes Textarea */
.notes-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.notes-textarea {
    width: 100%;
    min-height: 250px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.9rem;
    resize: vertical;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent-indigo);
}

/* Footer Nav */
.footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--accent-indigo);
    border-radius: 16px;
    max-width: 750px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}
