:root {
    /* Color Palette */
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #22d3ee;
    --secondary: #818cf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --live: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --container-width: 1200px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.9) 100%),
        url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo h1 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    color: var(--primary);
}

.filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-dark);
    font-weight: 600;
}

/* Hero Section */
.hero {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
}

.badge {
    display: inline-block;
    background: rgba(34, 211, 238, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    font-size: 0.875rem;
    padding: 0 1rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
}

/* Match Grid */
.match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.match-card {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.match-card:hover {
    transform: translateY(-5px);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: var(--shadow-lg);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.league-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-live {
    color: var(--live);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-live::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.team-logo {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--secondary);
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
}

.team-name {
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.25;
    height: 2.5rem; /* Fixed height for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.match-score {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    min-width: 80px;
    justify-content: center;
    line-height: 1;
}

.score-divider {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.match-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.loader {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.live-score {
    color: var(--live);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-content {
    background: #1e293b;
    margin: 5% auto;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--glass-border);
    width: 95%;
    max-width: 700px;
    border-radius: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    color: var(--text-muted);
    font-size: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-main);
}

/* Stats Layout */
.stats-header {
    text-align: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-name {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.stat-bar-container {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}

.stat-bar-home {
    height: 100%;
    background: linear-gradient(to right, var(--secondary), #4f46e5);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-bar-away {
    height: 100%;
    background: linear-gradient(to left, var(--primary), #0891b2);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scorers {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.scorers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.team-scorers h4 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.scorer-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.team-logo.home {
    background: linear-gradient(135deg, var(--secondary), #4f46e5);
}

.team-logo.away {
    background: linear-gradient(135deg, var(--primary), #0891b2);
}

.hidden { display: none; }

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.toggle-btn:hover {
    border-color: var(--primary);
}

.toggle-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

/* Standings Table */
.standings-container {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    margin: 2rem 0 4rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.standings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.standings-header h3 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.series-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.series-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.series-btn.active {
    background: var(--bg-dark);
    color: var(--primary);
}

@media (max-width: 480px) {
    .series-toggle {
        width: 100%;
    }
    .series-btn {
        flex: 1;
        padding: 0.5rem;
    }
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px;
}

th {
    text-align: left;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.rank-cell {
    width: 50px;
    font-weight: 700;
    color: var(--text-muted);
}

.libertadores { border-left: 4px solid #10b981; }
.pre-libertadores { border-left: 4px solid #34d399; }
.sul-americana { border-left: 4px solid #3b82f6; }
.rebaixamento { border-left: 4px solid #ef4444; }

.team-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
}

.team-mini-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.points-cell {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.stat-cell {
    text-align: center;
    color: var(--text-muted);
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar .container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .logo {
        justify-content: center;
        margin-bottom: 0.25rem;
    }

    .filters {
        padding-left: 0.5rem;
    }

    .user-actions {
        display: none; /* Hide notification bell on small mobile to save space */
    }
    
    .hero {
        padding: 1.5rem 0 1rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }
    
    .match-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem 4rem;
        gap: 1rem;
    }

    .match-card {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .team-logo {
        width: 44px;
        height: 44px;
    }

    .match-score {
        font-size: 1.5rem;
        min-width: 60px;
    }

    .standings-container {
        padding: 1rem;
        border-radius: 1.25rem;
        margin: 1rem 0 2rem;
    }

    .standings-header {
        flex-direction: column;
        text-align: center;
    }

    .view-toggle {
        gap: 0.5rem;
        padding: 1rem 0.5rem;
        overflow-x: auto;
        justify-content: flex-start;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .view-toggle::-webkit-scrollbar {
        display: none;
    }

    .toggle-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .modal-content {
        padding: 1.5rem 1rem;
        display: flex;
        flex-direction: column;
    }

    .scorers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stats-header h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 400px) {
    .team-name {
        font-size: 0.75rem;
    }
    
    .match-score {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
}

/* Schedule Styles */
.match-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 80px;
}

.match-vs span {
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(34, 211, 238, 0.15);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
}

.vs-time {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.scheduled-card {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.1);
}
