/* PRO MAX DESIGN SYSTEM */
:root {
    /* Light Mode (Normal) - Orange/Black Theme */
    --bg-color: #fce7f3;
    /* Very faint orange/pink tint or just white? Let's go Clean White/Gray */
    --bg-color: #fff7ed;
    /* Orange-50 */
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(249, 115, 22, 0.2);
    /* Orange border hint */
    --text-primary: #1a1a1a;
    /* Almost Black */
    --text-secondary: #4b5563;

    /* Theme Colors */
    --neon-green: #15803d;
    --neon-red: #b91c1c;
    --neon-yellow: #d97706;

    /* Replaced Blue with Orange/Black for identity */
    --neon-blue: #f97316;
    /* Orange-500 */
    --primary: #f97316;
    /* Defined Primary Color */

    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --bg-gradient-1: rgba(249, 115, 22, 0.1);
    /* Orange Tint */
    --bg-gradient-2: rgba(0, 0, 0, 0.05);
    /* Black Tint */
}

[data-theme="dark"] {
    /* Pro Max Dark Mode */
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --neon-green: #10b981;
    --neon-red: #ef4444;
    --neon-yellow: #f59e0b;
    --neon-blue: #3b82f6;
    --primary: #3b82f6;
    /* Defined Primary Color (Blue) */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --bg-gradient-1: rgba(59, 130, 246, 0.1);
    --bg-gradient-2: rgba(16, 185, 129, 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-image:
        radial-gradient(circle at 10% 20%, var(--bg-gradient-1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, var(--bg-gradient-2) 0%, transparent 40%);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header & Toggle */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
}

.header-content {
    text-align: left;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--glass-shadow);
    transition: all 0.2s;
}

.theme-toggle:hover {
    transform: scale(1.05);
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    /* Orange to Black Gradient */
    background: linear-gradient(to right, #ea580c, #000000);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

[data-theme="dark"] h1 {
    /* Revert to Neon Blue/Green in Dark Mode */
    background: linear-gradient(to right, var(--neon-blue), var(--neon-green));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--neon-blue);
    padding-left: 1rem;
    color: var(--text-primary);
}

/* CARDS GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15);
    border-color: var(--neon-blue);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Card Content */
.league-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: block;
}

.teams {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.vs {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Prediction Badge */
.prediction-box {
    background: rgba(125, 125, 125, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
}

.pred-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pred-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

/* CONFIDENCE DONUT CHART */
.prediction-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.donut-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.donut {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    /* Conic gradient will be set inline */
    mask: radial-gradient(transparent 55%, black 56%);
    -webkit-mask: radial-gradient(transparent 55%, black 56%);
}

.donut-text {
    position: absolute;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pred-info {
    flex: 1;
    text-align: left;
}

/* Update text colors to match badges */
.pred-home .donut {
    background: conic-gradient(var(--neon-green) var(--pct), transparent 0);
}

.pred-away .donut {
    background: conic-gradient(var(--neon-red) var(--pct), transparent 0);
}

.pred-draw .donut {
    background: conic-gradient(var(--neon-yellow) var(--pct), transparent 0);
}

.pred-away .pred-value {
    color: var(--neon-red);
}

.pred-draw .pred-value {
    color: var(--neon-yellow);
}

/* Odds Section */
.odds-row {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.odds-move.up {
    color: var(--neon-green);
}

.odds-move.down {
    color: var(--neon-red);
}

/* Waiting State */
.waiting .pred-value {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.waiting .prediction-box {
    border-style: dashed;
}

/* RECENT RESULTS TABLE */
.recent-list {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0;
    /* Removed padding for edge-to-edge borders */
    border: 1px solid var(--card-border);
    overflow: hidden;
    /* Clips children to rounded corners */
}

.recent-item {
    display: grid;
    /* 3 Columns: Teams (Flexible), Result/Pred (Fixed), Badge (Fixed) */
    grid-template-columns: 1fr 140px 120px;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
}

.recent-item:last-child {
    border-bottom: none;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    /* Capsule shape */
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    min-width: 80px;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Add dot indicators via CSS to avoid emojis */
.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.status-correct {
    background: rgba(16, 185, 129, 0.1);
    color: var(--neon-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-wrong {
    background: rgba(239, 68, 68, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 4rem;
    padding-bottom: 2rem;
    font-size: 0.9rem;
}

/* League Header (Collapsible) */
.league-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    /* Reduced from 2rem */
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
    border-bottom: 1px solid var(--bg-gradient-2);
    /* Subtle separator */
}

/* ... existing ... */

/* TABS SYSTEM */
.tab-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s;
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    /* Align with border-bottom of nav */
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.league-header:hover {
    opacity: 0.8;
}

.league-header h2 {
    margin: 0;
}

.league-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.league-content {
    transition: all 0.3s ease;
}

.league-content.collapsed {
    display: none;
}

.league-header.collapsed .league-toggle-icon {
    transform: rotate(-90deg);
}

/* Smart Filters */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    user-select: none;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Value Bet Badge (Top-Right Floating) */
.value-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}