/* CSS Variables for Dark Glassmorphism Theme */
:root {
    /* Colors from AGENTS.md */
    --bg-primary: #0a0f1e;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    
    --brand-primary: #00d4ff;
    --brand-primary-dark: #0099cc;
    --brand-accent: #ff8c00;
    --brand-accent-dark: #e07b00;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(0, 212, 255, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glass Panel Effect */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* App Shell Layout */
.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 100;
}

.sidebar-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--glass-highlight);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(90deg, var(--glass-highlight), transparent);
    color: var(--brand-primary);
    border-left: 3px solid var(--brand-primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.nav-badge {
    margin-left: auto;
    background: var(--brand-primary);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Main Content */
.main-content {
    grid-column: 2;
    min-height: 100vh;
}

.content-header {
    position: sticky;
    top: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb span::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.breadcrumb span:last-child::after {
    content: '';
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.content-body {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Course Section */
.course-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.75rem; margin: 2rem 0 1rem; }
h3 { font-size: 1.25rem; margin: 1.5rem 0 0.75rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 212, 255, 0.4);
}

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

.btn-secondary:hover {
    background: var(--glass-highlight);
    border-color: var(--brand-primary);
}

/* Cards */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.card:first-child {
    margin-top: 0;
}

blockquote {
    border-left: 4px solid var(--brand-primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Quiz Styles */
.quiz-container {
    margin: 2rem 0;
}

.question {
    margin-bottom: 1.5rem;
}

.question h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.option:hover {
    background: var(--glass-highlight);
    border-color: var(--brand-primary);
}

.option.selected {
    background: var(--glass-highlight);
    border-color: var(--brand-primary);
}

.option.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.option input {
    display: none;
}

.option-label {
    flex: 1;
}

/* Visualizer Containers */
.visualizer-container {
    margin: 2rem 0 3rem 0;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    min-height: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    clear: both;
}

.visualizer-container h3 {
    margin-bottom: 1.5rem;
}

.visualizer-container svg {
    display: block;
    clear: both;
}

.visualizer-container + .card,
.visualizer-container + .comparison-grid,
.visualizer-container + div[style*="display: grid"] {
    margin-top: 2rem;
}

/* LeaderLine specific styles */
.leader-line {
    z-index: 1000;
}

/* Star Schema Visualizer */
.star-schema {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.schema-table {
    position: absolute;
    background: var(--bg-tertiary);
    border: 2px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.15s ease;
}

.schema-table:hover {
    box-shadow: var(--shadow-lg);
}

.schema-table.fact {
    border-color: var(--brand-accent);
}

.schema-table.dimension {
    border-color: var(--brand-primary);
}

/* OLAP Cube */
.cube-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    perspective: 600px;
    margin: 2rem 0;
}

.cube {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(30deg);
    transition: transform 0.5s ease;
}

.cube:hover {
    transform: rotateX(-15deg) rotateY(45deg);
}

.cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--glass-bg);
    border: 2px solid var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.cube-face.front { transform: translateZ(50px); }
.cube-face.back { transform: rotateY(180deg) translateZ(50px); }
.cube-face.right { transform: rotateY(90deg) translateZ(50px); }
.cube-face.left { transform: rotateY(-90deg) translateZ(50px); }
.cube-face.top { transform: rotateX(90deg) translateZ(50px); }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(50px); }

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }
    
    .main-content {
        grid-column: 1;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* LeaderLine customization */
.leader-line {
    z-index: 1000;
}