/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.15);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #2a2a3a;
    --code-bg: #0d0d14;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
}

/* ===== Install Banner ===== */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--accent);
    color: #000;
    padding: 12px 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.install-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.install-btn {
    background: #000;
    color: var(--accent);
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.dismiss-btn {
    background: transparent;
    border: none;
    color: #000;
    font-size: 20px;
    cursor: pointer;
}

/* ===== Container Layout ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    padding: 20px;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.sidebar h2 {
    color: var(--accent);
    font-size: 20px;
    margin-bottom: 15px;
}

.progress-info {
    margin-top: 15px;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    width: 0%;
    transition: width 0.3s ease;
}

.completed-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Phase & Chapter Navigation ===== */
.phase {
    margin-bottom: 25px;
}

.phase-title {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    background: var(--accent-dim);
    border-radius: 4px;
}

.chapter-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 4px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.chapter-link:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.chapter-link.completed {
    color: var(--success);
}

.chapter-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.chapter-link.completed .chapter-num {
    background: var(--success);
    color: #000;
}

.chapter-title {
    flex: 1;
}

.check-mark {
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chapter-link.completed .check-mark::after {
    content: "✓";
    opacity: 1;
    color: var(--success);
}

/* ===== Main Content ===== */
.main-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 40px;
    border: 1px solid var(--border);
    min-height: calc(100vh - 40px);
}

/* ===== Welcome Screen ===== */
.welcome-screen h1 {
    color: var(--accent);
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
}

/* ===== Info Box ===== */
.info-box {
    background: var(--accent-dim);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin: 25px 0;
    border-radius: 6px;
}

.info-box strong {
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-box ul {
    margin-top: 10px;
    padding-left: 20px;
}

.info-box li {
    margin: 8px 0;
    color: var(--text-secondary);
}

/* ===== Quick Start ===== */
.quick-start {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid var(--border);
}

.quick-start h3 {
    color: var(--accent);
    margin-bottom: 20px;
}

.start-options {
    display: grid;
    gap: 15px;
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.start-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.start-btn.primary {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.btn-icon {
    font-size: 32px;
}

.btn-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.btn-text strong {
    font-size: 16px;
}

.btn-text small {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== Study Tips ===== */
.study-tips {
    margin: 40px 0;
}

.study-tips h3 {
    color: var(--accent);
    margin-bottom: 20px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tip-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.tip-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.tip-card h4 {
    color: var(--accent);
    margin-bottom: 10px;
}

.tip-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Timeline ===== */
.timeline {
    margin: 40px 0;
}

.timeline h3 {
    color: var(--accent);
    margin-bottom: 25px;
}

.timeline-content {
    position: relative;
    padding-left: 40px;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.timeline-text strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.timeline-text p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Footer Note ===== */
.footer-note {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 25px;
    margin-top: 40px;
    border: 1px solid var(--border);
}

.footer-note p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== Chapter Content Styles ===== */
.chapter-header {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.chapter-number {
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.chapter-content h2 {
    color: var(--accent);
    font-size: 28px;
    margin-top: 50px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.chapter-content h3 {
    color: var(--text-primary);
    font-size: 22px;
    margin-top: 35px;
    margin-bottom: 15px;
}

.chapter-content h4 {
    color: var(--text-secondary);
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 12px;
}

.chapter-content p {
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* ===== Code Blocks ===== */
.chapter-content code {
    background: var(--code-bg);
    color: #a78bfa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

.chapter-content pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.5;
}

.chapter-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

/* ===== Objectives Box ===== */
.objectives {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 25px;
    margin: 25px 0;
}

.objectives h4 {
    color: var(--success);
    margin-top: 0;
    margin-bottom: 15px;
}

.objectives ul {
    list-style: none;
    padding-left: 0;
}

.objectives li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
    color: var(--text-secondary);
}

.objectives li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
    font-size: 18px;
}

/* ===== Exercise Box ===== */
.exercise {
    background: var(--bg-tertiary);
    border: 2px solid var(--success);
    border-radius: 6px;
    padding: 25px;
    margin: 25px 0;
}

.exercise h4 {
    color: var(--success);
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.exercise h4:before {
    content: "🧪";
    font-size: 24px;
}

/* ===== MixMind Connection ===== */
.mixmind-connection {
    background: var(--accent-dim);
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 25px;
    margin: 25px 0;
}

.mixmind-connection h4 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.mixmind-connection h4:before {
    content: "🎵";
    font-size: 24px;
}

/* ===== Quick Reference ===== */
.quick-ref {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--warning);
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.quick-ref strong {
    color: var(--warning);
    display: block;
    margin-bottom: 10px;
}

/* ===== Tables ===== */
.chapter-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.chapter-content th {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.chapter-content td {
    padding: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.chapter-content tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* ===== Lists ===== */
.chapter-content ul, 
.chapter-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.chapter-content li {
    margin: 8px 0;
    color: var(--text-secondary);
}

/* ===== Complete Button ===== */
.complete-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
    text-align: center;
}

.complete-btn {
    background: var(--success);
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.complete-btn:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.complete-btn.completed {
    background: var(--bg-tertiary);
    color: var(--success);
    cursor: default;
}

/* ===== Navigation ===== */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        height: auto;
        max-height: 500px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .welcome-screen h1 {
        font-size: 28px;
    }
}
