/* Modern CSS Design System - Premium Dark Theme */
:root {
    --bg-dark: #0b0f19;
    --card-bg: rgba(22, 30, 49, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-gold: #fbbf24;
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background gradient glows */
.app-container {
    width: 100%;
    max-width: 1400px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.blur-bg-1 {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.blur-bg-2 {
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Header design */
header {
    margin-bottom: 2rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trophy-icon {
    font-size: 2.5rem;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.title-meta h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Premium Card (Glassmorphism) */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

/* Chart Card specific styles */
.chart-card {
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#chart-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* Giant background year display */
#bg-year-display {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-heading);
    font-size: 12rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    line-height: 1;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    transition: color 0.5s ease;
}

/* Controls & Info Card */
.control-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
}

/* Champion Announcer Area */
.champion-announcement h3,
.controls-wrapper h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.champ-info-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 100px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.champ-info-box:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.hidden-crest {
    display: none;
}

.champ-crest {
    width: 55px;
    height: 55px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.champ-text-group {
    display: flex;
    flex-direction: column;
}

#current-champ-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

#current-champ-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Timeline Slider Styles */
.timeline-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.timeline-label {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

#timeline-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
}

#timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #60a5fa;
}

/* Button UI */
.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.1);
}

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

/* Speed Controls */
.speed-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.speed-buttons {
    display: flex;
    gap: 0.4rem;
}

.btn-speed {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-speed:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-speed.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 600;
}

/* Footer style inside panel */
.app-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(156, 163, 175, 0.5);
}

/* D3 SVGs design */
svg {
    overflow: visible;
}

.bar-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    fill: var(--text-primary);
}

.bar-value {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    fill: var(--text-secondary);
}

.axis-text {
    font-family: var(--font-body);
    font-size: 0.8rem;
    fill: var(--text-secondary);
}

.grid-line {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1px;
}

/* Custom micro-animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
    }
    50% {
        opacity: .8;
        filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.2));
    }
}
