/* ==========================================================================
   DWH ACADEMY - BRICS 2026 CLEAN THEME
   Warm Ivory/Sand Canvas, Lexend Deca + Inter Typography, Sovereign Accents
   ========================================================================== */

:root {
    /* BRICS 2026 Palette */
    --primary: #1A429B;
    --primary-hover: #13337A;
    --primary-light: #EEF3FA;
    --primary-glow: rgba(26, 66, 155, 0.15);

    --accent: #F58220;
    --accent-hover: #E06F12;
    --accent-light: #FFF9F3;

    --emerald: #00974A;
    --emerald-light: #EBF8F1;

    --crimson: #E31E24;
    --crimson-light: #FDEDED;
    --gold: #F9C62C;

    /* Warm Ivory & Crisp White Theme */
    --bg-primary: #FFF9F3;         /* Warm Ivory/Sand Canvas */
    --bg-secondary: #FFFFFF;       /* Crisp White Cards */
    --bg-tertiary: #FAF8F5;        /* Subtle warm container */
    --bg-sidebar: #FFFFFF;

    --brand-primary: #1A429B;
    --brand-primary-dark: #13337A;
    --brand-accent: #F58220;
    
    --text-primary: #101828;       /* Deep slate heading text */
    --text-secondary: #334155;     /* Readable slate body */
    --text-muted: #64748B;
    
    --glass-bg: #FFFFFF;
    --glass-border: rgba(226, 232, 240, 0.9);
    --glass-highlight: rgba(26, 66, 155, 0.08);
    
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, 0.08);
    --shadow-xl: 0 20px 40px -8px rgba(16, 24, 40, 0.12);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
    
    --font-heading: 'Lexend Deca', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* 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);
    background-size: 44px 44px;
    background-image: radial-gradient(circle, rgba(26, 66, 155, 0.08) 1.2px, transparent 1.2px);
    color: var(--text-secondary);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .logo-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    letter-spacing: -0.025em;
    font-weight: 700;
}

/* Multi-color sovereign accent ribbon */
.accent-ribbon {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, 
        #1A429B 0%, 
        #1A429B 20%, 
        #00974A 20%, 
        #00974A 40%, 
        #F58220 40%, 
        #F58220 60%, 
        #F9C62C 60%, 
        #F9C62C 80%, 
        #E31E24 80%, 
        #E31E24 100%
    );
}

/* 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: 290px 1fr;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.logo-mark {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #2563EB 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(26, 66, 155, 0.2);
}

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

.logo-title {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 0.68rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

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

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

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

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

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

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

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(3px);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-left: 3px solid var(--primary);
}

.nav-icon {
    width: 16px;
    height: 16px;
    color: #64748B;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: var(--primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #FFFFFF;
    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);
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: #E2E8F0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--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: 1.15rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

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

.breadcrumb span::after {
    content: '/';
    margin-left: 0.5rem;
    color: #CBD5E1;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions .nav-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.4rem 0.75rem;
}

.header-actions .nav-link:hover {
    color: var(--primary);
    background: transparent;
    transform: none;
}

.content-body {
    padding: 2.5rem;
    max-width: 960px;
    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: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
    color: var(--text-primary);
}

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

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

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

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 14px rgba(26, 66, 155, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(26, 66, 155, 0.35);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-primary);
    border: 1px solid #E2E8F0;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

/* Cards */
.card {
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.75rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(26, 66, 155, 0.3);
}

blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: normal;
    color: var(--primary-hover);
    font-weight: 500;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #F1F5F9;
}

/* 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.9rem 1.15rem;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.5rem;
}

.option:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.option.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.option.correct {
    background: var(--emerald-light);
    border-color: var(--emerald);
    color: var(--emerald);
    font-weight: 600;
}

.option.incorrect {
    background: #FDEDED;
    border-color: var(--crimson);
    color: var(--crimson);
    font-weight: 600;
}

.option input {
    display: none;
}

.option-label {
    flex: 1;
}

/* Visualizer Containers */
.visualizer-container {
    margin: 2rem 0 3rem 0;
    padding: 2.25rem 2rem;
    background: #FAF8F5;
    border-radius: var(--radius-xl);
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 20px -4px rgba(16, 24, 40, 0.05);
    min-height: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    clear: both;
}

.visualizer-container h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.visualizer-container svg text {
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}

.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: #FFFFFF;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-md);
    transition: all 0.15s ease;
}

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

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

.schema-table.dimension {
    border-color: var(--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: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--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: 1.25rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* Architecture Tables */
.arch-table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

.arch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    background: #FFFFFF;
}

.arch-table th {
    background: #EEF3FA;
    color: var(--primary);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.02em;
}

.arch-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #F1F5F9;
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.6;
}

.arch-table tr:last-child td {
    border-bottom: none;
}

.arch-table tr:hover td {
    background: #FAF8F5;
}

/* Callout Boxes */
.callout-box {
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
    background: #FAF8F5;
    font-size: 0.95rem;
}

.callout-box.tip {
    border-left-color: var(--emerald);
    background: var(--emerald-light);
}

.callout-box.warning {
    border-left-color: var(--accent);
    background: var(--accent-light);
}

.callout-box.danger {
    border-left-color: var(--crimson);
    background: var(--crimson-light);
}

.callout-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout-box.tip .callout-title { color: var(--emerald); }
.callout-box.warning .callout-title { color: var(--accent); }
.callout-box.danger .callout-title { color: var(--crimson); }
.callout-box .callout-title { color: var(--primary); }

/* Code Snippets & Terminal */
pre.code-block {
    background: #0F172A;
    color: #E2E8F0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid #1E293B;
    line-height: 1.7;
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: #EEF3FA;
    color: var(--primary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

pre.code-block code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-weight: normal;
}

/* Key Concepts Checklist inside cards */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.concept-item {
    background: #FAF8F5;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid #E2E8F0;
}

.concept-item h4 {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.concept-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

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