/* ================================================================
   🎨 PREMIUM UI THEME - VARIABEL & RESET (SOFASCORE / FLASHSCORE STYLE)
   ================================================================ */
:root {
    /* Palet Warna Gelap Premium & Glass Effect */
    --body-bg: #0b0f19;
    --header-bg: rgba(15, 23, 42, 0.8);
    --card-bg: rgba(30, 41, 59, 0.7);
    --input-bg: #1e293b;
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Font & Tipografi Modern */
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-heading: 'Poppins', sans-serif;

    /* Gradasi Warna Premium (FIFA Mobile / OneFootball Style) */
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Hijau Lapangan */
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);  /* Emas Champion */
    --gradient-dark: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    
    /* Aksen Solid */
    --primary-light: #22c55e;
    --accent-light: #eab308;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Struktur UI & Animasi */
    --radius: 14px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 40%);
    background-attachment: fixed;
}

/* ================================================================
   📱 NAVIGATION & HEADER (GLASSMORPHISM STYLE)
   ================================================================ */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1.2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-title small {
    display: block;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-top: 0.1rem;
}

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

.tahun-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--primary-light);
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-download {
    background: var(--gradient-accent);
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0b0f19;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

/* ================================================================
   🗂️ SIDEBAR MENU DESIGN
   ================================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    background: #0f172a;
    border-right: 1px solid var(--border-color);
    z-index: 200;
    padding: 2rem 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-close {
    background: rgba(255,255,255,0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0 1.5rem 0;
}

.sidebar-title small {
    display: block;
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav a:hover, .sidebar-nav a.aktif {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav a.tahun-link {
    border-left: 3px solid transparent;
}

.sidebar-nav a.tahun-link.aktif {
    border-left-color: var(--primary-light);
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary-light);
    font-weight: 600;
}

.sidebar-nav .label-tahun {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.6;
    padding: 0.8rem 1rem 0.2rem 1rem;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.5;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ================================================================
   🧱 CONTENT STRUCTURE & CONTAINER
   ================================================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

section {
    margin-bottom: 1.75rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ================================================================
   ⚽ MATCHES CARD UI (FLASHSCORE & ONEFOOTBALL STYLE)
   ================================================================ */
.match-day {
    background: var(--card-bg);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.match-day:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-glow);
}

.match-day-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1.2rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border-color);
}

.match-day-header .hari {
    font-weight: 500;
    color: var(--primary-light);
    margin-left: auto;
    font-size: 0.8rem;
    background: rgba(34, 197, 94, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap; /* 🔥 FIX: Memaksa teks tetap satu baris lurus */
}

.match-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    transition: background 0.2s;
}

.match-item:last-child {
    border-bottom: none;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.01);
}

.match-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    text-align: center;
}

.match-group {
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.match-teams .team {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-teams .team:first-child {
    text-align: right;
    flex: 1;
}

.match-teams .team:last-child {
    text-align: left;
    flex: 1;
}

.match-teams .score {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #0f172a;
    background: var(--gradient-accent);
    padding: 0.2rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 54px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.match-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ================================================================
   🏆 LEAGUE STANDINGS TABLE UI (SOFASCORE STYLE)
   ================================================================ */
.table-wrap {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.table-wrap table {
    width: 100%;
    min-width: 550px;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-wrap th {
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.table-wrap td {
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.table-wrap tr:hover td {
    background: rgba(255,255,255,0.01);
}

.table-wrap .team-nama {
    text-align: left;
    font-weight: 600;
    padding-left: 0.75rem;
    color: var(--text-primary);
}

.table-wrap .poin {
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(34, 197, 94, 0.05);
}

.table-wrap .gd-positif {
    color: var(--primary-light);
    font-weight: 600;
}

.table-wrap .gd-negatif {
    color: #ef4444;
    font-weight: 600;
}

/* ================================================================
   📊 MODERN ACCORDION UI (SOFASCORE & FLASHSCORE COOPERATIVE)
   ================================================================ */
.accordion {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.accordion-item {
    background: var(--card-bg);
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.accordion-item:hover {
    border-color: rgba(255,255,255,0.15);
}

.accordion-header {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255,255,255,0.01);
    color: var(--text-primary);
    border: none;
    transition: var(--transition);
}

.accordion-header:hover {
    background: rgba(255,255,255,0.03);
}

.accordion-header .arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.accordion-header.open {
    border-bottom: 1px solid var(--border-color);
    background: rgba(16, 185, 129, 0.03);
}

.accordion-header.open .arrow {
    transform: rotate(180deg);
    color: var(--primary-light);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0 1.2rem;
    background: rgba(15, 23, 42, 0.2);
}

.accordion-body.open {
    max-height: 1500px;
    padding: 0.5rem 0.75rem;
}

.accordion-body .table-wrap {
    border: none;
    box-shadow: none;
    background: transparent;
}

.accordion-body .table-wrap th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

/* ================================================================
   ⏳ LOADING SPINNER & EMPTY STATE UTILITIES
   ================================================================ */
.empty-state {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================================================
   🏁 FOOTER AREA
   ================================================================ */
.footer {
    margin-top: 4rem;
    padding: 1.5rem;
    background: var(--gradient-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

/* ================================================================
   📱 MOBILE FIRST & RESPONSIVE LAYOUT OPTIMIZATION
   ================================================================ */
@media (max-width: 640px) {
    .match-item {
        display: grid;
        grid-template-columns: 1fr; /* Menggunakan 1 kolom penuh agar susunan turun ke bawah */
        gap: 0.75rem;
        padding: 1rem 1.2rem;
    }

    /* Baris Atas: Info Waktu (Kiri) dan Nama Grup (Kanan) */
    .match-time {
        grid-row: 1;
        justify-self: flex-start;
        font-size: 0.8rem;
    }

    .match-group {
        grid-row: 1;
        justify-self: flex-end;
        margin-top: 0;
        /* 🔥 FIX: Menghapus position absolute agar tidak menimpa nama tim di bawahnya */
    }

    /* Baris Bawah: Susunan Tim Kiri - Skor Tengah - Tim Kanan */
    .match-teams {
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
    }

    .match-teams .team {
        font-size: 0.9rem;
        flex: 1;
    }
    
    .match-teams .team:first-child { 
        text-align: left; 
    }
    
    .match-teams .team:last-child { 
        text-align: right; 
    }

    .match-teams .score {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
        min-width: 48px;
        flex-shrink: 0;
    }

    .match-status {
        display: none;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    .header {
        padding: 1rem 2rem;
    }
    .header-title {
        font-size: 1.3rem;
    }
    .header-title small {
        font-size: 0.75rem;
    }
}
