/* ==========================================================================
   Baloto Oracle - Main Stylesheet
   ========================================================================== */

/* CSS Custom Properties */
:root {
    /* Colors - Dark Theme (Default) */
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-tertiary: #1a1a2e;
    --bg-card: #161624;
    --bg-hover: #1e1e32;
    
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --text-inverse: #0a0a12;
    
    --accent-primary: #ED1C24;
    --accent-secondary: #FFE903;
    --accent-tertiary: #FFB900;
    --accent-danger: #ef4444;
    --accent-warning: #FF8C00;
    
    --border-color: #2a2a3e;
    --border-light: #3a3a4e;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(237, 28, 36, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --container-max: 1920px;
    --header-height: 72px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f8;
    --bg-card: #ffffff;
    --bg-hover: #e8ebf3;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #8a8a9a;
    --text-inverse: #ffffff;
    
    --border-color: #e0e3ec;
    --border-light: #e8ebf3;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(255, 233, 3, 0.35);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

#descriptive h3, #inferential h3 {
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
h4 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p { color: var(--text-secondary); }

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--accent-tertiary); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background: var(--bg-tertiary);
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   Layout Components
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(var(--bg-secondary), 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon { font-size: 1.5rem; }

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-counter {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    white-space: nowrap;
}

.visit-counter svg {
    flex-shrink: 0;
    color: var(--accent-tertiary);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

#mobile-menu-btn { display: none; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
    padding: calc(var(--header-height) + 3rem) 1.5rem 5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.hero-content { position: relative; min-width: 0; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-inverse);
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glow);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: var(--text-inverse);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    margin-bottom: 1rem;
    line-height: 1.1;
    overflow-wrap: break-word;
}

.title-main {
    display: block;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-sub {
    display: block;
    font-size: 0.6em;
    font-weight: 400;
    color: var(--text-secondary);
}

.hero-description {
    font-size: 1.125rem;
    max-width: 500px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Hero Visual */
.hero-visual { position: relative; }

#hero-chart-container {
    width: 100%;
    height: 400px;
    max-height: 500px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================================================
   Chart Cards
   ========================================================================== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.chart-grid.three-col {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.chart-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.chart-controls { display: flex; gap: 0.5rem; }

.control-select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.control-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.chart-wrapper {
    padding: 1.5rem;
    position: relative;
    min-height: 300px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ==========================================================================
   Test Results
   ========================================================================== */
.test-result { padding: 1.5rem; }

.test-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.test-status.pass {
    background: rgba(237, 28, 36, 0.1);
    border: 1px solid rgba(237, 28, 36, 0.3);
}

.test-status.fail {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.test-status.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.test-status.pass .status-icon {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.test-status.fail .status-icon {
    background: var(--accent-danger);
    color: var(--text-inverse);
}

.test-status.warning .status-icon {
    background: var(--accent-warning);
    color: var(--text-inverse);
}

.status-info h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.status-info p { font-size: 0.875rem; margin: 0; }

.test-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    font-size: 0.875rem;
}

.detail-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.detail-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

/* Prediction dashboard - full width card */
#prediction-dashboard-container {
    display: block;
}

/* Header logo */
.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Validation metric rows */
.metric-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.metric-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.metric-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-primary);
    text-align: right;
}

.card-conclusion {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-secondary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Prediction dashboard rows */
.pred-ball-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.pred-balls-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.pred-ball-pct {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Validation test badges */
.test-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.test-badge.pass {
    background: rgba(74, 222, 128, 0.15);
    color: #4ADE80;
}

.test-badge.fail {
    background: rgba(248, 113, 113, 0.15);
    color: #F87171;
}

.test-note {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

.tests-summary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.tests-header {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Interpretation
   ========================================================================== */
.interpretation {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

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

.interpretation ul {
    margin: 0;
    padding-left: 1.5rem;
}

.interpretation li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   Predictions
   ========================================================================== */
.disclaimer-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.disclaimer-banner strong { color: var(--text-primary); }

.prediction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.prediction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.prediction-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.prediction-item:hover::before { opacity: 1; }
.prediction-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.prediction-number {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    margin-bottom: 0.25rem;
}

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

.prediction-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Recommended Combo */
.recommended-combo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.combo-numbers {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.combo-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: white;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
    animation: ballAppear 0.5s ease backwards;
}

.combo-ball:hover { transform: scale(1.1); }

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

.combo-ball.superbalota {
    width: 45px;
    height: 45px;
    border: 3px solid var(--accent-tertiary);
    background: var(--bg-card);
    color: var(--accent-tertiary);
    font-size: 1rem;
}

.combo-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Methodology */
.methodology {
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.methodology summary {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-primary);
    list-style: none;
}

.methodology summary::-webkit-details-marker { display: none; }

.methodology summary::after {
    content: '+';
    float: right;
    transition: transform var(--transition-fast);
}

.methodology[open] summary::after { transform: rotate(45deg); }

.methodology-content {
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.methodology-content ul { margin: 1rem 0 1rem 1.5rem; }
.methodology-content li { margin-bottom: 0.5rem; }

/* ==========================================================================
   Visualizer
   ========================================================================== */
.visualizer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 180px;
}

.control-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Interactive Viz */
#interactive-viz {
    min-height: 400px;
}

/* Data Table */
.table-wrapper {
    overflow-x: auto;
    padding: 0 1.5rem 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table .ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: white;
    margin-right: 0.25rem;
}

.data-table .ball.superbalota {
    background: var(--bg-card);
    color: var(--accent-tertiary);
    border: 2px solid var(--accent-tertiary);
}

.data-table .jackpot {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    padding: 4rem 0 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand .logo-icon { font-size: 2rem; }
.footer-brand span { font-weight: 700; font-size: 1.25rem; }
.footer-brand p { margin-top: 0.5rem; font-size: 0.875rem; }

.footer-links h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { font-size: 0.875rem; }

.footer-disclaimer p {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.footer-disclaimer strong { color: var(--accent-danger); }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
    max-width: 400px;
}

.toast.success { border-left: 4px solid var(--accent-primary); }
.toast.error { border-left: 4px solid var(--accent-danger); }
.toast.info { border-left: 4px solid var(--accent-secondary); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(237, 28, 36, 0.2); color: var(--accent-primary); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.2); color: var(--accent-danger); }
.toast.info .toast-icon { background: rgba(255, 233, 3, 0.2); color: var(--accent-secondary); }

.toast-message { flex: 1; font-size: 0.875rem; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}
.toast-close:hover { color: var(--text-primary); }

/* ==========================================================================
   Loading States
   ========================================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.chart-wrapper.loading .skeleton {
    width: 100%;
    height: 300px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-description { margin-left: auto; margin-right: auto; }
    .hero-stats { grid-template-columns: repeat(4, 1fr); }
    .hero-actions { justify-content: center; }
    .hero-visual { order: -1; }
    
    .chart-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        display: none;
        gap: 0;
    }
    
    .nav-links.open { display: flex; }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }
    
    #mobile-menu-btn { display: flex; }
    
    .hero { padding-top: calc(var(--header-height) + 2rem); }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    
    .section { padding: 3rem 0; }
    
    .chart-grid.three-col { grid-template-columns: 1fr; }
    
    .visualizer-controls { flex-direction: column; align-items: stretch; }
    .control-group { width: 100%; }
    
    .footer-grid { grid-template-columns: 1fr; }
    .footer-brand { text-align: center; }
    
    .toast-container { left: 1rem; right: 1rem; bottom: 1rem; }
    .toast { min-width: auto; }
}

@media (max-width: 480px) {
    h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
    .hero { overflow-x: clip; }
    .hero-stats { grid-template-columns: 1fr; }
    .stat-card { padding: 0.9rem; }
    .stat-value { font-size: 1.5rem; }
    .hero-description { max-width: 100%; }
    
    .prediction-grid { grid-template-columns: repeat(5, 1fr); }
    .prediction-number { font-size: 1.25rem; }
    
    .combo-ball { width: 40px; height: 40px; font-size: 1rem; }
    .combo-ball.superbalota { width: 36px; height: 36px; }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .navbar, .hero-actions, .visualizer-controls, .footer, .toast-container { display: none; }
    .hero { min-height: auto; padding: 2rem 0; }
    .section { page-break-inside: avoid; }
    .chart-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
    body { background: white; color: black; }
    .bg-canvas { display: none; }
}

/* ==========================================================================
   Modelos Predictivos
   ========================================================================== */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.model-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.model-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
    font-style: italic;
}

/* ==========================================================================
   Accessibility (a11y)
   ========================================================================== */
/* Indicador visible de foco SOLO cuando se navega por teclado */
.keyboard-nav a:focus,
.keyboard-nav button:focus,
.keyboard-nav input:focus,
.keyboard-nav select:focus,
.keyboard-nav textarea:focus,
.keyboard-nav [tabindex]:focus {
    outline: 3px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ==========================================================================
   Error Panel (datos reales no disponibles - sin fallback)
   ========================================================================== */
.error-panel {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 2rem;
}

.error-panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-lg, 1rem);
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.4));
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

.error-panel-icon {
    display: block;
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.error-panel-message {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}