/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #0f172a;
    color: #f8fafc;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */
.navbar {
    background-color: #1e293b;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.logo span {
    color: #ef4444; /* Sports red */
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a:hover, 
.nav-links a.active {
    color: #ef4444;
}

.btn-login {
    background-color: #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: white !important;
    font-weight: bold;
}

.btn-login:hover {
    background-color: #dc2626;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 1)), 
                url('https://images.unsplash.com/photo-1540747913346-19e32dc3e97e?auto=format&fit=crop&w=1920&q=80') center/cover;
    height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary {
    background-color: #ef4444;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #dc2626;
}

/* ==========================================================================
   STREAMS SECTION & GRID
   ========================================================================== */
.streams-section {
    padding: 4rem 20px;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid #ef4444;
    padding-left: 10px;
}

.stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   STREAM CARD & THUMBNAIL (PERBAIKAN UTAMA TERTUTUP VS)
   ========================================================================== */
.stream-card {
    background-color: #1e293b;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.thumbnail {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Layout Logo Tim & Lingkaran VS */
.html-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 10px;
    z-index: 1; /* Prioritas rendah agar tertutup oleh overlay */
}

.team-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 38%;
}

.team-side img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 6px;
}

.team-abbr {
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: #f8fafc;
}

.vs-badge-circle {
    width: 36px;
    height: 36px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    z-index: 2; /* Di bawah overlay */
    flex-shrink: 0;
}

/* Badge Live / Upcoming */
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 3px;
    color: white;
    z-index: 10;
}

.live-badge {
    background-color: #ef4444;
    animation: pulse 2s infinite;
}

.upcoming-badge {
    background-color: #3b82f6;
}

/* OVERLAY TOMBOL (REVISI Z-INDEX & HOVER) */
.overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(15, 23, 42, 0.85); /* Kegelapan agar tombol menonjol */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20; /* 💡 KUNCI: Nilai lebih tinggi dari VS badge sehingga menutupi VS saat di-hover */
}

.stream-card:hover .overlay {
    opacity: 1;
}

.play-btn {
    background: #ef4444;
    color: #ffffff !important;
    padding: 0.6rem 1.4rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transition: background 0.2s, transform 0.2s;
    z-index: 21;
}

.play-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Stream Info Box */
.stream-info {
    padding: 1rem;
}

.category {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stream-info h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.tournament {
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* ==========================================================================
   COUNTDOWN TIMER & PLACEHOLDER
   ========================================================================== */
.thumbnail-placeholder {
    position: relative;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid #334155;
}

.timer-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.timer-text {
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #3b82f6;
    color: #f8fafc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.timer-text.is-starting {
    color: #ef4444;
    border-color: #ef4444;
    animation: pulse 2s infinite;
}

/* ==========================================================================
   WATCH PAGE
   ========================================================================== */
.watch-section {
    padding: 3rem 20px;
    max-width: 1000px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16/9;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #ef4444;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
    z-index: 10;
}

.match-details {
    margin-top: 2rem;
    background-color: #1e293b;
    padding: 2rem;
    border-radius: 8px;
}

.category-tag {
    background-color: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.match-details h1 {
    font-size: 2.2rem;
    margin: 1rem 0 0.5rem 0;
}

.tournament-name {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
}

.share-btn {
    background-color: transparent;
    color: #f8fafc;
    border: 1px solid #64748b;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.share-btn:hover {
    background-color: #334155;
    border-color: #f8fafc;
}

.import-section {
    background: #1e293b;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px dashed #3b82f6;
}

.import-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-success { 
    background: #10b981; 
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background-color: #0f172a;
    border-top: 1px solid #1e293b;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: white;
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 9999; /* Pastikan selalu berada di lapisan paling atas */
    padding: 10px; /* Memperbesar area sentuh jari */
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #f8fafc;
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .nav-container { 
        position: relative; 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
    }
    .navbar nav { 
        display: flex; 
        align-items: center; 
    }
    .menu-toggle { 
        display: flex !important; 
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; 
        left: 0; 
        width: 100%;
        background-color: #1e293b;
        flex-direction: column;
        align-items: center;
        padding: 20px 0; 
        gap: 15px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);
        z-index: 9990; /* Berada tepat di bawah tombol menu */
    }
    .nav-links.active { 
        display: flex; 
    }
    .btn-login { 
        width: 80%; 
        text-align: center; 
    }

    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero { height: auto; padding: 30px 20px 40px 20px; }
    .hero-content h1 { font-size: 1.8rem; line-height: 1.2; }
    .hero-content p { font-size: 0.95rem; padding: 0; }
    .section-title { font-size: 1.3rem; }
    .stream-grid { grid-template-columns: 1fr; }
    
    .footer .container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; flex-wrap: wrap; }
    
    .watch-section { padding: 1rem 10px; }
    .funnel-player-wrapper { aspect-ratio: 16/9; max-height: 250px; }
    
    .cta-overlay { padding: 15px 10px; justify-content: center; align-items: center; }
    .cta-title { font-size: 1.1rem !important; margin-bottom: 5px; }
    .cta-desc { font-size: 0.75rem !important; max-width: 98% !important; margin-bottom: 10px !important; line-height: 1.3; }
    
    .btn-affiliate { 
        font-size: 0.75rem !important; 
        padding: 10px 15px !important; 
        width: 95% !important; 
        text-align: center; 
        box-sizing: border-box;
        white-space: normal; 
        line-height: 1.3;
    }

    .match-details { padding: 1rem !important; margin-top: 1rem; }
    .match-title { font-size: 1.2rem !important; line-height: 1.3; margin: 8px 0 !important; }
    .category-tag { font-size: 0.65rem !important; padding: 3px 8px !important; }
    .match-details p { font-size: 0.8rem !important; margin-bottom: 5px !important; }
    .tournament-name { font-size: 0.8rem !important; }
    
    .match-meta { flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 1rem; }
    .share-btn { width: 100%; text-align: center; }
}

@media (max-width: 480px) {
    .cta-title { font-size: 1rem !important; }
    .cta-desc { font-size: 0.7rem !important; margin-bottom: 8px !important; }
    .btn-affiliate { font-size: 0.7rem !important; padding: 8px 10px !important; width: 100% !important; }
    .match-title { font-size: 1.1rem !important; }
    .match-details p { font-size: 0.75rem !important; }
    .funnel-player-wrapper { max-height: 220px; }
    
    .team-side img { width: 40px; height: 40px; }
    .vs-badge-circle { width: 30px; height: 30px; font-size: 0.75rem; }
    .team-abbr { font-size: 0.75rem !important; }
}