/* Ultra Lightweight CSS - Sederhana tapi Modern */
html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: white;
    font-family: 'Teko', sans-serif;
}

#main-content {
    display: flex;
    width: 100%;
    height: 100%;
}

.video-container {
    flex: 1;
    background-color: #000;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.video-wrapper iframe,
.video-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    display: none;
}

/* ===== CHANNEL CARD - Simple but Modern ===== */
.channel-container {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.95);
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 2px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

.channel-container:hover,
.channel-container.selected {
    background: rgba(20, 30, 55, 0.95);
}

.logo-container {
    flex-shrink: 0;
    width: 80px;
    height: 55px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.logo {
    max-width: 100%;
    max-height: 100%;
}

.info-container {
    margin-left: 10px;
}

.channel-name {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.status {
    margin: 0;
    font-size: 14px;
    color: #f87171;
}

.countdown-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
}

.countdown-title {
    margin-bottom: 10px;
}

.sidebar {
    flex: 0 0 400px;
    background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ========== 🔥 MENU TOP - KATEGORI HORIZONTAL SCROLL ========== */
.menu-wrapper-top {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    padding: 0;
    border-bottom: 1px solid rgb(255 0 113);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.category-scroll-container {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 100%;
}

/* Live Event Button - FREEZE di kiri dengan LEBAR SAMA */
.category-freeze {
    flex: 0 0 auto;
    width: 120px;
    box-sizing: border-box;
    background: transparent;
    color: white;
    border: none;
    padding: 10px 8px;
    font-family: 'Teko', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.category-freeze:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-freeze.active {
    background: rgba(255, 255, 255, 0.15);
}

.category-freeze::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.2s ease;
}

.category-freeze.active::after {
    width: 70%;
}

.live-indicator {
    font-size: 8px;
    color: #ff0545;
    animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ========== 🔥 ARROW BUTTONS (Tidak ikut scroll) ========== */
.fas {
    font-weight: 900 !important;
    display: inline-block;
}

.category-arrow-btn {
    flex: 0 0 auto;
    width: 40px;
    background: rgb(14 23 42);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.category-arrow-btn:hover {
    background: rgba(20, 30, 55, 0.95);
}

.category-arrow-btn:active {
    transform: scale(0.95);
}

.category-arrow-btn.arrow-left {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
}

/* Hide arrows if not needed */
.category-arrow-btn.hidden {
    display: none;
}

/* Scroll Wrapper - Area yang bisa di-scroll TANPA SCROLLBAR */
.category-scroll-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    display: flex;
    
    /* Hide scrollbar - ALL BROWSERS */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Hide scrollbar completely */
.category-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.category-scroll-wrapper {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Container untuk button kategori */
.category-buttons-container {
    display: flex;
    gap: 0;
    min-width: 100%;
    flex: 1;
}

/* Category Button - FLEX BAGI RATA */
.category-button {
    flex: 1;
    min-width: 120px;
    background: transparent;
    color: rgba(255, 255, 255, 0.95);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 8px;
    font-family: 'Teko', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.category-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transition: width 0.2s ease;
}

.category-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-button:hover::after {
    width: 70%;
}

.category-button.active {
    background: rgba(255, 255, 255, 0.15);
}

.category-button.active::after {
    width: 70%;
}

/* ========== 🔥 MENU BOTTOM - UPDATED 4 BUTTONS ========== */
.menu-wrapper-bottom {
    position: sticky;
    bottom: 0;
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-wrapper-bottom .menu-container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
}

.menu-wrapper-bottom .menu-button {
    flex: 1; /* Equal width */
    text-align: center;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.3);
    font-family: 'Teko', sans-serif;
    font-size: 14px;
}

.menu-wrapper-bottom .menu-button:first-child {
    border-left: none;
}

.menu-wrapper-bottom .menu-button i {
    margin-right: 6px;
    font-size: 16px;
}

/* Multi View Button - Biru */
.menu-wrapper-bottom .multiview-button {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}

.menu-wrapper-bottom .multiview-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

/* Android TV Button - Hijau */
.menu-wrapper-bottom .androidtv-button {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

/* Chat Button - Ungu */
.menu-wrapper-bottom .chat-button {
    background: linear-gradient(135deg, #6b21a8 0%, #7c3aed 100%);
}

/* Saweria Button - Orange */
.menu-wrapper-bottom .saweria-button {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
}

.menu-wrapper-bottom .saweria-button:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.menu-container {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
}

.sidebar-content {
    flex-grow: 1;
    padding: 2px;
    display: none;
    overflow-y: auto;
    background:
        repeating-linear-gradient(45deg, #0000 calc(-650%/13) calc(50%/13), #0f1129 0 calc(100%/13),
            #0000 0 calc(150%/13), #0f1129 0 calc(200%/13),
            #0000 0 calc(250%/13), #0f1129 0 calc(300%/13)), repeating-linear-gradient(45deg, #0000 calc(-650%/13) calc(50%/13), #0f1129 0 calc(100%/13),
            #0000 0 calc(150%/13), #0f1129 0 calc(200%/13),
            #0000 0 calc(250%/13), #0f1129 0 calc(300%/13)) 32px 32px,
        repeating-linear-gradient(-45deg, #0000 calc(-650%/13) calc(50%/13), #0f1129 0 calc(100%/13),
            #0000 0 calc(150%/13), #0f1129 0 calc(200%/13),
            #0000 0 calc(250%/13), #0f1129 0 calc(300%/13)), repeating-linear-gradient(-45deg, #0000 calc(-650%/13) calc(50%/13), #0f1129 0 calc(100%/13),
            #0000 0 calc(150%/13), #0f1129 0 calc(200%/13),
            #0000 0 calc(250%/13), #0f1129 0 calc(300%/13)) 32px 32px #0f172a;
    background-size: 64px 64px;
}

.sidebar-content.active {
    display: block;
}

/* ===== EVENT CARD - Simple but Modern ===== */
.event-container {
    position: relative;
    background: rgba(15, 23, 42, 0.95);
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    border: 1px solid rgb(0 222 255 / 35%);
}

.event-container:hover,
.event-container.hover-effect {
    background: rgba(20, 30, 55, 0.95);
}

/* ===== NO LIVE EVENT MESSAGE ===== */
.no-live-message {
    background: rgba(15, 23, 42, 0.95);
    padding: 20px;
    border-radius: 4px;
    margin: 10px 2px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    text-align: center;
}

.no-live-message i {
    font-size: 48px;
    color: rgba(239, 68, 68, 0.6);
    margin-bottom: 15px;
}

.no-live-message h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.no-live-message p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.live-label {
    display: none;
    position: absolute;
    top: 0px;
    right: 0px;
    background: #ff0545;
    color: white;
    padding: 3px 15px 3px 15px;
    font-size: 0.75em;
    border-radius: 0 5px 1px 10px;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* ===== SERVER BUTTONS ===== */
.server-buttons {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    margin-top: 10px;
    background: rgba(15, 23, 42, 0.7);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.server-buttons .buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.server-button {
    background: rgba(15, 23, 42, 0.6);
    padding: 5px 10px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 80px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.server-button.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.6);
}

.server-button:hover {
    background: rgba(29, 78, 216, 0.5);
    border-color: rgba(59, 130, 246, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.instruction {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    text-align: left;
    width: 100%;
}

h2 {
    font-size: 0.9em;
    margin-top: 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    display: flex;
    align-items: center;
}

.league-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 180px;
}

.sport-icon {
    width: 24px;
    height: auto;
    margin-right: 10px;
}

.team {
    display: flex;
    align-items: center;
}

.team-logo {
    width: 24px;
    height: auto;
    margin-right: 10px;
}

.kickoff-match-time {
    text-align: right;
    padding-right: 10px;
    font-size: 0.8em;
}

.kickoff-match-date {
    text-align: right;
    padding-right: 10px;
    font-size: 0.8em;
}

.chat-iframe {
    width: 100%;
    height: 98%;
    border: none;
    overflow: hidden;
}

.event-container .team-logo1,
.event-container .team-logo2 {
    width: 24px;
    height: auto;
    margin-right: 10px;
}

.event-container .team-logo2 {
    background-color: #ffff0000;
}

.event-container .team1,
.event-container .team2 {
    display: flex;
    align-items: center;
}

.event-container .team2 {
    color: #ffff0000;
}

.event-container .team2:hover {
    color: #ffff0000;
}

/* ========== 🔍 SEARCH BAR STYLES ========== */
.search-wrapper {
    padding: 2px;
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.search-container {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: rgb(251 251 251);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 8px 35px 8px 35px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: white;
    font-family: 'Teko', sans-serif;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.search-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
    font-size: 14px;
}

.search-input:focus {
    border-color: rgba(59, 130, 246, 0.8);
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    font-size: 12px;
}

.clear-search-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.05);
}

.search-input:not(:placeholder-shown) ~ .clear-search-btn {
    display: block;
}

.search-result-count {
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 13px;
    color: rgba(148, 163, 184, 0.9);
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
    text-align: center;
    display: none;
}

@keyframes fadeInSearch {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-count[style*="display: block"] {
    animation: fadeInSearch 0.3s ease;
}

.event-container.search-highlight {
    animation: searchPulse 0.5s ease;
}

@keyframes searchPulse {
    0%, 100% {
        border-color: rgba(59, 130, 246, 0.3);
    }
    50% {
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }
}

/* ===== MULTIVIEW MODAL - Simple Version ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container-modern {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 4px;
    padding: 0;
    max-width: 700px;
    width: 90%;
    animation: slideUp 0.2s ease;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes slideUp {
    from { 
        transform: translateY(30px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header-modern {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-modern h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.modal-close-btn-modern {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 300;
}

.modal-close-btn-modern:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

.modal-body-modern {
    padding: 30px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
}

.grid-option-modern {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.grid-option-modern:hover {
    background: rgba(29, 78, 216, 0.3);
    transform: translateY(-5px);
}

.grid-option-modern:active {
    transform: translateY(-2px);
}

.grid-preview-modern {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    padding: 12px;
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 80px;
}

.grid-preview-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.grid-preview-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.grid-preview-6 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.grid-preview-8 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.grid-box-modern {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-radius: 2px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.grid-label-modern {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.grid-subtitle-modern {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* ========== 📱 MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    #main-content {
        flex-direction: column;
        display: flex;
        height: 100vh;
    }

    .video-container {
        width: 100%;
        position: relative;
        padding-top: 56.25%;
    }

    .video-wrapper {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }

    .sidebar {
        width: 100%;
        padding: 2px;
        box-sizing: border-box;
        overflow-y: auto;
        flex-shrink: 0;
        flex-grow: 1;
        min-height: calc(100vh - 56.25vw);
    }

    .chat-iframe {
        height: 63vh;
        border: none;
    }

    .countdown-wrapper {
        font-size: 20px;
    }

    #spacer {
        height: 140px;
        width: 100%;
        background: transparent;
    }

    .menu-wrapper-bottom {
        position: fixed;
        bottom: env(safe-area-inset-bottom);
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        padding-bottom: calc(0px + env(safe-area-inset-bottom));
    }
    
    /* Mobile - Category buttons smaller */
    .category-freeze {
        width: 120px;
        font-size: 13px;
        padding: 8px 6px;
    }
    
    .category-button {
        width: 120px;
        font-size: 13px;
        padding: 8px 6px;
    }
    
    /* Arrow buttons mobile */
    .category-arrow-btn {
        width: 35px;
        font-size: 12px;
    }
    
    /* Hide scrollbar di mobile juga */
    .category-scroll-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .live-indicator {
        font-size: 7px;
    }
    
    /* Mobile - Menu bottom */
    .menu-wrapper-bottom .menu-button {
        padding: 10px 0;
        font-size: 12px;
    }
    
    .menu-wrapper-bottom .menu-button i {
        font-size: 14px;
        margin-right: 4px;
    }
    
    /* Mobile - Search */
    .search-wrapper {
        padding: 2px;
    }
    
    .search-input {
        padding: 7px 30px 7px 30px;
        font-size: 14px;
    }
    
    .search-icon {
        font-size: 13px;
        left: 10px;
    }
    
    .clear-search-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .search-result-count {
        font-size: 12px;
        margin-top: 5px;
    }
    
    /* Mobile - Modal */
    .modal-container-modern {
        max-width: 95%;
        width: 95%;
    }
    
    .modal-body-modern {
        grid-template-columns: repeat(2, 1fr);
        padding: 20px 15px;
        gap: 15px;
    }
    
    .grid-option-modern {
        padding: 15px 10px;
    }
    
    .grid-preview-modern {
        min-height: 60px;
        padding: 8px;
        gap: 4px;
    }
    
    .grid-label-modern {
        font-size: 14px;
    }
    
    .grid-subtitle-modern {
        font-size: 10px;
    }
}