/* ============================================
   VOXSING KARAOKE - MULTI THEME CSS
   ============================================ */

:root {
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === THEME: DARK GLASS === */
[data-theme="dark"] {
    --bg-primary: rgba(18, 18, 18, 0.95);
    --bg-secondary: rgba(30, 30, 30, 0.8);
    --bg-card: rgba(45, 45, 45, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #8e44ad;
    --accent-glow: rgba(142, 68, 173, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #666666;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --logo-color: #ff69b4;
}

/* === THEME: LIGHT (iPhone Style) === */
[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --accent: #007aff;
    --accent-glow: rgba(0, 122, 255, 0.3);
    --text-primary: #1c1c1e;
    --text-secondary: #636366;
    --text-muted: #8e8e93;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    --logo-color: #ff2d55;
}

/* === THEME: NEON === */
[data-theme="neon"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: rgba(15, 15, 25, 0.95);
    --bg-card: rgba(20, 20, 35, 0.8);
    --bg-glass: rgba(0, 255, 255, 0.03);
    --glass-border: rgba(0, 255, 255, 0.2);
    --accent: #00ffff;
    --accent-glow: rgba(0, 255, 255, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #00ffff;
    --text-muted: #666699;
    --shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    --logo-color: #ff00ff;
}

/* === RESET === */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-main); 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background: var(--bg-primary); 
    color: var(--text-primary); 
    height: 100vh; 
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

/* === APP CONTAINER === */
.app-container { 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    width: 100%;
    background: var(--bg-primary);
}

/* === HEADER === */
header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 20px; 
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.logo { 
    font-size: 18px;
    color: var(--logo-color); 
    font-weight: 800; 
    letter-spacing: 2px;
}

[data-theme="neon"] .logo {
    text-shadow: 0 0 10px var(--logo-color), 0 0 20px var(--logo-color);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === THEME SWITCHER === */
.theme-switcher { position: relative; }

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-btn:active {
    transform: scale(0.95);
    background: var(--accent);
}

.theme-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease;
    z-index: 1000;
    min-width: 150px;
    box-shadow: var(--shadow);
}

.theme-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.theme-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.2s;
    border-bottom: 1px solid var(--glass-border);
}

.theme-option:last-child { border-bottom: none; }

.theme-option:active {
    background: var(--accent);
    color: #fff;
}

.theme-option i { width: 18px; text-align: center; }

/* === VIDEO WRAPPER (PORTRAIT) === */
.video-wrapper { 
    width: 100%; 
    position: relative; 
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000; 
    overflow: hidden; 
    flex-shrink: 0;
}

#player { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 1; 
}

/* Touch Zone untuk Portrait */
.portrait-touch-zone { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    z-index: 10; 
    cursor: pointer; 
}

/* Fullscreen Button (Portrait Only) */
.fs-enter-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    padding: 15px 25px;
    color: #fff;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.fs-enter-btn i { font-size: 28px; }
.fs-enter-btn span { font-size: 12px; font-weight: 600; }

.fs-enter-btn.show { display: flex; }

.fs-enter-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--accent);
}

/* === LANDSCAPE OVERLAY CONTAINER === */
.landscape-overlay {
    display: none; /* Hidden by default, shown via CSS in landscape */
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
}

/* Touch Zone untuk Landscape (Toggle Overlay) */
.landscape-touch-zone {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 51;
    cursor: pointer;
}

/* Overlay Content (Back Button + Playlist) */
.overlay-content {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 52;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, transparent 25%, transparent 65%, rgba(0,0,0,0.8) 100%);
}

.overlay-content.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Back Button */
.fs-back-btn {
    width: 50px; height: 50px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fs-back-btn:active {
    transform: scale(0.95);
    background: var(--accent);
}

/* Fullscreen Playlist Panel */
.fs-playlist-panel {
    width: 280px;
    max-height: calc(100% - 40px);
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.fs-pl-header {
    padding: 12px 15px;
    background: rgba(142, 68, 173, 0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fs-playlist-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px;
    list-style: none;
}

.fs-pl-hint {
    padding: 8px;
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* Fullscreen Playlist Item */
.fs-song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    gap: 10px;
}

.fs-song-item:hover,
.fs-song-item.tapped {
    background: rgba(142, 68, 173, 0.4);
}

.fs-song-item:active {
    transform: scale(0.98);
}

.fs-song-thumb {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.fs-song-info { 
    flex-grow: 1; 
    overflow: hidden; 
    min-width: 0;
}

.fs-song-num {
    font-size: 9px;
    color: var(--accent);
    font-weight: 700;
}

.fs-song-title {
    font-size: 11px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* === CONTROLS BAR (Compact) === */
.controls-bar {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    padding: 6px 15px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: var(--text-secondary);
}

input[type=range] {
    flex-grow: 1;
    height: 3px;
    border-radius: 3px;
    background: var(--glass-border);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 12px; height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.ctrl-btn {
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:active { transform: scale(0.95); }

.ctrl-btn.play-btn {
    width: 42px; height: 42px;
    background: var(--accent);
    border: none;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

[data-theme="neon"] .ctrl-btn.play-btn {
    box-shadow: 0 0 20px var(--accent), 0 0 40px var(--accent);
}

/* === TAB NAVIGATION === */
.tab-nav {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #fff;
    background: var(--accent);
}

/* === CONTENT AREA === */
.content-area {
    flex-grow: 1;
    overflow: hidden;
    background: var(--bg-primary);
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.tab-content {
    display: none;
    height: 100%;
    flex-direction: column;
}

.tab-content.active { display: flex; }

.scrollable-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 15px;
}

.list-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* === SEARCH BAR === */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    gap: 8px;
    flex-shrink: 0;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.search-bar .search-icon { color: var(--text-muted); font-size: 14px; }

.search-bar input {
    background: transparent !important;
    border: none !important;
    color: var(--text-primary) !important;
    flex-grow: 1;
    outline: none !important;
    font-size: 13px;
    -webkit-text-fill-color: var(--text-primary) !important;
}

.search-bar input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar button {
    background: var(--accent);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

/* === SONG LIST === */
.song-list { list-style: none; }

.song-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.song-item:active {
    transform: scale(0.98);
    background: var(--bg-glass);
}

.song-thumb {
    width: 45px; height: 45px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
}

.song-info { flex-grow: 1; overflow: hidden; min-width: 0; }

.song-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.song-channel {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.song-actions { display: flex; gap: 3px; }

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    border-radius: 50%;
    transition: all 0.2s;
}

.action-btn:active { 
    color: var(--accent);
    transform: scale(0.9);
}

.action-btn.fav-active { color: #ff4757; }

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-size: 12px;
}

.loading-msg {
    text-align: center;
    color: var(--accent);
    padding: 15px;
    font-size: 12px;
}

/* === TOAST === */
#toast {
    visibility: hidden;
    min-width: 180px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-align: center;
    border-radius: 25px;
    padding: 10px 20px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    opacity: 0;
    transition: 0.3s;
    font-size: 12px;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 40px;
}

/* ================================================
   LANDSCAPE / FULLSCREEN MODE - PERBAIKAN UTAMA
   ================================================ */
@media (orientation: landscape) {
    /* SEMBUNYIKAN SEMUA KECUALI VIDEO */
    header,
    .tab-nav,
    .content-area,
    .controls-bar {
        display: none !important;
    }
    
    /* APP CONTAINER FULL */
    .app-container {
        height: 100vh;
        width: 100vw;
    }
    
    /* VIDEO WRAPPER FULLSCREEN - PERBAIKAN ASPECT RATIO */
    .video-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        padding-bottom: 0 !important; /* PENTING: Hapus padding */
        z-index: 9999;
    }
    
    /* PLAYER IFRAME COVER FULL */
    #player {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Sembunyikan touch zone portrait & fs button */
    .portrait-touch-zone,
    .fs-enter-btn {
        display: none !important;
    }
    
    /* TAMPILKAN LANDSCAPE OVERLAY */
    .landscape-overlay {
        display: block !important;
    }
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}