/* Home dashboard stylesheet for standings, charts, and zone highlights. */
/* This file defines the visual theme for the public-facing frontend layer. */

:root {
    --bg: #0a0a0f;
    --bg-elevated: #12121a;
    --fg: #f0f0f5;
    --muted: #6b6b7a;
    --accent: #ffd700;
    --accent-dim: #b8960033;
    --card: #16161f;
    --border: #2a2a35;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --libertadores: #22c55e;
    --pre-libertadores: #3b82f6;
    --relegation: #ef4444;
    --sul-americana: #8b5cf6;
    --heatmap-cell-fg: #000000;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
}

.font-display {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
}

.bg-atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(34, 197, 94, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(239, 68, 68, 0.05) 0%, transparent 50%),
        var(--bg);
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    100% {
        background-position: 200% 0;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

@keyframes bar-grow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.team-row {
    transition: all 0.3s ease;
    cursor: pointer;
}

.team-row:hover {
    background: rgba(255, 215, 0, 0.05);
    transform: translateX(4px);
}

.team-row.selected {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--accent);
}

.prob-bar {
    transform-origin: left;
    animation: bar-grow 1s ease-out forwards;
}

.position-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
}

.position-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
}

.position-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
}

.position-4 {
    background: var(--libertadores);
}

.position-5 {
    background: var(--libertadores);
}

.position-6 {
    background: var(--pre-libertadores);
}

.position-7 {
    background: var(--sul-americana);
}

.position-8 {
    background: var(--sul-americana);
}

.position-relegation {
    background: var(--danger);
}

.zone-libertadores {
    border-left: 4px solid var(--libertadores);
}

.zone-pre {
    border-left: 4px solid var(--pre-libertadores);
}

.zone-sul-americana {
    border-left: 4px solid var(--sul-americana);
}

.zone-relegation {
    border-left: 4px solid var(--danger);
}

.heatmap-cell {
    transition: all 0.2s ease;
    color: var(--heatmap-cell-fg);
}

.heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
}

.tooltip {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    white-space: nowrap;
}

.tooltip.visible {
    opacity: 1;
}

.tab-btn {
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--accent);
    color: var(--bg);
}

.tab-btn:not(.active):hover {
    background: rgba(255, 215, 0, 0.1);
}

.series-toggle-btn {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.05em;
    color: #ffd700;
    background: transparent;
    border: 1px solid #2a2a35;
    border-radius: 0.35rem;
    padding: 0 0.35rem;
    line-height: 1;
    transition: transform 220ms ease, color 220ms ease, border-color 220ms ease, background-color 220ms ease;
    transform-origin: center;
}

.series-toggle-btn:hover {
    color: #0a0a0f;
    background: #ffd700;
    border-color: #ffd700;
}

.series-toggle-btn.switching {
    transform: scale(1.08);
}

.stat-card-link {
    transition: all 0.3s ease;
}

.stat-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card-link:hover .link-indicator {
    opacity: 1;
    transform: translateX(0);
}

.link-indicator {
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
}

.back-to-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #2a2a35;
    border-radius: 0.6rem;
    padding: 0.35rem 0.75rem;
    color: #6b6b7a;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.back-to-top-btn:hover {
    color: #ffd700;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
[tabindex="0"]:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
