/* Font-face with swap for immediate text rendering */
@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/bebasneue/v20/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZhrib2Bg-4.woff2) format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(https://fonts.gstatic.com/s/inter/v24/tDbv2o-flEEny0FZhsfKu5WU5zr3E_BX0zS8.woff2) format('woff2');
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: #111111;
    color: #e5e5e5;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Section Critical Styles */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Spacing */
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pb-1 { padding-bottom: 0.25rem; }

/* Typography */
.text-white { color: #ffffff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-600 { color: #4b5563; }
.text-red-600 { color: #dc2626; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.font-sans { font-family: 'Inter', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.leading-relaxed { line-height: 1.625; }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.1em; }

/* Borders */
.border-b { border-bottom-width: 1px; }
.border-white { border-color: #ffffff; }
.border-gray-600 { border-color: #4b5563; }

/* Backgrounds */
.bg-black { background-color: #000000; }
.bg-white { background-color: #ffffff; }
.bg-red-600 { background-color: #dc2626; }

/* Sizing */
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-1\.5 { width: 0.375rem; }
.h-1\.5 { height: 0.375rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-full { width: 100%; }
.max-w-5xl { max-width: 64rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Animations */
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
@keyframes bounce {
    0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

/* Utilities */
.inline-block { display: inline-block; }
.rounded-full { border-radius: 9999px; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Hero Heading - Critical LCP Element */
h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3rem;
    line-height: 0.9;
    color: #ffffff;
    letter-spacing: -0.025em;
    font-display: swap; /* Ensure text is visible during font load */
}

/* Additional critical layout utilities */
.flex-grow { flex-grow: 1; }
.break-words { word-wrap: break-word; overflow-wrap: break-word; }
.text-left { text-align: left; }
article, header { display: block; }

/* Responsive adjustments */
@media (min-width: 640px) {
    h1 { font-size: 3.75rem; }
}
@media (min-width: 768px) {
    h1 { font-size: 4.5rem; }
    .py-10 { padding-top: 4rem; padding-bottom: 4rem; }
    .gap-3 { gap: 0.75rem; }
    .text-lg { font-size: 1.25rem; }
    .w-2 { width: 0.5rem; }
    .h-2 { height: 0.5rem; }
    .w-3 { width: 0.75rem; }
    .h-3 { height: 0.75rem; }
    .text-center { text-align: center; }
}
@media (min-width: 1024px) {
    h1 { font-size: 4.5rem; }
}
@media (min-width: 1280px) {
    h1 { font-size: 6rem; }
}

/* Performance optimization: Prevent layout shift during load */
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.text-9xl { font-size: 8rem; line-height: 1; }
@media (min-width: 640px) { .sm\:text-6xl { font-size: 3.75rem; line-height: 1; } }
@media (min-width: 768px) { .md\:text-7xl { font-size: 4.5rem; line-height: 1; } }
@media (min-width: 1024px) { .lg\:text-7xl { font-size: 4.5rem; line-height: 1; } }
@media (min-width: 1280px) { .xl\:text-9xl { font-size: 8rem; line-height: 1; } }

/* Critical paragraph styles for LCP element */
p { margin: 0; }
.leading-\[0\.9\] { line-height: 0.9; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }

/* Mobile-specific text sizes */
.text-\[10px\] { font-size: 10px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }

/* Additional layout utilities for mobile */
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-end { justify-content: flex-end; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.hidden { display: none; }
.block { display: block; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.overflow-hidden { overflow: hidden; }

/* Additional spacing */
.gap-8 { gap: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-4 { padding-top: 1rem; }
.pt-16 { padding-top: 4rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }
.mb-24 { margin-bottom: 6rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }

/* Additional colors */
.text-gray-500 { color: #6b7280; }
.text-red-500 { color: #ef4444; }
.text-green-500 { color: #22c55e; }
.bg-gray-900 { background-color: #111827; }

/* Additional borders */
.border-b-2 { border-bottom-width: 2px; }
.border-b-4 { border-bottom-width: 4px; }
.border-l-2 { border-left-width: 2px; }
.border-l-4 { border-left-width: 4px; }
.border-t { border-top-width: 1px; }
.border-gray-700 { border-color: #374151; }
.border-gray-800 { border-color: #1f2937; }
.border-green-900 { border-color: #14532d; }

/* Additional sizing */
.w-12 { width: 3rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-md { max-width: 28rem; }
.max-w-\[1200px\] { max-width: 1200px; }

/* Additional typography */
.font-head { font-family: 'Bebas Neue', sans-serif; }
.text-right { text-align: right; }
.leading-none { line-height: 1; }
.leading-snug { line-height: 1.375; }
.italic { font-style: italic; }
.break-all { word-break: break-all; }

/* Additional utilities */
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.container-custom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Chart.js Canvas Elements - Critical for interactivity */
canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    position: relative;
    pointer-events: auto !important;
    touch-action: auto !important;
    cursor: pointer;
}

/* Flexbox wrap and direction */
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

/* Additional semantic elements */
main, section, footer, article, header { display: block; }
h2, h3 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; }

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
}
@media (min-width: 768px) {
    .container-custom { padding: 0 1.5rem; }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:grid { display: grid; }
    .md\:flex-row { flex-direction: row; }
    .md\:gap-3 { gap: 0.75rem; }
    .md\:gap-6 { gap: 1.5rem; }
    .md\:gap-10 { gap: 2.5rem; }
    .md\:py-12 { padding-top: 3rem; padding-bottom: 3rem; }
    .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
    .md\:px-0 { padding-left: 0; padding-right: 0; }
    .md\:pt-24 { padding-top: 6rem; }
    .md\:mb-6 { margin-bottom: 1.5rem; }
    .md\:mb-10 { margin-bottom: 2.5rem; }
    .md\:mb-16 { margin-bottom: 4rem; }
    .md\:text-xs { font-size: 0.75rem; line-height: 1rem; }
    .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
    .md\:text-center { text-align: center; }
    .md\:text-right { text-align: right; }
    .md\:w-2 { width: 0.5rem; }
    .md\:w-3 { width: 0.75rem; }
    .md\:w-10 { width: 2.5rem; }
    .md\:h-2 { height: 0.5rem; }
    .md\:h-3 { height: 0.75rem; }
    .md\:h-10 { height: 2.5rem; }
    .md\:col-span-1 { grid-column: span 1 / span 1; }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-7 { grid-column: span 7 / span 7; }
    .md\:col-span-8 { grid-column: span 8 / span 8; }
    .md\:col-span-12 { grid-column: span 12 / span 12; }
    .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:flex-row { flex-direction: row; }
    .lg\:items-end { align-items: flex-end; }
    .lg\:gap-10 { gap: 2.5rem; }
    .lg\:gap-12 { gap: 3rem; }
    .lg\:gap-16 { gap: 4rem; }
    .lg\:pt-20 { padding-top: 5rem; }
    .lg\:mb-16 { margin-bottom: 4rem; }
    .lg\:mb-20 { margin-bottom: 5rem; }
    .lg\:mb-24 { margin-bottom: 6rem; }
    .lg\:text-5xl { font-size: 3rem; line-height: 1; }
    .lg\:text-7xl { font-size: 4.5rem; line-height: 1; }
    .lg\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .lg\:w-auto { width: auto; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:col-span-8 { grid-column: span 8 / span 8; }
    .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .xl\:gap-16 { gap: 4rem; }
    .xl\:pt-24 { padding-top: 6rem; }
    .xl\:mb-20 { margin-bottom: 5rem; }
    .xl\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .xl\:text-8xl { font-size: 6rem; line-height: 1; }
    .xl\:text-9xl { font-size: 8rem; line-height: 1; }
}

/* ========================================== */
/* SECOND STYLE BLOCK - CSS VARIABLES & COMPONENTS */
/* ========================================== */

:root {
    --bg-color: #111111;
    --paper-color: #1a1a1a;
    --text-color: #e5e5e5;
    --text-muted: #a3a3a3;
    --border-color: #333333;

    --font-head: 'Bebas Neue', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Party Colors - Kept simpler */
    --color-s: #ef4444;
    --color-v: #22d3ee;
    --color-f: #3b82f6;
    --color-g: #22c55e;
    --color-n: #e879f9;
    --color-other: #9ca3af;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll on small devices */
}

h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 400; /* Bebas Neue is bold by default */
    letter-spacing: 1px;
}

.container-custom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 768px) {
    .container-custom {
        padding: 0 1.5rem;
    }
}

/* INVESTIGATIVE DOSSIER STYLE */
.investigative-box {
    background: var(--bg-color);
    border-top: 4px solid var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .investigative-box {
        padding: 2rem 0;
        margin-bottom: 3rem;
    }
}

.investigative-header {
    font-family: var(--font-head);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1;
}
/* Laptop adjustment */
@media (min-width: 1024px) {
    .investigative-header {
        font-size: 2rem;
        margin-bottom: 1.25rem;
    }
}
/* Large Desktop */
@media (min-width: 1280px) {
    .investigative-header {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }
}

/* TYPOGRAPHY */
.stat-value {
    font-size: 3rem;
    line-height: 1;
    font-family: var(--font-head);
    color: #fff;
}
/* Laptop Size - slightly controlled */
@media (min-width: 1024px) {
    .stat-value {
        font-size: 3.5rem;
    }
}
/* Large Desktop Size */
@media (min-width: 1280px) {
    .stat-value {
        font-size: 4rem;
    }
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* FORM ELEMENTS */
select,
#time-range-select {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    font-family: var(--font-head) !important;
    font-size: 1.25rem !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem top 50% !important;
    background-size: .5em auto !important;
    border-radius: 0;
    max-width: 100%;
}
select option,
#time-range-select option {
    background: #000 !important;
    color: #fff !important;
    padding: 0.5rem;
}
select:hover,
#time-range-select:hover {
    color: #fff !important;
}
/* Laptop */
@media (min-width: 1024px) {
    select {
        font-size: 1.35rem;
    }
}
/* Large Desktop */
@media (min-width: 1280px) {
    select {
        font-size: 1.5rem;
    }
}
select:focus { outline: none; border-color: var(--text-muted); }

/* LIST ITEMS - Editorial Style */
.result-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 0;
    transition: background 0.2s;
}
@media (min-width: 768px) {
    .result-item {
        padding: 1.5rem 0;
    }
}
.result-item:hover {
    background: #161616;
}

/* PAGINATION */
.pag-btn {
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    border: 1px solid transparent;
    font-size: 0.9rem;
}
@media (min-width: 768px) {
    .pag-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}
.pag-btn:hover, .pag-btn.active {
    color: #fff;
    border-bottom: 1px solid #fff;
}

/* PARTY ACCENTS */
.border-S { border-color: var(--color-s) !important; color: var(--color-s); }
.border-V { border-color: var(--color-v) !important; color: var(--color-v); }
.border-F { border-color: var(--color-f) !important; color: var(--color-f); }
.border-G { border-color: var(--color-g) !important; color: var(--color-g); }
.border-N { border-color: var(--color-n) !important; color: var(--color-n); }

.bg-S { background-color: var(--color-s); }
.bg-V { background-color: var(--color-v); }
.bg-F { background-color: var(--color-f); }
.bg-G { background-color: var(--color-g); }
.bg-N { background-color: var(--color-n); }
.bg-OTHER { background-color: var(--color-other); }

.text-S { color: var(--color-s); }
.text-V { color: var(--color-v); }
.text-F { color: var(--color-f); }
.text-G { color: var(--color-g); }
.text-N { color: var(--color-n); }

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

/* Info Button */
.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
    flex-shrink: 0;
}
.info-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Modal/Popup */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: var(--paper-color);
    border: 2px solid var(--text-color);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .modal-content {
        padding: 2rem;
    }
}
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #fff;
}
.modal-title {
    font-family: var(--font-head);
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 1rem;
    padding-right: 2rem;
}
@media (min-width: 768px) {
    .modal-title {
        font-size: 2rem;
    }
}
.modal-body {
    font-family: var(--font-body);
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}
@media (min-width: 768px) {
    .modal-body {
        line-height: 1.8;
        font-size: 1rem;
    }
}
.modal-body p {
    margin-bottom: 1rem;
}
.modal-body ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.modal-body li {
    margin-bottom: 0.5rem;
}
