/* --- Import Font --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700;800&display=swap');

/* --- Global & Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: #f8fafc; color: #1e293b; line-height: 1.6; padding-bottom: 40px; overflow-x: hidden; }

/* --- Margin Helpers --- */
.mt-20 { margin-top: 20px; }
.mb-40 { margin-bottom: 40px; }

/* --- Splash Screen --- */
#splash-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background-color: #002147; display: flex; justify-content: center; align-items: center;
    z-index: 9999; transition: opacity 0.8s ease, visibility 0.8s ease;
}
.splash-logo-img { width: 180px; animation: popFadeIn 1.2s ease-out forwards; }
@keyframes popFadeIn { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } }

/* --- ANIMASI HEADER BERGERAK --- */
@keyframes gradientShine { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
header { 
    background: linear-gradient(45deg, #002147, #1e3a8a, #001122, #002147); 
    background-size: 300% 300%;
    animation: gradientShine 8s ease infinite;
    color: white; padding: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}
.header-logo { height: 45px; width: auto; justify-self: start; }
.header-title { justify-self: center; text-align: center; }
.header-title h1 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.header-slogan { justify-self: end; font-size: 12px; color: #FFD13D; font-weight: 600; text-transform: uppercase; }

/* --- RUNNING TEXT (ANIMASI MODERN) --- */
#running-text-bar {
    background-color: #e74c3c;
    color: white;
    padding: 10px 0; /* Lebih Padat */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}
#running-text-bar .marquee-text {
    display: inline-block;
    font-size: 15px; /* Lebih Besar */
    font-weight: 800; /* Lebih Tebal */
    letter-spacing: 1px;
    padding-left: 100%;
    animation: scroll-left 25s linear infinite;
}

#running-recap-bar {
    background-color: #FFD13D; /* Warna Kuning PORTEK */
    color: #002147; /* Warna Biru Kode Kita */
    padding: 10px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    border-bottom: 2px solid #e2e8f0;
}
#running-recap-bar .marquee-text {
    display: inline-block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    padding-left: 100%;
    animation: scroll-left 35s linear infinite; /* Sedikit lebih lambat karena rekap biasanya panjang */
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- TATA LETAK MATCH GRID --- */
.live-container-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
    width: 100%;
}

/* --- Main Layout & Cards --- */
main { padding: 40px 20px; max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 0px; }
.live-card, .data-section { background: white; border-radius: 24px; padding: 20px 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.live-card:hover, .data-section:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

/* --- SCOREBOARD & ANIMASI LIVE --- */
.live-badge { background-color: #f1f5f9; padding: 8px 15px; border-radius: 20px; font-size: 11px; font-weight: 800; color: #333; display: inline-flex; align-items: center; margin-bottom: 20px; justify-content: center; width: 100%; }
.live-badge.is-live { background-color: rgba(231, 76, 60, 0.1); color: #e74c3c; border: 1px solid rgba(231, 76, 60, 0.3); }
.badge-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.indicator-standby { background-color: #94a3b8; animation: pulse-standby 1.5s infinite alternate; }
.indicator-live { background-color: #e74c3c; animation: blink-live 0.8s infinite alternate; }

@keyframes pulse-standby { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 6px #94a3b8; } }
@keyframes blink-live { 0% { opacity: 1; box-shadow: 0 0 10px #e74c3c; } 100% { opacity: 0.3; box-shadow: 0 0 2px #e74c3c; } }

/* EFEK ANIMASI SKOR BERKEDIP (GOAL PULSE) */
.score-pulse {
    animation: goalPulse 1s ease-out;
    color: #27ae60 !important; /* Berubah hijau sesaat saat gol */
}
@keyframes goalPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.score-board { display: flex; justify-content: center; align-items: flex-start; text-align: center; margin-top: 5px; }
.team { flex: 1; overflow: hidden; }
.team h2 { font-size: 16px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score { font-size: 48px; font-weight: 800; color: #002147; margin: 5px 0; line-height: 1; transition: all 0.3s ease; }
.vs { font-size: 18px; font-weight: 800; color: #94a3b8; padding: 0 10px; margin-top: 30px; }
.match-events { font-size: 11px; color: #64748b; margin-top: 10px; text-align: left; background: #f8fafc; padding: 5px; border-radius: 8px; max-height: 80px; overflow-y: auto; }

/* --- Navigasi Tab --- */
.sports-tabs { display: flex; overflow-x: auto; gap: 12px; padding: 10px 0; scrollbar-width: none; z-index: 1000; -webkit-overflow-scrolling: touch; }
.sports-tabs::-webkit-scrollbar { display: none; }
.tab-btn { padding: 12px 24px; border: none; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; white-space: nowrap; }
.tab-btn.active { background: #002147; color: white; border-color: #002147; }

/* --- DESAIN KLASEMEN GRUP & REKAP --- */
.group-header { background: #f1f5f9; padding: 10px 15px; border-radius: 8px; font-size: 14px; font-weight: 800; color: #002147; margin-top: 20px; border-left: 4px solid #3498db; }
.recap-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.recap-item strong { color: #002147; font-size: 16px; }
.recap-grup { font-size: 10px; background: #e2e8f0; padding: 3px 8px; border-radius: 10px; color: #64748b; font-weight: bold; text-transform: uppercase;}

table { width: 100%; border-collapse: collapse; margin-top: 5px; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; padding: 12px 5px; border-bottom: 2px solid #f8fafc; text-align: center;}
th:first-child { text-align: left; }
td { padding: 15px 5px; border-bottom: 1px solid #f1f5f9; text-align: center; font-size: 14px;}
td:first-child { text-align: left; font-weight: 600; }

.rank-gold { background-color: rgba(255, 209, 61, 0.15); font-weight: bold; color: #b8860b; }
.rank-silver { background-color: rgba(226, 232, 240, 0.5); font-weight: bold; color: #64748b; }

/* --- DISCLAIMER & ABOUT US --- */
.disclaimer-text { font-size: 11px; color: #e74c3c; text-align: center; margin-top: 20px; font-style: italic; background: rgba(231, 76, 60, 0.05); padding: 12px; border-radius: 8px; border: 1px dashed rgba(231, 76, 60, 0.3); }
.about-box { background: #f8fafc; padding: 20px; border-radius: 12px; margin-top: 15px; border: 1px solid #e2e8f0; border-left: 4px solid #002147; }
.about-box h4 { color: #002147; margin-bottom: 8px; font-size: 15px; font-weight: 800; }
.about-box p { font-size: 13px; color: #475569; text-align: justify; line-height: 1.6; }

.ai-insight-card { background: linear-gradient(135deg, #002147, #1e3a8a); color: white; padding: 25px; border-radius: 20px; display: flex; gap: 15px; align-items: center; box-shadow: 0 8px 16px rgba(0,33,71,0.2); }
footer { background-color: #0f172a; color: #94a3b8; padding: 30px 20px; margin-top: 60px; display: flex; justify-content: space-between; align-items: center; }
.footer-logo { height: 40px; width: auto; opacity: 0.8; }

/* =======================================================
   📱 ADAPTIVE RESPONSIVENESS (LAPTOP, TABLET, MOBILE)
   ======================================================= */
.table-container { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; border-radius: 8px; }

@media (max-width: 1024px) {
    main { max-width: 95%; padding: 30px 15px; }
}

@media (max-width: 768px) {
    header { flex-direction: column; text-align: center; padding: 15px; gap: 8px; }
    .header-logo { height: 55px; }
    footer { flex-direction: column; text-align: center; gap: 15px; padding: 25px 15px; }
    
    main { padding: 15px 10px; width: 100%; }
    
    /* Grid Multi-Slot di HP akan berubah menjadi kolom ke bawah otomatis */
    .live-container-grid { grid-template-columns: 1fr; }
    
    .live-card, .data-section { padding: 20px 15px; border-radius: 16px; }
    
    .score-board { padding: 10px 0; align-items: center; }
    .score { font-size: 36px !important; margin: 10px 0; }
    .team h2 { font-size: 15px; }
    .vs { font-size: 16px; margin-top: 25px; padding: 0 10px; }
    
    .sports-tabs { flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; }
    .tab-btn { flex: 1 1 30%; font-size: 12px; padding: 10px 5px; text-align: center; }
    
    .data-section > div[style*="display: flex; justify-content: space-between"] { 
        flex-direction: column !important; align-items: flex-start !important; gap: 15px; 
    }
    #topscorer-filter { width: 100%; font-size: 14px; padding: 10px; }

    .recap-item { flex-direction: column; align-items: flex-start; gap: 15px; }
    .recap-item > div:last-child { align-self: flex-start; width: 100%; text-align: center; font-size: 20px !important; }

    .admin-container { margin: 15px 5px; padding: 0; }
    .control-panel { padding: 20px 15px; border-radius: 16px; margin-bottom: 20px; }
    .input-field { font-size: 13px; padding: 12px; }
    
    div[style*="display: flex; gap: 10px"] { flex-direction: column; gap: 0 !important; }
    div[style*="display: flex; gap: 10px"] > input, 
    div[style*="display: flex; gap: 10px"] > select { 
        width: 100% !important; margin-bottom: 12px !important; 
    }
    
    .score-control { flex-direction: row !important; }
    .score-control .team-admin { width: 45% !important; }

    #login-overlay input, #login-overlay button { width: 90% !important; max-width: 320px; }
    #login-overlay div { max-width: 90% !important; }
}