/* ============================================
   VOXSING KARAOKE - AMOLED BLACK THEME
   ============================================ */

:root {
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* AMOLED BLACK COLORS */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent: #8e44ad;
    --accent-glow: rgba(142, 68, 173, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    --logo-color: #ff69b4;
}

/* 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;
}

/* 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: 10px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--logo-color);
    letter-spacing: 1px;
}

.logo-slogan {
    font-size: 8px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.3px;
    opacity: 0.8;
}

/* VIDEO WRAPPER */
.video-wrapper {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%;
    background: #000000;
    overflow: hidden;
    flex-shrink: 0;
}

#player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* PORTRAIT TOUCH & FULLSCREEN BUTTON */
.portrait-touch-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

.fs-enter-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(0,0,0,0.9);
    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 (inside videoContainer) */
.landscape-overlay {
    display: none;              /* default, mobile-landscape akan show */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;                 /* di atas player (1), di bawah touch zone (10) */
}

.landscape-touch-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 110;
    background: transparent;
    cursor: pointer;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 120;
    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.7) 0%,
        transparent 30%,
        transparent 60%,
        rgba(0,0,0,0.95) 100%
    );
}

.overlay-content.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.fs-back-btn {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.9);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    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);
}

.fs-playlist-panel {
    width: 280px;
    max-height: calc(100% - 40px);
    background: rgba(0,0,0,0.97);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.fs-pl-header {
    padding: 12px 15px;
    background: rgba(142, 68, 173, 0.4);
    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;
}

.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.5);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 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:active {
    background: rgba(142, 68, 173, 0.6);
    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 */
.controls-bar {
    background: var(--bg-secondary);
    padding: 8px 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    margin-top: -10px;
    position: relative;
    z-index: 5;
}

.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-card);
    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);
}

/* TAB NAVIGATION */
.tab-nav {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    background: var(--bg-secondary);
    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);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-align: center;
    border-radius: 25px;
    padding: 10px 20px;
    position: fixed;
    z-index: 99998;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    opacity: 0;
    transition: 0.3s;
    font-size: 12px;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 40px;
}

/* SPLASH SCREEN */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.splash-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(142, 68, 173, 0.5));
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(142, 68, 173, 0.5));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px rgba(142, 68, 173, 0.8));
    }
}

.splash-title {
    font-size: 36px;
    font-weight: 800;
    color: #ff69b4;
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
}

.splash-slogan {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 auto 15px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #8e44ad, #ff69b4, #8e44ad);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: loading 2s ease-in-out forwards, shimmer 1s linear infinite;
}

@keyframes loading {
    0% { width: 0%; }
    30% { width: 30%; }
    50% { width: 50%; }
    70% { width: 70%; }
    90% { width: 90%; }
    100% { width: 100%; }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.splash-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
}

/* MOBILE LANDSCAPE FULLSCREEN (HANYA HP) */
@media (orientation: landscape) and (max-width: 899px) and (max-height: 700px) {
    header,
    .tab-nav,
    .content-area,
    .controls-bar,
    .splash-screen {
        display: none !important;
    }
    
    .app-container {
        height: 100vh;
        width: 100vw;
        display: block !important;
        overflow: hidden;
        padding-right: 0;
    }
    
    .video-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        padding-bottom: 0 !important;
        z-index: 1;  /* video di bawah overlay */
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    #player {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        z-index: 1;
    }
    
    .portrait-touch-zone,
    .fs-enter-btn {
        display: none !important;
    }
    
    /* Overlay DI DALAM videoContainer, di atas player */
    .landscape-overlay {
        display: block !important;
    }
}

/* DESKTOP LAYOUT (SIDEBAR KANAN) */
@media screen and (min-width: 900px) {
    body { overflow: hidden; }
    
    .app-container {
        display: block !important;
        height: 100vh;
        width: 100%;
        overflow: hidden;
        padding-right: 370px;
    }
    
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 12px 30px;
        padding-right: 400px;
    }
    
    .logo-img { height: 42px; }
    .logo-title { font-size: 20px; }
    .logo-slogan { font-size: 10px; }
    
    .video-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 0;
        aspect-ratio: 16/9;
        max-height: 65vh;
        margin-top: 80px;
        margin-left: 20px;
        margin-right: 20px;
        border-radius: 16px;
    }
    
    #player { border-radius: 16px; }
    
    .controls-bar {
        position: relative;
        margin: 10px 20px 20px;
        border-radius: 16px;
        width: auto;
    }
    
    .fs-enter-btn,
    .portrait-touch-zone,
    .landscape-overlay {
        display: none !important;
    }
    
    .tab-nav {
        position: fixed !important;
        top: 80px;
        right: 20px;
        width: 340px;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px;
        padding: 12px 15px;
        background: var(--bg-secondary) !important;
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        z-index: 90;
    }
    
    .tab-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 10px;
        border-radius: 8px;
        background: var(--bg-card);
        border: 1px solid var(--glass-border);
    }
    
    .tab-btn i { margin-right: 4px; }
    
    .tab-btn.active {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }
    
    .tab-btn:hover:not(.active) {
        background: var(--bg-glass);
    }
    
    .content-area {
        position: fixed !important;
        top: 145px;
        right: 20px;
        bottom: 20px;
        width: 340px;
        display: block !important;
        background: var(--bg-secondary) !important;
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        padding: 15px;
        overflow: hidden;
        z-index: 89;
    }
    
    .tab-content {
        display: none;
        height: 100%;
        flex-direction: column;
        overflow: hidden;
    }
    
    .tab-content.active {
        display: flex !important;
    }
    
    .scrollable-list {
        flex-grow: 1;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    .list-header {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .search-bar {
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    .search-bar input { font-size: 12px; }
    .search-bar button { padding: 5px 10px; font-size: 10px; }
    
    .song-item {
        padding: 8px;
        margin-bottom: 5px;
    }
    
    .song-item:hover {
        background: var(--bg-glass);
        border-color: var(--accent);
    }
    
    .song-thumb {
        width: 38px;
        height: 38px;
        margin-right: 8px;
    }
    
    .song-title { font-size: 11px; }
    .song-channel { font-size: 9px; }
    
    .action-btn {
        padding: 4px;
        font-size: 11px;
    }
    
    .empty-msg { padding: 25px 10px; font-size: 11px; }
    .loading-msg { font-size: 10px; }
    
    #toast {
        font-size: 12px;
        right: 390px;
        left: auto;
        transform: none;
    }
    
    .splash-logo { width: 140px; height: 140px; }
    .splash-title { font-size: 42px; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-track { background: transparent; }
/* FALLBACK FULLSCREEN */
body.fullscreen-active .landscape-overlay {
    display: block !important;
    z-index: 100 !important;
}

body.fullscreen-active header,
body.fullscreen-active .tab-nav,
body.fullscreen-active .content-area,
body.fullscreen-active .controls-bar {
    display: none !important;
}

body.fullscreen-active .video-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
}
