/* ── Shared modern UI ───────────────────────────────────────────────────────
   Used by: tables2.html, tables3.html, analysis.html, index.html,
            results.html, protest.html, protestconf.html, privacy_page.html
   Note: Google Fonts are loaded via <link> in each HTML file.
   Served at: /modern.css
   ───────────────────────────────────────────────────────────────────────── */

/* ── CSS variable defaults (overridden dynamically by applyColorTheme()) ── */
:root {
    --primary-color: #2ecc71;
    --primary-dark: #27ae60;
    --primary-darker: #1e8449;
    --neon-color: #00ff88;
    --grid-color: rgba(46, 204, 113, 0.03);
    --header-shadow: rgba(46, 204, 113, 0.3);

    /* Legacy names kept for compatibility */
    --primary-green: #2ecc71;
    --neon-green: #00ff88;
    --accent-blue: #3498db;

    /* Base palette */
    --dark-bg: #0a0a0a;
    --card-bg: #141414;
    --card-hover: #1a1a1a;
    --border-subtle: #252525;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;

    /* Theme-derived variables (set by applyColorTheme(); green defaults here) */
    --btn-hover-bg: rgba(46, 204, 113, 0.2);
    --btn-hover-shadow: rgba(46, 204, 113, 0.3);
    --btn-active-shadow: rgba(46, 204, 113, 0.5);
    --table-header-bg: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(52, 152, 219, 0.1) 100%);
    --table-header-border: rgba(46, 204, 113, 0.2);
    --header-cell-hover: rgba(46, 204, 113, 0.15);
    --row-hover-shadow: rgba(46, 204, 113, 0.15);
    --row-hover-inset: rgba(46, 204, 113, 0.05);
    --points-hover-bg: rgba(46, 204, 113, 0.1);
    --best-score-bg: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(0, 255, 136, 0.2) 100%);
    --best-score-shadow: rgba(46, 204, 113, 0.3);
    --total-text-shadow: rgba(0, 255, 136, 0.5);
    --mobile-total-bg: rgba(46, 204, 113, 0.1);
    --mobile-total-border: rgba(46, 204, 113, 0.3);
    --scroll-btn-shadow: rgba(46, 204, 113, 0.4);
    --scroll-btn-hover-shadow: rgba(46, 204, 113, 0.6);
    --position-shadow: rgba(46, 204, 113, 0.2);
    --position-hover-shadow: rgba(46, 204, 113, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Animated background grid ───────────────────────────────────────────── */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ── Layout container ───────────────────────────────────────────────────── */
.container {
    max-width: 2500px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
    z-index: 1;
}

/* ── Gradient page header (all page variants) ───────────────────────────── */
.header,
.results-header,
.protest-header {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--header-shadow);
}

.header::before,
.results-header::before,
.protest-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="2" fill="rgba(0,0,0,0.2)"/><circle cx="30" cy="30" r="3" fill="rgba(0,0,0,0.15)"/><circle cx="50" cy="50" r="2" fill="rgba(0,0,0,0.2)"/><circle cx="70" cy="70" r="3" fill="rgba(0,0,0,0.15)"/><circle cx="90" cy="10" r="2" fill="rgba(0,0,0,0.2)"/></svg>');
    opacity: 0.8;
}

.header-content {
    position: relative;
    z-index: 1;
}

/* ── Header text elements ───────────────────────────────────────────────── */
.league-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: white;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

/* Compact league name shown above subtitle (analysis page style) */
.header-league-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 4px;
}

.header-subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.header-nav {
    font-size: 0.85rem;
    margin-top: 6px;
}

.header-nav a {
    color: white;
    text-decoration: underline;
    opacity: 0.8;
}

/* ── Pill buttons ───────────────────────────────────────────────────────── */
.btn-primary {
    font-family: 'Geist', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    padding: 8px 32px;
    background: #ffffff;
    color: #0a0a0a;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

.btn-outline {
    font-family: 'Geist', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    padding: 8px 32px;
    background: transparent;
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.btn-outline:hover {
    border-color: #fff;
    color: #fff;
    transform: translateY(-2px);
}
