:root[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --header-bg: linear-gradient(135deg, #4a5fc1 0%, #5a3a7a 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.header {
    background: var(--header-bg);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.header-archive-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-archive-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    transition: background 0.3s ease;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    text-align: center;
    padding: 2rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-card-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.info-card-label {
    font-size: 1.1rem;
    opacity: 0.95;
}

.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    color: #856404;
}

:root[data-theme="dark"] .warning-box {
    background: #3d3415;
    color: #ffd966;
}

.legal-box {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    color: #0d47a1;
}

:root[data-theme="dark"] .legal-box {
    background: #1a2f3f;
    color: #64b5f6;
}

.danger-box {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    color: #c62828;
}

:root[data-theme="dark"] .danger-box {
    background: #3d1a1a;
    color: #ff8a80;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
}

.timeline-item:after {
    content: '';
    position: absolute;
    left: -1.7rem;
    top: 12px;
    width: 2px;
    height: calc(100% - 12px);
    background: var(--border-color);
}

.timeline-item:last-child:after {
    display: none;
}

.timeline-date {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.btn-primary {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #5568d3;
}

.link-card {
    background: var(--bg-primary);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.link-card a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.link-card a:hover {
    text-decoration: underline;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem 0;
}

.contradiction-box {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    color: #c62828;
}

:root[data-theme="dark"] .contradiction-box {
    background: #3d1a1a;
    color: #ff8a80;
}

.fact-item {
    padding: 0.75rem;
    margin: 0.5rem 0;
    background: var(--bg-primary);
    border-radius: 6px;
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.status-red {
    background: #ffcdd2;
    color: #c62828;
}

.status-yellow {
    background: #fff9c4;
    color: #f57f17;
}

.category-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 5px solid #667eea;
    box-shadow: var(--card-shadow);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.video-card {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-card a {
    color: #d32f2f;
    text-decoration: none;
    font-weight: 500;
}

.scandal-number {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.muted {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Rankings Section */
.rankings-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
    border: 2px solid #667eea;
}

:root[data-theme="dark"] .rankings-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.ranking-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.ranking-chart h3 {
    margin: 0 0 1.5rem 0;
    color: #667eea;
    font-size: 1.2rem;
    text-align: center;
    border: none;
}

.contract-warning {
    background: rgba(255, 87, 34, 0.1);
    border: 2px dashed #FF5722;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 12px;
}

:root[data-theme="dark"] .contract-warning {
    background: rgba(255, 87, 34, 0.2);
}

.contract-warning h4 {
    color: #d32f2f;
    margin-bottom: 0.75rem;
}

/* Case Details */
.case-details-box {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 5px solid #f44336;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

:root[data-theme="dark"] .case-details-box {
    background: linear-gradient(135deg, #3d1a1a 0%, #4d2020 100%);
}

.case-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.case-detail-item {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #f44336;
}

.case-detail-item strong {
    display: block;
    color: #d32f2f;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

a {
    color: #667eea;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .header-archive-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .rankings-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        top: 15px;
        right: 15px;
    }

    .info-card-number {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item:before {
        left: -1.5rem;
    }

    .timeline-item:after {
        left: -1.2rem;
    }

    /* Table responsiveness */
    table {
        font-size: 0.85rem;
    }

    table th,
    table td {
        padding: 0.5rem !important;
    }

    /* Better button sizing on mobile */
    .btn-primary {
        font-size: 1rem !important;
        padding: 0.9rem 1.5rem !important;
    }

    /* Rankings section mobile */
    .rankings-section {
        padding: 1.5rem;
    }

    .rankings-section h2 {
        font-size: 1.5rem !important;
    }

    /* Case details mobile */
    .case-details-box {
        padding: 1.5rem;
    }

    /* Password display on mobile */
    code {
        font-size: 0.9rem !important;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .header {
        padding: 2rem 1rem 1.5rem;
    }

    .info-card-number {
        font-size: 2rem;
    }

    .info-card-label {
        font-size: 0.95rem;
    }

    table {
        font-size: 0.75rem;
    }

    table th,
    table td {
        padding: 0.35rem !important;
    }

    /* Stack table on very small screens */
    .rankings-grid,
    .stats-grid,
    .info-grid,
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .container {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }
}