/* 1. VARIABEL & RESET - TEMA UNGU MUDA DENGAN BACKGROUND PUTIH */
:root {
    --bg-body: #ffffff;
    --bg-card: #fff6f6;
    --primary-purple: #f11414;
    --accent-purple: #ff3c3c;
    --text-dark: #333333;
    --text-dim: #666666;
    --border-color: #f7e1e1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-dark);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow-x: hidden;
}

/* 3. NAVIGASI BARU dengan ikon custom - Garis ungu hanya saat aktif */
.main-navigation {
    background: rgba(248, 246, 255, 0.95);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(230, 22, 22, 0.288);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    height: 60px;
}

.nav-item {
    flex: 1;
    text-align: center;
    position: relative;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-purple);
    padding: 10px 5px;
    height: 60px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-purple);
    background: rgba(226, 43, 43, 0.08);
}

/* GARIS UNGU HANYA MUNCUL SAAT ACTIVE */
.nav-link.active {
    color: var(--primary-purple);
    background: rgba(226, 43, 43, 0.1);
    border-bottom: 3px solid var(--primary-purple);
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ikon khusus bola */
.fa-soccer-ball {
    color: #e22b2b;
    font-size: 20px;
}

/* Ikon khusus koran */
.fa-newspaper {
    color: #ee6060;
    font-size: 20px;
}

/* Ikon khusus telepon */
.fa-phone-alt {
    color: #e22b2b;
    font-size: 20px;
}

.nav-text {
    font-size: 14px;
    font-weight: 600;
}

/* 4. LAYOUT KONTEN */
.page-container {
    width: 100%;
    max-width: 1400px;
    padding: 25px 20px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    background-color: var(--bg-body);
}


/* .top-banners-grid, .bottom-banners-grid { */
    /* display: grid; */
    /* grid-template-columns: repeat(3, 1fr); */
    /* gap: 15px; */
    /* margin-bottom: 30px; */
/* } */

.banner-item {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 5. MAIN CONTENT & WIDGET */
.main-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin: 40px 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(226, 43, 43, 0.08);
    position: relative;
}

.status-bar {
    padding: 15px;
    background: rgba(226, 43, 43, 0.08);
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(226, 43, 43, 0.15);
}

.live-dot {
    width: 10px; height: 10px;
    background-color: var(--accent-purple);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.widget-container {
    min-height: 800px;
    position: relative;
    background-color: #fcfaff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

#ls-widget {
    background-color: #fcfaff !important;
}

.widget-loading {
    position: absolute;
    top: 200px; left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(226, 43, 43, 0.308);
    border-top: 4px solid var(--primary-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

/* 7. RESPONSIVE DESIGN */

/* DESKTOP BESAR - HEADER LEBIH BESAR */
@media (min-width: 769px) {
    .brand-header {
        padding: 15px 30px;
        min-height: 80px;
        justify-content: center;
        align-items: center;
    }

    .header-logo {
        width: 60px;
        height: 60px;
        margin-right: 15px;
        margin-bottom: 0;
    }

    .brand-name-text {
        font-size: 2rem;
        margin: 0;
    }

    .brand-tagline {
        font-size: 12px;
        letter-spacing: 1.2px;
        margin-top: 3px;
    }
}

/* TABLET & MOBILE (max-width: 768px) */
@media (max-width: 768px) {
    /* HEADER HORIZONTAL UNTUK MOBILE */
    .brand-header { 
        padding: 10px 15px;
        min-height: 60px;
        flex-direction: row; /* Logo di samping teks */
        justify-content: flex-start;
        align-items: center;
    }
    
    .header-logo { 
        width: 40px;
        height: 40px;
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .header-text-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .brand-name-text { 
        font-size: 1.4rem;
        margin: 0;
    }
    
    .brand-tagline {
        font-size: 9px;
        letter-spacing: 0.8px;
        margin-top: 2px;
    }
    
    /* Navigation Mobile */
    .main-navigation {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        background: rgba(248, 246, 255, 0.98);
        border-top: 2px solid var(--primary-purple);
        box-shadow: 0 -4px 12px rgba(226, 43, 43, 0.1);
    }
    
    .nav-menu {
        height: 70px;
    }
    
    .nav-link {
        height: 70px;
        padding: 8px 5px;
    }
    
    .nav-icon {
        font-size: 22px;
        margin-bottom: 5px;
    }
    
    .fa-soccer-ball, .fa-newspaper, .fa-phone-alt {
        font-size: 22px;
    }
    
    .nav-text {
        font-size: 12px;
    }
    
    /* WIDGET HAMPIR FULL WIDTH DI MOBILE */
    .page-container {
        padding: 10px 5px 90px !important;
        background-color: var(--bg-body);
    }
    
    /* .top-banners-grid, .bottom-banners-grid {  */
        /* grid-template-columns: repeat(2, 1fr);  */
        /* gap: 8px;  */
        /* padding: 0 5px; */
        /* margin-bottom: 20px; */
    /* } */

    .bottom-banners-grid .banner-item:last-child { 
        grid-column: span 2; 
    }
    
    /* Main content - hampir full width */
    .main-content {
        margin: 10px 0;
        padding: 12px 5px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(226, 43, 43, 0.05);
    }
    
    .status-bar {
        padding: 12px 10px;
        border-radius: 6px;
        margin-bottom: 15px;
        font-size: 16px;
    }
    
    /* Widget container hampir full width */
    .widget-container {
        min-height: 600px;
        margin: 0;
        padding: 0;
        width: 100%;
        border-radius: 0;
        overflow: hidden;
        background-color: #fcfaff;
    }
    
    /* Widget livescore hampir full width */
    #ls-widget {
        width: 98% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        background-color: #fcfaff !important;
        display: block !important;
    }
    
    /* Untuk memastikan nama tim terlihat di mobile */
    #ls-widget table,
    #ls-widget tbody,
    #ls-widget tr,
    #ls-widget td {
        max-width: 100% !important;
        font-size: 12px !important;
        white-space: normal !important;
    }
    
    /* Nama tim khusus untuk tampilan mobile */
    #ls-widget .team-name,
    #ls-widget .team,
    #ls-widget .participant-name {
        max-width: 100px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    
    /* Jika widget menggunakan iframe */
    #ls-widget iframe,
    #ls-widget > div {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background-color: #fcfaff !important;
        display: block !important;
        overflow: visible !important;
    }
    
    /* Bottom banners adjustment */
    .bottom-banners-grid {
        margin-top: 20px;
    }
    
    /* Jam dan tanggal */
    #current-time {
        font-size: 12px !important;
    }
    
    .live-dot {
        width: 8px;
        height: 8px;
    }
    
    /* Popup mobile */
    .popup-container {
        width: 95%;
        max-width: 400px;
    }
    
    .popup-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
}

/* PERANGKAT SANGAT KECIL (max-width: 480px) */
@media (max-width: 480px) {
    .brand-header {
        padding: 8px 12px;
        min-height: 55px;
    }
    
    .header-logo {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }
    
    .brand-name-text {
        font-size: 1.2rem;
    }
    
    .brand-tagline {
        font-size: 8px;
        letter-spacing: 0.6px;
    }
    
    .page-container {
        padding: 8px 3px 90px !important;
    }
    
    .main-content {
        padding: 10px 3px;
    }
    
    .status-bar {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    #current-time {
        font-size: 10px !important;
    }
    
    /* Nama tim lebih kecil untuk perangkat sangat kecil */
    #ls-widget .team-name,
    #ls-widget .team,
    #ls-widget .participant-name {
        max-width: 80px !important;
        font-size: 11px !important;
    }
    
    /* Popup sangat kecil */
    .popup-container {
        width: 90%;
    }
}

/* TABLET LANDSCAPE (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-text {
        font-size: 13px;
    }
    
    .nav-icon {
        font-size: 16px;
    }
}

/* DESKTOP KECIL (1025px - 1200px) */
@media (min-width: 1025px) and (max-width: 1200px) {
    .nav-container {
        padding: 0 15px;
    }
}