/* ==========================================================
   STREAMBOX - ULTRA MODERN UI (DARK/LIGHT & MULTI-COLOR)
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Admin Dynamic Theme Color (Default: Neon Indigo) */
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    /* Dark Mode Default (Ultra Modern Slate) */
    --bg-main: #090d16;
    --bg-card: rgba(19, 27, 46, 0.75);
    --bg-sidebar: #0d1322;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

/* Smooth Light Mode Variables */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-sidebar: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.08);
    --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
}

/* Preset Multi-Color Themes (Admin 1-Click Switch) */
[data-color="netflix"] { --primary: #e50914; --primary-glow: rgba(229, 9, 20, 0.35); }
[data-color="terabox"] { --primary: #0ea5e9; --primary-glow: rgba(14, 165, 233, 0.35); }
[data-color="emerald"] { --primary: #10b981; --primary-glow: rgba(16, 185, 129, 0.35); }
[data-color="amber"]   { --primary: #f59e0b; --primary-glow: rgba(245, 158, 11, 0.35); }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Top AJAX Smooth Loading Bar */
#ajax-loader {
    position: fixed;
    top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, var(--primary), #ec4899);
    box-shadow: 0 0 10px var(--primary);
    z-index: 99999;
    transition: width 0.2s ease;
}

/* Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 28px 32px;
    max-width: calc(100vw - 260px);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
    border-color: var(--primary);
}

/* TeraBox Style Folder & Video Grid */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.folder-item, .video-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    user-select: none;
}

.folder-item:hover, .video-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Modern Neon Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* Modern Inputs */
.input-modern {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border 0.2s ease;
}

.input-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Toast Notification */
#toast-box {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--bg-sidebar);
    color: var(--text-main);
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-weight: 500;
    animation: slideIn 0.25s ease forwards;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================
   MX STYLE PLAYER & LOCKER OVERLAYS
   ========================================================== */
.player-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
    overflow: hidden;
    user-select: none;
}

.player-wrapper video, .player-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
}

/* MX Gesture Indicator (Volume / Brightness / Seek Popup) */
.mx-gesture-hud {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 16px 26px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 30;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Click-to-Play Invisible Ad Shield */
.invisible-ad-layer {
    position: absolute;
    inset: 0;
    z-index: 40;
    cursor: pointer;
    background: transparent;
}

/* Telegram Join Locker Overlay */
.tg-locker-modal {
    position: absolute;
    inset: 0;
    background: rgba(9, 13, 22, 0.94);
    backdrop-filter: blur(12px);
    z-index: 50;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

/* Responsive Mobile View */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; max-width: 100vw; padding: 18px; }
}