/* SECURITY & CORE */
body { 
    -webkit-user-select: none; 
    -ms-user-select: none; 
    user-select: none; 
    background-color: #0f1014; 
    color: white; 
    font-family: 'Segoe UI', sans-serif; 
    overflow: hidden; 
    height: 100vh; 
}

/* ENABLE SELECT/PASTE FOR INPUTS */
input, textarea { 
    -webkit-user-select: text !important; 
    user-select: text !important; 
}

:root { 
    --primary: #e50914; 
    --bg-glass: rgba(20, 20, 20, 0.95); 
    --accent: #ffc107; 
    --text-grey: #b3b3b3; 
    --modal-bg: #0b1120; 
}

/* FOCUS & ANIMATION */
.focusable:focus, .focusable:hover { outline: 3px solid var(--primary) !important; transform: scale(1.05); z-index: 100; box-shadow: 0 0 15px var(--primary); }
.animate-pop { transition: transform 0.2s; }

/* BACKGROUND */
#dynamicBg { position: fixed; inset: 0; z-index: -1; background-image: url('https://wallpapers.com/images/hd/netflix-background-gs7hjuwvv2g0e9fj.jpg'); background-size: cover; filter: blur(20px) brightness(0.4); transition: background-image 0.5s ease-in-out; }

/* TOAST */
#toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 11000; display: flex; flex-direction: column; gap: 10px; }
.toast-msg { background: rgba(30,30,30,0.95); padding: 12px 24px; border-radius: 50px; border: 1px solid #444; display: flex; align-items: center; gap: 10px; animation: slideUp 0.3s ease; }
.toast-msg.success { border-color: #28a745; color: #28a745; }
.toast-msg.error { border-color: #dc3545; color: #dc3545; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* SECTIONS */
#profileSection, #loginSection { position: fixed; inset: 0; z-index: 10000; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow-y: auto; }
#loginSection { background: rgba(0,0,0,0.95); display: none; padding: 20px; }

/* PROFILE MANAGER STYLES (NEW) */
.profile-wrapper { position: relative; margin: 15px; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; background: #222; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; cursor: pointer; border: 3px solid transparent; transition: 0.3s; }
.btn-delete-profile { position: absolute; top: 0; right: 0; background: red; color: white; border: 2px solid white; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; z-index: 10; transition: 0.2s; }
.btn-delete-profile:hover { transform: scale(1.2); }

/* UPDATED LOGIN BOX */
.login-box { background: #141414; padding: 30px; border-radius: 12px; width: 100%; max-width: 480px; border: 1px solid #333; margin-top: 50px; margin-bottom: 50px; }

/* QR & TABS */
#qr-reader { width: 100%; border-radius: 10px; overflow: hidden; margin-bottom: 15px; border: 2px solid var(--primary); display:none; }
.nav-tabs .nav-link { color: #aaa; border: none; cursor: pointer; }
.nav-tabs .nav-link.active { background: transparent; color: var(--primary); border-bottom: 2px solid var(--primary); font-weight: bold; }

/* PASSWORD TOGGLE */
.password-wrapper { position: relative; }
.password-toggle-icon { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); cursor: pointer; color: #aaa; z-index: 10; }

/* QUICK LINKS */
.ql-section-title { font-size: 0.8rem; letter-spacing: 2px; color: #666; margin-bottom: 15px; margin-top: 25px; }
.btn-ql-main { background: rgba(30, 30, 40, 0.6); border: 1px solid #333; border-radius: 10px; padding: 15px; width: 100%; text-align: center; color: white; transition: 0.2s; margin-bottom: 10px; }
.btn-ql-main:hover { background: #222; border-color: var(--primary); }
.ql-sub-text { font-size: 0.75rem; color: #888; display: block; margin-bottom: 3px; }
.ql-main-text { font-size: 1rem; font-weight: bold; color: white; display: block; }
.btn-ql-pill { background: rgba(255, 193, 7, 0.1); border: 1px solid var(--accent); color: var(--accent); border-radius: 50px; padding: 10px 30px; font-weight: bold; display: inline-block; margin-top: 10px; text-decoration: none; }
.btn-ql-pill:hover { background: var(--accent); color: black; }

/* DASHBOARD & PLAYER */
#dashboardSection { display: none; height: 100vh; overflow-y: auto; padding: 20px; padding-bottom: 80px; }
.account-info-box { background: linear-gradient(45deg, #1a1a1a, #252525); border-radius: 8px; padding: 10px 15px; font-size: 0.85rem; margin-top: 5px; border-left: 4px solid var(--primary); }
.btn-header { background: rgba(255,255,255,0.1); border: 1px solid #444; color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }

/* HERO SLIDER (NEW) */
#heroSliderContainer { margin-bottom: 30px; border-radius: 15px; overflow: hidden; border: 1px solid #333; height: 35vh; min-height: 250px; position: relative; display: none; }
.carousel-item { height: 35vh; min-height: 250px; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, #0f1014, transparent); display: flex; flex-direction: column; justify-content: flex-end; padding: 20px; }
.hero-title { font-size: 2rem; font-weight: bold; text-shadow: 2px 2px 4px black; margin-bottom: 10px; }

.recent-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 15px; margin-bottom: 20px; scrollbar-width: none; }
.recent-scroll::-webkit-scrollbar { display: none; }
.recent-card { min-width: 140px; width: 140px; background: #1a1a1a; border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; border: 1px solid #333; transition: 0.3s; }
.recent-card:hover { transform: scale(1.05); border-color: var(--primary); }
.recent-img { width: 100%; height: 180px; object-fit: cover; }
.dash-card { background: linear-gradient(145deg, rgba(26,26,26,0.9), rgba(17,17,17,0.9)); border: 1px solid #333; border-radius: 12px; padding: 30px; text-align: center; cursor: pointer; transition: 0.3s; height: 100%; }

#playerInterface { display: none; height: 100vh; width: 100vw; flex-direction: column; overflow: hidden; }
.sidebar { width: 280px; background: #080808; border-right: 1px solid #222; display: flex; flex-direction: column; height: 100%; flex-shrink: 0; }
.main-view { flex: 1; display: flex; flex-direction: column; height: 100%; position: relative; }
.video-area { position: relative; background: #000; width: 100%; display: flex; flex-direction: row; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.vid-frame { flex: 1; height: 100%; position: relative; border-right: 1px solid #222; }
#secondaryPlayer { display: none; } 
.video-js { width: 100% !important; height: 100% !important; }

/* MINI PLAYER */
.mini-player-active #playerInterface { position: fixed; bottom: 20px; right: 20px; width: 320px !important; height: 180px !important; z-index: 12000; border: 2px solid var(--primary); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); display: flex !important; overflow: hidden; }
.mini-player-active .sidebar, .mini-player-active .controls-bar, .mini-player-active .content-scroll-area, .mini-player-active .info-overlay, .mini-player-active .epg-overlay, .mini-player-active .stats-overlay { display: none !important; }
.mini-player-active .video-area { height: 100% !important; width: 100% !important; }
.mini-player-overlay { display: none; position: absolute; inset:0; z-index: 10; cursor: pointer; background: rgba(0,0,0,0.1); }
.mini-player-active .mini-player-overlay { display: block; }
.mini-close-btn { position: absolute; top: 5px; right: 5px; background: red; color: white; border:none; border-radius:50%; width:20px; height:20px; font-size:12px; z-index:11; display:none; }
.mini-player-active .mini-close-btn { display: block; }

.controls-bar { background: #101010; padding: 10px; display: flex; gap: 8px; overflow-x: auto; border-bottom: 1px solid #222; flex-shrink: 0; z-index: 50; align-items: center; }
.btn-ctrl { background: #1f1f1f; border: 1px solid #333; color: #ccc; padding: 6px 12px; border-radius: 4px; white-space: nowrap; font-size: 0.75rem; display: flex; align-items: center; gap: 6px; cursor: pointer; }

.content-scroll-area { flex-grow: 1; overflow-y: auto; padding: 0 15px 15px 15px; position: relative; }
.sticky-header-container { position: sticky; top: 0; z-index: 100; background-color: var(--bg-main); padding-top: 15px; padding-bottom: 10px; border-bottom: 1px solid #222; margin-bottom: 15px; }

.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding-bottom: 50px; }
.ch-item { background: rgba(24,24,24,0.9); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; transition: 0.2s; position: relative; border: 1px solid transparent; }
.ch-item:hover { transform: scale(1.03); background: #222; border-color: var(--primary); z-index: 10; }
.ch-img { width: 100%; height: 70px; object-fit: contain; margin-bottom: 5px; }
.badge-new { position: absolute; top: 0; left: 0; background: #ff0000; color: white; font-size: 9px; padding: 2px 6px; font-weight: bold; border-bottom-right-radius: 8px; z-index: 5; }

.custom-modal-content { background-color: var(--modal-bg); border: 1px solid #333; border-radius: 10px; }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; max-height: 60vh; overflow-y: auto; }
.cat-btn { background: #0f1825; border: 1px solid #1e2a3b; color: #ccc; padding: 12px; text-align: center; border-radius: 5px; cursor: pointer; min-height: 50px; display: flex; align-items: center; justify-content: center; }
.cat-btn:hover { border-color: var(--primary); color: white; background: #162235; }

.empty-state { text-align: center; margin-top: 50px; color: #555; }
.info-overlay { position: absolute; top: 15px; right: 15px; z-index: 20; display: flex; gap: 10px; pointer-events: none; }
.info-badge { background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.1); color: var(--accent); padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: bold; backdrop-filter: blur(5px); }

/* STATS FOR NERDS (NEW) */
.stats-overlay { position: absolute; top: 50px; left: 20px; background: rgba(0,0,0,0.85); color: #00ff00; font-family: 'Courier New', monospace; font-size: 11px; padding: 15px; z-index: 30; pointer-events: none; border: 1px solid #333; border-radius: 5px; display: none; line-height: 1.5; min-width: 200px; backdrop-filter: blur(5px); }
.stats-overlay b { color: #fff; }

.epg-overlay { position: absolute; bottom: 60px; left: 20px; z-index: 20; background: rgba(0,0,0,0.85); padding: 10px 15px; border-radius: 8px; max-width: 350px; display: none; pointer-events: none; border-left: 4px solid var(--primary); backdrop-filter: blur(5px); transition: opacity 0.5s ease; }

.settings-panel { position: absolute; bottom: 80px; right: 10px; width: 220px; background: rgba(15, 15, 15, 0.95); border: 1px solid #333; border-radius: 10px; z-index: 9999; display: none; backdrop-filter: blur(15px); }
.settings-item { padding: 12px 15px; border-bottom: 1px solid #2a2a2a; color: #ddd; cursor: pointer; display: flex; justify-content: space-between; font-size: 0.9rem; align-items: center; }
.tmdb-backdrop { position: absolute; top:0; left:0; width:100%; height:200px; background-size: cover; background-position: center; mask-image: linear-gradient(to bottom, black, transparent); -webkit-mask-image: linear-gradient(to bottom, black, transparent); opacity: 0.6; }

.color-dot { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; }

@media (min-width: 992px) { #playerInterface { flex-direction: row; } .video-area { height: 70vh; flex-shrink: 0; } .mobile-only { display: none !important; } }
@media (max-width: 991px) { .sidebar { display: none; } .video-area { width: 100%; aspect-ratio: 16/9; height: auto; flex-shrink: 0; z-index: 100; } }