/* ═══════════════════════════════════════════════════════════════════════════
   NEURAL NETWORK PLAYGROUND - Dark Luxe Observatory Design System
   A precision instrument for exploring the depths of deep learning
   ═══════════════════════════════════════════════════════════════════════════ */

/* Premium Fonts - Distinctive & Memorable */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS - The Foundation
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    /* ─────────────────────────────────────────────────────────────────────────
       Deep Space Backgrounds - Void-like depth
       ───────────────────────────────────────────────────────────────────────── */
    --bg-void: #02030a;
    --bg-deep: #060812;
    --bg-surface: #0a0d17;
    --bg-card: #0e111c;
    --bg-elevated: #141826;
    --bg-hover: #1a1f30;

    /* ─────────────────────────────────────────────────────────────────────────
       Text Hierarchy - Warm whites for readability
       ───────────────────────────────────────────────────────────────────────── */
    --text-bright: #f8f9fc;
    --text-primary: #e4e6ed;
    --text-secondary: #8a8fa3;
    --text-muted: #4d5166;
    --text-dim: #2d3344;

    /* ─────────────────────────────────────────────────────────────────────────
       Borders & Dividers - Subtle glass effect
       ───────────────────────────────────────────────────────────────────────── */
    --border-subtle: rgba(255, 255, 255, 0.03);
    --border-default: rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(255, 255, 255, 0.18);

    /* ─────────────────────────────────────────────────────────────────────────
       Tab Accent Colors - Each tab has unique personality
       ───────────────────────────────────────────────────────────────────────── */
    /* Neural Net (MLP) - Sky Blue */
    --accent-mlp: #38bdf8;
    --accent-mlp-glow: rgba(56, 189, 248, 0.35);
    --accent-mlp-soft: rgba(56, 189, 248, 0.12);

    /* CNN - Violet Purple */
    --accent-cnn: #a855f7;
    --accent-cnn-glow: rgba(168, 85, 247, 0.4);
    --accent-cnn-soft: rgba(168, 85, 247, 0.15);

    /* Transformer - Solar Orange */
    --accent-transformer: #ff7a45;
    --accent-transformer-glow: rgba(255, 122, 69, 0.4);
    --accent-transformer-soft: rgba(255, 122, 69, 0.15);

    /* GNN - Emerald Green */
    --accent-gnn: #10b981;
    --accent-gnn-glow: rgba(16, 185, 129, 0.4);
    --accent-gnn-soft: rgba(16, 185, 129, 0.15);

    /* Diffusion - Hot Pink */
    --accent-diffusion: #ec4899;
    --accent-diffusion-glow: rgba(236, 72, 153, 0.4);
    --accent-diffusion-soft: rgba(236, 72, 153, 0.15);

    /* Design Spaces - Gold */
    --accent-design: #fbbf24;
    --accent-design-glow: rgba(251, 191, 36, 0.4);
    --accent-design-soft: rgba(251, 191, 36, 0.15);

    /* ─────────────────────────────────────────────────────────────────────────
       Status Colors - Clear semantic meaning
       ───────────────────────────────────────────────────────────────────────── */
    --color-success: #22c55e;
    --color-success-glow: rgba(34, 197, 94, 0.4);
    --color-warning: #fbbf24;
    --color-warning-glow: rgba(251, 191, 36, 0.4);
    --color-error: #ef4444;
    --color-error-glow: rgba(239, 68, 68, 0.4);
    --color-info: #3b82f6;
    --color-info-glow: rgba(59, 130, 246, 0.4);

    /* Current tab accent (dynamically set) */
    --accent: var(--accent-mlp);
    --accent-glow: var(--accent-mlp-glow);
    --accent-soft: var(--accent-mlp-soft);

    /* ─────────────────────────────────────────────────────────────────────────
       Glass Morphism - Premium panels
       ───────────────────────────────────────────────────────────────────────── */
    --glass-bg: rgba(14, 17, 28, 0.8);
    --glass-bg-light: rgba(20, 24, 38, 0.9);
    --glass-bg-lighter: rgba(26, 31, 48, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-bright: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;

    /* ─────────────────────────────────────────────────────────────────────────
       Shadows - Depth & atmosphere
       ───────────────────────────────────────────────────────────────────────── */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.03);

    /* ─────────────────────────────────────────────────────────────────────────
       Typography - Distinctive & Readable
       ───────────────────────────────────────────────────────────────────────── */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
    --font-ui: 'Space Grotesk', system-ui, sans-serif;

    /* ─────────────────────────────────────────────────────────────────────────
       Spacing Scale
       ───────────────────────────────────────────────────────────────────────── */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* ─────────────────────────────────────────────────────────────────────────
       Border Radius
       ───────────────────────────────────────────────────────────────────────── */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ─────────────────────────────────────────────────────────────────────────
       Animation
       ───────────────────────────────────────────────────────────────────────── */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s var(--ease-out);
    --transition-base: 0.25s var(--ease-out);
    --transition-slow: 0.4s var(--ease-out);

    /* ─────────────────────────────────────────────────────────────────────────
       Layout Dimensions
       ───────────────────────────────────────────────────────────────────────── */
    --header-height: 64px;
    --controls-height: 56px;
    --sidebar-width: 280px;
    --metrics-height: 52px;
    --gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR - Refined & Minimal
   ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    background-clip: padding-box;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════════════════ */
::selection {
    background: var(--accent-soft);
    color: var(--text-bright);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PARTICLES CANVAS - Background atmosphere
   ═══════════════════════════════════════════════════════════════════════════ */
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AMBIENT GLOWS - Atmospheric lighting
   ═══════════════════════════════════════════════════════════════════════════ */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
    opacity: 0.15;
    z-index: 0;
    animation: ambientFloat 20s ease-in-out infinite;
}

.ambient-glow--1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -200px;
    background: var(--accent);
    animation-delay: 0s;
}

.ambient-glow--2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    right: -150px;
    background: color-mix(in srgb, var(--accent) 50%, #a855f7);
    animation-delay: -7s;
}

.ambient-glow--3 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: color-mix(in srgb, var(--accent) 30%, #10b981);
    animation-delay: -14s;
}

@keyframes ambientFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
    25% { transform: translate(30px, -30px) scale(1.1); opacity: 0.2; }
    50% { transform: translate(-20px, 20px) scale(0.95); opacity: 0.12; }
    75% { transform: translate(40px, 10px) scale(1.05); opacity: 0.18; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAYOUT - Main grid structure
   ═══════════════════════════════════════════════════════════════════════════ */
.app {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: var(--header-height) var(--controls-height) 1fr var(--metrics-height);
    grid-template-areas:
        "header"
        "controls"
        "main"
        "footer";
    height: 100vh;
    padding: var(--gap);
    gap: var(--gap);
}

/* Noise texture overlay for depth */
.app::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

.main-content {
    grid-area: main;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--gap);
    min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER - Premium branding & navigation
   ═══════════════════════════════════════════════════════════════════════════ */
.header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

/* Gradient accent line */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.5;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header__logo {
    width: 42px;
    height: 42px;
    position: relative;
}

.logo-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.header__title h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px var(--accent-glow);
}

.header__subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.header__nav {
    display: flex;
    gap: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB NAVIGATION - Premium pill design
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 5px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-inner);
}

.tab-btn {
    padding: 10px 22px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-glow), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.tab-btn:hover::before {
    opacity: 0.5;
}

.tab-btn--active {
    color: #0a0d17;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 85%, white));
    box-shadow: 0 4px 16px var(--accent-glow);
    text-shadow: none;
}

.tab-btn--active::before {
    opacity: 0;
}

/* Tab-specific accent colors - all use dark text for readability */
.tab-btn[data-tab="mlp"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-mlp), color-mix(in srgb, var(--accent-mlp) 85%, white));
    box-shadow: 0 4px 16px var(--accent-mlp-glow);
    color: #0a0d17;
}

.tab-btn[data-tab="cnn"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-cnn), color-mix(in srgb, var(--accent-cnn) 85%, white));
    box-shadow: 0 4px 16px var(--accent-cnn-glow);
    color: #0a0d17;
}

.tab-btn[data-tab="transformer"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-transformer), color-mix(in srgb, var(--accent-transformer) 85%, white));
    box-shadow: 0 4px 16px var(--accent-transformer-glow);
    color: #0a0d17;
}

.tab-btn[data-tab="gnn"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-gnn), color-mix(in srgb, var(--accent-gnn) 85%, white));
    box-shadow: 0 4px 16px var(--accent-gnn-glow);
    color: #0a0d17;
}

.tab-btn[data-tab="diffusion"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-diffusion), color-mix(in srgb, var(--accent-diffusion) 85%, white));
    box-shadow: 0 4px 16px var(--accent-diffusion-glow);
    color: #0a0d17;
}

.tab-btn[data-tab="design-spaces"].tab-btn--active {
    background: linear-gradient(135deg, var(--accent-design), color-mix(in srgb, var(--accent-design) 85%, white));
    box-shadow: 0 4px 16px var(--accent-design-glow);
    color: #0a0d17;
}

/* Tab Panels */
.tab-panel {
    display: none;
    grid-area: controls / controls / main / main;
    grid-row: 2 / 4;
}

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

/* Tab panel grid positioning */
#mlp-panel.tab-panel--active > .controls-bar { grid-area: controls; }
#mlp-panel.tab-panel--active > .main-content { grid-area: main; }
#cnn-panel.tab-panel--active > .cnn-controls-bar { grid-area: controls; }
#cnn-panel.tab-panel--active > .main-content { grid-area: main; min-height: 0; overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROLS BAR - Top toolbar
   ═══════════════════════════════════════════════════════════════════════════ */
.controls-bar {
    grid-area: controls;
    display: flex;
    align-items: center;
    padding: 0 var(--space-5);
    gap: var(--space-3);
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.control-section {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.control-section__label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.control-section__value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    min-width: 40px;
    text-shadow: 0 0 15px var(--accent-glow);
}

.control-section--metrics {
    gap: var(--space-5);
}

.control-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg, transparent, var(--border-bright), transparent);
    flex-shrink: 0;
}

/* Inline Metrics */
.inline-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.inline-metric__label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.inline-metric__value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
}

.inline-metric__value--loss {
    color: var(--color-warning);
    text-shadow: 0 0 10px var(--color-warning-glow);
}

.inline-metric__value--accuracy {
    color: var(--color-success);
    text-shadow: 0 0 10px var(--color-success-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DATASET GRID - Visual selection
   ═══════════════════════════════════════════════════════════════════════════ */
.dataset-grid {
    display: flex;
    gap: 6px;
}

.dataset-btn {
    width: 40px;
    height: 40px;
    padding: 6px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dataset-btn svg {
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.dataset-btn:hover {
    border-color: var(--border-bright);
    background: var(--bg-elevated);
}

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

.dataset-btn--active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 15px var(--accent-glow);
}

.dataset-btn--active svg {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLASS PANEL - Premium container
   ═══════════════════════════════════════════════════════════════════════════ */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--border-bright) 0%, transparent 50%, var(--border-bright) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.glass-panel--inner {
    background: var(--glass-bg-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR - Navigation & controls
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-deep) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
}

.sidebar__header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
    position: relative;
}

.sidebar__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-5);
    right: var(--space-5);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
}

.sidebar__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.sidebar__title svg {
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   VISUALIZATION AREA
   ═══════════════════════════════════════════════════════════════════════════ */
.visualization {
    display: flex;
    gap: var(--gap);
    min-height: 0;
}

.viz-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
}

.viz-panel--network {
    flex: 1;
    min-width: 0;
}

.viz-panel--boundary {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.viz-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.viz-panel__header h3 {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}

.viz-panel__body {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-void) 100%);
}

.viz-panel__body canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Square aspect ratio for decision boundary */
.viz-panel--boundary .viz-panel__body {
    width: 100%;
    aspect-ratio: 1 / 1;
    flex: none;
}

.viz-panel__legend {
    display: flex;
    gap: var(--space-4);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.legend-item--class-a::before {
    background: var(--color-warning);
    color: var(--color-warning);
}

.legend-item--class-b::before {
    background: var(--color-success);
    color: var(--color-success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   METRICS BAR - Bottom status
   ═══════════════════════════════════════════════════════════════════════════ */
.metrics-bar {
    grid-area: footer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    gap: var(--space-6);
    min-height: 0;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-surface) 100%);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.metric {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}

.metric__label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.metric__value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
}

.metric__value--loss {
    color: var(--color-warning);
    text-shadow: 0 0 10px var(--color-warning-glow);
}

.metric__value--accuracy {
    color: var(--color-success);
    text-shadow: 0 0 10px var(--color-success-glow);
}

.metric--chart {
    flex: 0 0 auto;
    max-width: 240px;
    min-width: 140px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
}

.metric--chart canvas {
    flex: 1;
    height: 30px;
    max-height: 30px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYER CONFIG CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.layer-config {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    transition: all var(--transition-base);
}

.layer-config:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.layer-config__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.layer-config__badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.layer-config__badge--input {
    background: var(--color-success-glow);
    color: var(--color-success);
    box-shadow: 0 0 10px var(--color-success-glow);
}

.layer-config__badge--hidden {
    background: var(--color-warning-glow);
    color: var(--color-warning);
    box-shadow: 0 0 10px var(--color-warning-glow);
}

.layer-config__badge--output {
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.layer-config__neurons {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.layer-config__features {
    font-size: 11px;
    color: var(--text-muted);
}

/* Input Feature Toggles */
.input-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.feature-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
}

.feature-toggle__label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

.feature-toggle:hover {
    border-color: var(--border-bright);
    background: var(--bg-hover);
}

.feature-toggle:hover .feature-toggle__label {
    color: var(--text-secondary);
}

.feature-toggle--active {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 10px var(--accent-glow);
}

.feature-toggle--active .feature-toggle__label {
    color: var(--accent);
    font-weight: 700;
}

.feature-toggle--active:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.hidden-layers {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Network Summary */
.network-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-top: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.network-summary__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.network-summary__label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.network-summary__value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROL GROUPS
   ═══════════════════════════════════════════════════════════════════════════ */
.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.control-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.training-controls {
    display: flex;
    gap: var(--space-2);
}

.training-controls .btn--primary {
    min-width: 90px;
}

/* Compact Slider for Controls Bar */
.slider--compact {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-elevated);
    border-radius: 3px;
    cursor: pointer;
}

.slider--compact::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, white));
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
    box-shadow: 0 2px 8px var(--accent-glow);
    border: 2px solid var(--bg-card);
}

.slider--compact::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider--compact::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
}

/* Compact Select for Controls Bar */
.select--compact {
    padding: 8px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.select--compact:hover,
.select--compact:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.select--compact option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Full-width Loss Chart */
.metric--chart-full {
    flex: 0 0 auto;
    max-width: 320px;
    min-width: 200px;
    flex-direction: row;
    gap: var(--space-4);
    align-items: center;
}

.metric--chart-full .metric__label {
    white-space: nowrap;
}

.metric--chart-full canvas {
    flex: 1;
    height: 36px;
    max-height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB ACCENT CONTEXT - Automatically style based on active tab
   ═══════════════════════════════════════════════════════════════════════════ */

/* MLP Tab Active */
body:has(#mlp-panel.tab-panel--active) {
    --accent: var(--accent-mlp);
    --accent-glow: var(--accent-mlp-glow);
    --accent-soft: var(--accent-mlp-soft);
}

/* CNN Tab Active */
body:has(#cnn-panel.tab-panel--active) {
    --accent: var(--accent-cnn);
    --accent-glow: var(--accent-cnn-glow);
    --accent-soft: var(--accent-cnn-soft);
}

/* Transformer Tab Active */
body:has(#transformer-panel.tab-panel--active) {
    --accent: var(--accent-transformer);
    --accent-glow: var(--accent-transformer-glow);
    --accent-soft: var(--accent-transformer-soft);
}

/* GNN Tab Active */
body:has(#gnn-panel.tab-panel--active) {
    --accent: var(--accent-gnn);
    --accent-glow: var(--accent-gnn-glow);
    --accent-soft: var(--accent-gnn-soft);
}

/* Diffusion Tab Active */
body:has(#diffusion-panel.tab-panel--active) {
    --accent: var(--accent-diffusion);
    --accent-glow: var(--accent-diffusion-glow);
    --accent-soft: var(--accent-diffusion-soft);
}

/* Design Spaces Tab Active */
body:has(#design-spaces-panel.tab-panel--active) {
    --accent: var(--accent-design);
    --accent-glow: var(--accent-design-glow);
    --accent-soft: var(--accent-design-soft);
}
