/* style.css v55 - Premium Unified Dark (Ultimate Vita & Mobile) */

* { 
    -webkit-box-sizing: border-box; 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    outline: none; 
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background-color: #060913;
    color: #f8fafc; 
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden; 
    -webkit-user-select: none;
    user-select: none;
}

/* --- NAVIGATION --- */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background-color: #0b0f1a;
    border-bottom: 2px solid #1e293b;
    line-height: 60px; padding: 0 20px; z-index: 2000;
}
.nav-logo { 
    float: left; font-size: 20px; font-weight: 800; color: #ffffff; 
    letter-spacing: -1px; 
}
.nav-logo span { color: #3b82f6; text-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }
.nav-logo::after { content: ' TV'; font-size: 14px; opacity: 0.5; font-weight: 300; }

/* --- SPLIT PANEL --- */
.split-layout {
    position: absolute; top: 60px; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    background-color: #060913;
}

/* --- RIGHT PANEL (PLAYER - Swapped in HTML to be on top) --- */
.right-pane {
    position: absolute; top: 0; left: 300px; right: 0; bottom: 0;
    background-color: #000; overflow: hidden; z-index: 1000;
}

.hero-section { width: 100%; height: -webkit-calc(100% - 65px); height: calc(100% - 65px); background-color: #000; position: relative; }
.player-wrapper { width: 100%; height: 100%; position: relative; }
#video-player { width: 100%; height: 100%; -webkit-object-fit: contain; object-fit: contain; background-color: #000; }

#player-overlay {
    position: absolute; top: 0; left: 0; width: 100%; padding: 20px;
    background: -webkit-linear-gradient(top, rgba(0,0,0,0.85), transparent);
    background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent); 
    pointer-events: none; z-index: 10;
}
#channel-name { font-size: 22px; font-weight: 800; color: #ffffff; margin: 0; text-shadow: 0 0 15px rgba(0,0,0,0.8); }
#status-text { font-size: 11px; color: #3b82f6; font-weight: 800; text-transform: uppercase; margin-top: 5px; letter-spacing: 1px; }

/* --- SYNC BAR --- */
.sync-row {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 65px;
    background-color: #0b0f1a; border-top: 1px solid #1e293b;
    padding: 12px 20px; z-index: 2000;
}
.sync-input-wrapper { float: left; width: 80%; }
.sync-input-wrapper input { 
    width: 100%; height: 40px; border: none; font-size: 13px; 
    color: #94a3b8; background-color: transparent; 
}
#load-btn { 
    float: right; padding: 0 20px; height: 38px; background-color: #3b82f6; color: #ffffff; border: none; 
    border-radius: 10px; font-weight: 800; font-size: 14px; cursor: pointer; transition: 0.2s;
}
#load-btn:hover { background-color: #2563eb; }

/* --- LEFT SIDEBAR (GUIDE) --- */
.left-pane {
    position: absolute; top: 0; left: 0; width: 300px; height: 100%;
    background-color: #060913; 
    border-right: 2px solid #1e293b;
    padding: 20px;
    z-index: 500;
}

.group-filter-bar {
    width: 100%; height: 48px; white-space: nowrap; overflow-x: auto;
    margin-bottom: 15px; -webkit-overflow-scrolling: touch;
}
.group-filter-bar::-webkit-scrollbar { display: none; }
.group-item {
    display: inline-block; padding: 8px 16px; background-color: #111827;
    border-radius: 10px; font-size: 13px; font-weight: 700; margin-right: 8px;
    cursor: pointer; color: #94a3b8; border: 1px solid transparent;
}
.group-item.active { 
    background-color: #3b82f6; color: #ffffff; 
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.search-box { width: 100%; margin-bottom: 20px; }
#search-input {
    width: 100%; height: 44px; background-color: #111827;
    border: 1px solid #1e293b; border-radius: 12px;
    padding: 0 16px; font-size: 14px; color: #ffffff;
}

.content-section {
    position: relative; height: -webkit-calc(100% - 140px); height: calc(100% - 140px);
    overflow: hidden;
}
.section-title { font-size: 13px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px; }

.channel-grid {
    position: absolute; top: 30px; left: 0; right: 0; bottom: 0;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch;
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}
.channel-grid::-webkit-scrollbar { width: 4px; }
.channel-grid::-webkit-scrollbar-thumb { background-color: #1e293b; border-radius: 4px; }

.channel-card {
    background-color: #0f172a; border-radius: 12px; padding: 15px 18px; margin-bottom: 12px;
    border: 1px solid #1e293b; cursor: pointer; transition: 0.15s;
}
.channel-card:active { transform: scale(0.98); background-color: #1e293b; }
.channel-card.active { 
    border-color: #3b82f6; 
    background-color: rgba(59, 130, 246, 0.08);
}
.card-title { font-size: 15px; font-weight: 700; color: #ffffff; }
.card-group { font-size: 11px; color: #3b82f6; font-weight: 800; margin-top: 6px; text-transform: uppercase; }

#pagination-container { text-align: center; padding: 15px 0; width: 100%; }
#load-more-btn {
    width: 100%; padding: 15px; background-color: #1e293b; color: #ffffff;
    border: none; border-radius: 12px; font-weight: 800; cursor: pointer;
}

.app-info { display: none; } /* Hide the footer text on PS Vita/Mobile for cleaner UI */

/* --- RESPONSIVE / MOBILE PORTRAIT --- */
@media screen and (max-width: 800px) {
    .navbar { height: 55px; line-height: 55px; }
    .nav-logo { font-size: 18px; }
    
    .split-layout { top: 55px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
    
    .right-pane { 
        position: relative; left: 0; width: 100%; height: auto; 
        z-index: 100; border-bottom: 3px solid #1e293b;
    }
    .hero-section { height: 210px; }
    .sync-row { 
        position: relative; height: auto; min-height: 80px; bottom: auto; left: auto; width: 100%; 
        z-index: 5000; border-bottom: 2px solid #3b82f6; 
        background-color: #0f172a; padding: 18px 20px;
        display: block !important;
    }
    .sync-input-wrapper { width: 75% !important; }
    #load-btn { width: 22% !important; padding: 0 !important; }
    .app-info { display: none !important; }
    
    .left-pane { 
        position: relative; top: 0; width: 100%; height: auto; min-height: 500px;
        border-right: none; padding: 20px;
        padding-bottom: 120px;
    }
    
    .group-filter-bar { margin-bottom: 12px; }
    
    .content-section { height: auto; min-height: 100px; overflow: visible; }
    .channel-grid { position: relative; top: 0; height: auto; overflow: visible !important; display: block; }
}

/* --- PS VITA LANDSCAPE --- */
@media screen and (max-device-width: 960px) and (orientation: landscape) {
    .navbar { display: none; }
    .split-layout { top: 0; }
    .left-pane { width: 250px; border-right: 1px solid #1e293b; background: #060913; box-shadow: none; }
    .right-pane { left: 250px; }
    .sync-row { height: 55px; padding: 8px 15px; border-top: 1px solid #1e293b; background: #0b0f1a; }
    .sync-input-wrapper input { font-size: 10px; }
    #load-btn { height: 34px; font-size: 12px; padding: 0 15px; box-shadow: none; }
    #channel-name { font-size: 16px; text-shadow: none; }
    .channel-card { box-shadow: none !important; border-radius: 4px; }
    .group-item { box-shadow: none !important; border-radius: 4px; }
    * { text-shadow: none !important; }
}

.clearfix::after { content: ""; clear: both; display: table; }
.channel-badge { float: right; font-size: 11px; color: #3b82f6; font-weight: 700; opacity: 0.8; }
