/* ===== Alany Core Aesthetic UI ===== */
:root, [data-theme="dark"] {
  --bg: #0d0d10;
  --bg-card: #15151a;
  --bg-input: #1c1c22;
  --bg-glass: rgba(21, 21, 26, 0.9);
  --border: rgba(255, 255, 255, 0.05);
  --border-active: rgba(255, 255, 255, 0.1);
  --text: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #818cf8;
  --accent-rgb: 129, 140, 248;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --hover-bg: rgba(255, 255, 255, 0.04);
  --active-bg: rgba(255, 255, 255, 0.08);
  --danger: #ef4444;
  --success: #10b981;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --bg-input: #f1f3f5;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border: rgba(0, 0, 0, 0.08);
  --border-active: rgba(0, 0, 0, 0.15);
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --accent: #4f46e5;
  --accent-rgb: 79, 70, 229;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --hover-bg: rgba(0, 0, 0, 0.04);
  --active-bg: rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  background: var(--bg); 
  font-family: 'Manrope', -apple-system, sans-serif; 
  color: var(--text); 
  min-height: 100vh; 
  overflow: hidden;
}
#app { display: flex; height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; outline: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 99px; }

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .brand-wordmark, .sidebar.collapsed .nav-item span { display: none; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; padding: 0 8px; }
.sidebar.collapsed .sidebar-header { flex-direction: column; gap: 16px; padding: 0; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: #000;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(173, 255, 47, 0.1);
  font-weight: 800; font-size: 20px; color: #adff2f;
}
.brand-wordmark { font-weight: 800; font-size: 18px; display: flex; flex-direction: column; line-height: 1.1; }
.video-tag { font-size: 10px; color: #adff2f; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.sidebar-toggle { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--text-secondary); transition: 0.2s; }
.sidebar-toggle:hover { background: var(--hover-bg); color: var(--text); }

.nav-item {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600; color: var(--text-secondary); transition: 0.2s; margin-bottom: 4px;
}
.nav-item:hover { background: var(--hover-bg); color: var(--text); }
.nav-item.active { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.nav-icon { font-size: 20px; display: flex; }
.nav-item.active .nav-icon { color: var(--text); }
.nav-divider { height: 1px; background: var(--border); margin: 16px 8px; }

/* ===== Header ===== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 32px;
  background: var(--bg); position: sticky; top: 0; z-index: 100;
}
.search-bar {
  display: flex; align-items: center; background: var(--bg-card); border-radius: 99px;
  padding: 6px 6px 6px 20px; width: min(480px, 40%); border: 1px solid var(--border); transition: 0.2s;
}
.search-bar:focus-within { border-color: var(--border-active); background: var(--bg-input); }
.search-bar input { flex: 1; background: none; border: none; color: var(--text); font-size: 14px; outline: none; }
.search-btn { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: 0.2s; }
.search-btn:hover { background: var(--hover-bg); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 20px; transition: 0.2s; }
.icon-btn:hover { background: var(--bg-card); color: var(--text); }
.user-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; cursor: pointer; transition: 0.2s; }
.user-avatar img:hover { filter: brightness(1.1); }
.auth-btn { background: var(--accent); color: #fff; padding: 10px 24px; border-radius: 99px; font-weight: 600; font-size: 14px; transition: 0.2s; }
.auth-btn:hover { background: var(--accent-rgb); filter: brightness(1.1); }

/* Dropdown */
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); width: 220px; padding: 8px; display: none; flex-direction: column; box-shadow: var(--shadow); z-index: 1000; }
.user-dropdown.active { display: flex; animation: dropIn 0.2s ease; }
@keyframes dropIn { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
.user-dropdown a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: 0.2s; }
.user-dropdown a:hover { background: var(--hover-bg); }
.user-dropdown a i { font-size: 18px; color: var(--text-muted); }

/* ===== Page Layout ===== */
#pageContent { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.page-inner { max-width: 1600px; margin: 0 auto; padding: 24px 32px 48px; }
.page-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; }

/* Categories */
.cats-wrap { display: flex; gap: 8px; padding: 16px 32px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); background: var(--bg); }
.cat-chip { padding: 8px 16px; border-radius: 99px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; transition: 0.2s; }
.cat-chip:hover { background: var(--hover-bg); border-color: var(--border-active); }
.cat-chip.active { background: var(--text); color: var(--bg); border-color: transparent; }

/* Video Grid */
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 20px; }
.vid-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.vid-card:hover .vid-thumb img { transform: scale(1.05); }
.vid-thumb { width: 100%; aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden; position: relative; background: var(--bg-card); }
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.vid-badge { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); color: #fff; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; backdrop-filter: blur(4px); }
.vid-info { display: flex; gap: 12px; }
.ch-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--bg-input); flex-shrink: 0; }
.vid-meta { flex: 1; min-width: 0; }
.vid-title { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-name { font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; transition: 0.2s; }
.ch-name:hover { color: var(--text); }
.vid-stats { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.verify-badge { color: #3897f0; font-size: 14px; margin-left: 4px; display: inline-flex; align-items: center; vertical-align: middle; }

/* ===== Notifications ===== */
.notif-badge { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg); }
.notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 360px; max-height: 480px; display: none; flex-direction: column; box-shadow: var(--shadow); z-index: 1000; overflow: hidden; }
.notif-dropdown.active { display: flex; animation: dropIn 0.2s ease; }
.notif-header { padding: 16px; font-weight: 800; border-bottom: 1px solid var(--border); font-size: 16px; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; transition: 0.2s; cursor: pointer; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--hover-bg); }
.notif-item.unread { background: rgba(var(--accent-rgb), 0.05); }
.notif-item .ch-avatar { width: 40px; height: 40px; }
.notif-body { flex: 1; font-size: 13px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-item b { color: var(--text); }

/* ===== Watch Page ===== */
.watch-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 32px;
}
.watch-left {
  min-width: 0;
}
.watch-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.watch-main { flex: 1; min-width: 0; }
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); }
.player-wrap video, .player-wrap iframe { width: 100%; height: 100%; border: none; object-fit: contain; }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.95)); padding: 48px 24px 24px; display: flex; flex-direction: column; gap: 16px; opacity: 0; transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1); z-index: 5; pointer-events: auto; }
.player-wrap:hover .player-controls, .player-wrap.paused .player-controls { opacity: 1; }

/* Hide controls class (used for auto-hide when mouse is inactive) */
.player-wrap.hide-controls-cursor { cursor: none; }
.player-wrap.hide-controls-cursor .player-controls { opacity: 0 !important; pointer-events: none; }

/* Premium Progress Bar */
.player-progress { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 99px; cursor: pointer; position: relative; transition: height 0.15s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; }
.player-progress:hover { height: 6px; }
.player-progress-fill { position: relative; height: 100%; background: var(--accent); border-radius: 99px; pointer-events: none; transition: width 0.1s linear; }
.player-progress-buf { position: absolute; top: 0; left: 0; height: 100%; background: rgba(255,255,255,0.35); border-radius: 99px; pointer-events: none; transition: width 0.1s linear; }

/* Slider Thumb (Circle) */
.player-progress-thumb {
  position: absolute;
  top: 50%;
  right: -6px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s;
  pointer-events: none;
  z-index: 6;
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
}
.player-progress:hover .player-progress-thumb {
  transform: translateY(-50%) scale(1);
}
.player-row { display: flex; align-items: center; justify-content: space-between; }
.player-left, .player-right { display: flex; align-items: center; gap: 20px; }
.player-btn { color: #fff; font-size: 26px; transition: 0.2s; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.player-btn:hover { color: var(--accent); transform: scale(1.1); }
.player-time { color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.player-vol { width: 80px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 99px; cursor: pointer; position: relative; }
.player-vol-fill { height: 100%; background: #fff; border-radius: 99px; pointer-events: none; }
.player-overlay-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); color: #fff; font-size: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: 0.2s; z-index: 4; }
.player-wrap.paused .player-overlay-btn { opacity: 1; }

.watch-title { font-size: 20px; font-weight: 800; line-height: 1.4; margin: 16px 0 12px 0; color: var(--text); }
.watch-header-actions-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.watch-header-left { display: flex; align-items: center; gap: 12px; }
.watch-ch-info { display: flex; flex-direction: column; }
.watch-ch-name { font-weight: 700; font-size: 16px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.watch-ch-subs { font-size: 13px; color: var(--text-muted); }
.sub-btn { background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 99px; font-weight: 700; font-size: 14px; transition: 0.2s; cursor: pointer; white-space: nowrap; border: none; margin-left: 8px; }
.sub-btn.subscribed { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.watch-actions { display: flex; gap: 8px; align-items: center; }
.act-btn { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: 14px; transition: 0.2s; color: var(--text); background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; }
.act-btn:hover { background: var(--hover-bg); border-color: var(--border-active); }
.act-btn.liked { background: rgba(108, 92, 231, 0.1); border-color: var(--accent); color: var(--accent); }
.act-btn i { font-size: 20px; }

.watch-desc-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; font-size: 14px; line-height: 1.6; margin-bottom: 24px; box-shadow: var(--shadow); }
.watch-desc-stats { font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 14px; }
.watch-desc-text { color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }

.suggested-heading { font-size: 16px; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.suggested-card { display: flex; gap: 12px; cursor: pointer; margin-bottom: 16px; transition: transform 0.2s; }
.suggested-card:hover { transform: translateY(-2px); }
.suggested-thumb { width: 168px; aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; position: relative; background: var(--bg-card); border: 1px solid var(--border); }
.suggested-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.suggested-card:hover .suggested-thumb img { transform: scale(1.05); }
.suggested-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; }
.suggested-title { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--text); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.suggested-ch-name { font-size: 12px; color: var(--text-secondary); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.suggested-stats { font-size: 11px; color: var(--text-muted); }

/* Comments Sidebar */
.comments-sec { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; margin-top: 24px; }
.comments-header { padding: 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.cmt-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.cmt-item { display: flex; gap: 12px; }
.cmt-body { flex: 1; background: var(--bg-input); padding: 12px; border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md); position: relative; }
.cmt-author { font-weight: 700; font-size: 13px; cursor: pointer; }
.cmt-time { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.cmt-text { font-size: 14px; margin-top: 4px; line-height: 1.5; word-break: break-word; }
.cmt-del { position: absolute; top: 12px; right: 12px; color: var(--text-muted); opacity: 0; transition: 0.2s; cursor: pointer; }
.cmt-item:hover .cmt-del { opacity: 1; }
.cmt-del:hover { color: var(--danger); }
.cmt-input-area { padding: 16px; border-top: 1px solid var(--border); background: var(--bg-card); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.cmt-form { display: flex; gap: 12px; align-items: flex-start; }
.cmt-input-wrap { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; transition: 0.2s; }
.cmt-input-wrap:focus-within { border-color: var(--border-active); }
.cmt-input-wrap textarea { width: 100%; background: none; border: none; color: var(--text); font-family: inherit; font-size: 14px; outline: none; resize: none; min-height: 40px; }
.cmt-send { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: 0.2s; flex-shrink: 0; }
.cmt-send:hover { transform: scale(1.05); }

/* ===== Channel Page ===== */
.ch-banner { width: 100%; height: 240px; background: linear-gradient(45deg, var(--bg-card), var(--border-active)); border-bottom: 1px solid var(--border); position: relative; }
.ch-banner-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.ch-header-row { display: flex; align-items: flex-end; gap: 24px; max-width: 1600px; margin: 0 auto; padding: 0 32px; transform: translateY(-50px); margin-bottom: -20px; }
.ch-page-avatar { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); background: var(--bg); }
.ch-page-info { flex: 1; padding-bottom: 12px; }
.ch-page-info h1 { font-size: 32px; font-weight: 800; line-height: 1.2; }
.ch-page-stats { font-size: 15px; color: var(--text-secondary); margin-top: 4px; }
.ch-page-bio { font-size: 14px; color: var(--text-secondary); margin-top: 12px; max-width: 600px; line-height: 1.5; }
.ch-content { padding: 24px 32px 48px; max-width: 1600px; margin: 0 auto; }

/* ===== Settings ===== */
.settings-wrap { max-width: 800px; margin: 0 auto; padding: 24px 32px 48px; }
.stabs { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 32px; background: var(--bg-card); padding: 6px; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.stabs::-webkit-scrollbar { display: none; }
.stab { flex-shrink: 0; padding: 10px 18px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-secondary); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border: 1px solid transparent; }
.stab:hover { background: var(--hover-bg); color: var(--text); }
.stab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2); }
.stab-content { display: none; animation: fadeIn 0.3s ease; }
.stab-content.active { display: block; }
.settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.settings-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.settings-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 32px; }
.settings-avatar-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }

/* Forms */
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-textarea, .form-select { background: var(--bg-input); border: 1px solid transparent; padding: 14px 16px; border-radius: var(--radius-md); color: var(--text); font-size: 15px; transition: 0.2s; font-family: inherit; }
.form-group input:focus, .form-textarea:focus { border-color: var(--accent); background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 600; min-height: 20px; }
.submit-btn { background: var(--text); color: var(--bg); padding: 14px; border-radius: var(--radius-md); font-weight: 700; font-size: 15px; width: 100%; transition: 0.2s; }
.submit-btn:hover { filter: brightness(0.9); }
.submit-btn.danger { background: var(--danger); color: #fff; }
.submit-btn.danger:hover { background: #dc2626; }
.file-input { background: var(--bg-input); border-radius: var(--radius-md); padding: 12px; font-size: 14px; color: var(--text); cursor: pointer; width: 100%; }
.file-input::file-selector-button { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; margin-right: 12px; transition: 0.2s; }
.file-input::file-selector-button:hover { background: var(--hover-bg); }

/* Settings Item Row (for switches/selects) */
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.settings-item:last-child { border-bottom: none; }
.settings-item-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.settings-item-title { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-item-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: var(--bg-input); transition: .3s; border-radius: 24px; border: 1px solid var(--border); }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: #fff; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--accent); border-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* Auth Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); width: 100%; max-width: 440px; padding: 40px; position: relative; transform: translateY(20px) scale(0.95); transition: 0.3s; box-shadow: var(--shadow); }
.modal-overlay.active .modal-box { transform: translateY(0) scale(1); }
.close-modal { position: absolute; top: 20px; right: 20px; font-size: 24px; color: var(--text-muted); transition: 0.2s; }
.close-modal:hover { color: var(--text); }
.auth-form { display: none; flex-direction: column; }
.auth-form.active { display: flex; }
.auth-form h2 { font-size: 24px; font-weight: 800; margin-bottom: 24px; text-align: center; }
.auth-switch { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-secondary); }
.auth-switch a { color: var(--accent); font-weight: 700; }

/* Empty States & Toast */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 100px 20px; text-align: center; color: var(--text-secondary); }
.empty-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 20px; }
.empty-state h3 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty-cta { margin-top: 24px; padding: 12px 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 99px; color: var(--text); font-weight: 700; transition: 0.2s; }
.empty-cta:hover { background: var(--hover-bg); }
#toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 14px 28px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; opacity: 0; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 9999; box-shadow: var(--shadow); }

/* Progress */
.upload-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress-bar { flex: 1; height: 6px; background: var(--bg-input); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--text); border-radius: 99px; width: 0; transition: 0.3s; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.watch-desc-box { background: var(--bg-card); padding: 16px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.6; border: 1px solid var(--border); box-shadow: var(--shadow); }
.cmt-del { color: var(--danger); font-size: 13px; font-weight: 700; background: rgba(239, 68, 68, 0.1); border-radius: var(--radius-sm); border: none; padding: 6px 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; margin-left: auto; transition: 0.2s; }
.cmt-del:hover { background: var(--danger); color: #fff; }

#topProgressBar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 9999; width: 0; transition: width 0.2s, opacity 0.3s; pointer-events: none; opacity: 0; box-shadow: 0 0 10px var(--accent); }

@media (max-width: 1024px) { .watch-wrap { grid-template-columns: 1fr; } .comments-sec { height: auto; position: static; margin-top: 24px; } }
@media (max-width: 768px) {
  .sidebar { 
    position: fixed; bottom: 16px; left: 16px; right: 16px; width: auto; height: 64px; 
    flex-direction: row; padding: 0 10px; border: 1px solid var(--border); 
    z-index: 500; border-radius: 32px;
    background: rgba(21, 21, 26, 0.85); backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin: 0 auto; max-width: 500px;
  }
  .sidebar.collapsed { width: auto; }
  .sidebar.collapsed .nav-item span, .sidebar .nav-item span { display: none !important; }
  .sidebar-header { display: none; }
  .sidebar-nav { 
    display: flex; flex-direction: row; width: 100%; height: 100%; 
    justify-content: space-around; align-items: center; 
    overflow: hidden;
  }
  .nav-item { 
    flex: 1; flex-direction: column; gap: 0; padding: 0; 
    min-width: 44px; height: 100%;
    justify-content: center; align-items: center; margin-bottom: 0;
    color: var(--text-muted); position: relative; transition: 0.3s;
  }
  .nav-item.active { 
    background: transparent; color: var(--accent); border: none;
  }
  .nav-item.active::after {
    content: ''; position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
  }
  .nav-icon { font-size: 24px; transition: 0.3s; }
  .nav-item.active .nav-icon { transform: scale(1.1); color: var(--accent); }
  .nav-divider, #sbSettings, #themeToggleBtn, #sbLogout, #sbAdmin { display: none !important; }
  .main-content { padding-bottom: 80px; }
  .top-header { padding: 12px 16px; gap: 12px; }
  #mobileSearchToggle { display: flex !important; }
  .search-bar { display: none; }
  .search-bar.active {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    padding: 0 16px;
    z-index: 1001;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    animation: dropIn 0.2s ease;
  }
  .search-bar.active #mobileSearchBack {
    display: flex !important;
  }
  .mobile-logo { display: block !important; flex-shrink: 0; }
  .page-inner { padding: 16px; }
  .vid-grid { gap: 20px 12px; grid-template-columns: 1fr; }
  .ch-banner { height: 120px; }
  .ch-header-row { transform: translateY(-30px); margin-bottom: -10px; gap: 12px; flex-direction: column; align-items: center; text-align: center; }
  .watch-wrap { padding: 16px 0; gap: 16px; }
  .watch-player, .watch-title, .watch-header-actions-row, .watch-channel, .watch-desc-box, .comments-sec, .suggested-heading, .suggested-list { margin-left: 16px; margin-right: 16px; }
  .player-wrap { border-radius: 0; margin-bottom: 0; }
  .player-controls { padding: 20px 16px 16px; gap: 12px; }
  .player-btn { font-size: 20px; }
  .player-time { font-size: 12px; }
  .player-left, .player-right { gap: 12px; }
  .watch-actions { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .watch-actions::-webkit-scrollbar { display: none; }
  
  /* Mobile Settings Adjustments */
  .settings-wrap { padding: 16px; }
  .stabs { overflow-x: auto; scrollbar-width: none; }
  .stabs::-webkit-scrollbar { display: none; }
  .stab { min-width: 120px; flex-shrink: 0; padding: 10px; font-size: 13px; }
  .settings-card { padding: 20px; border-radius: var(--radius-md); }
  .settings-item { padding: 12px 0; }
  .settings-item-title { font-size: 14px; }
  .settings-item-desc { font-size: 12px; }
  
  /* Layout fixes */
  .page-inner { padding: 16px; }
  .top-header { padding: 10px 16px; }
  .search-bar { padding: 4px 4px 4px 16px; }
  .vid-title { font-size: 14px; }
  .ch-name { font-size: 12px; }
}

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--bg-card); color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.admin-table tr:hover { background: var(--hover-bg); }
.v-btn { background: var(--accent); color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: 0.2s; }
.v-btn:hover { opacity: 0.9; transform: scale(1.05); }

.form-select { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text); font-size: 15px; outline: none; cursor: pointer; }
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2); }

@keyframes dropIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0.5; transform: scale(0.9); } }
.vid-badge.live { background: var(--danger); display: flex; align-items: center; gap: 6px; }
.vid-badge.live i { animation: pulse 1.5s infinite; font-size: 8px; }

/* Custom Player Enhancements */
.player-wrap { box-shadow: 0 20px 40px rgba(0,0,0,0.4); border: 1px solid var(--border); }
.player-controls { backdrop-filter: blur(10px); }
.player-btn i { filter: drop-shadow(0 0 4px rgba(255,255,255,0.2)); }

/* Player Settings Menu */
.player-settings-menu {
  position: absolute; bottom: 80px; right: 24px; background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 220px; padding: 8px; display: none; flex-direction: column; z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.player-settings-menu.active { display: flex; animation: slideUp 0.2s ease; }
#psMain { display: flex; flex-direction: column; }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.ps-item {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: 0.2s;
}
.ps-item:hover { background: var(--hover-bg); }
.ps-item i { font-size: 18px; color: var(--text-muted); }
.ps-item span.val { color: var(--accent); font-size: 11px; text-transform: uppercase; font-weight: 800; }

.ps-submenu { display: none; flex-direction: column; }
.ps-submenu.active { display: flex; }
.ps-back { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 8px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.ps-back:hover { color: var(--text); }

.verify-badge { color: var(--accent); font-size: 14px; margin-left: 4px; vertical-align: middle; }
.ch-banner { width: 100%; height: 200px; border-radius: var(--radius-lg); background-size: cover; background-position: center; background-color: var(--hover-bg); margin-bottom: 20px; border: 1px solid var(--border); }
@media (max-width: 768px) { .ch-banner { height: 120px; } }

.unread { background: rgba(var(--accent-rgb), 0.1) !important; border-left: 3px solid var(--accent); }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 4px; border-radius: 6px; display: none; }
.custom-select { position: relative; width: 100%; user-select: none; }
.cs-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 12px; cursor: pointer; transition: 0.2s; font-weight: 600;
}
.cs-trigger span { display: flex; align-items: center; gap: 10px; }
.cs-trigger:hover { border-color: var(--accent); background: var(--hover-bg); }
.cs-options {
    position: absolute; top: calc(100% + 8px); left: 0; width: 100%;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; display: none; z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: dropIn 0.2s ease;
}
.cs-options.show { display: block; }
.cs-opt {
    padding: 12px 16px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 12px;
}
.cs-opt:hover { background: var(--hover-bg); color: var(--accent); }
.cs-opt.active { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.cs-opt i { font-size: 18px; }

/* Active Sessions styles */
.session-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border); transition: 0.2s; }
.session-item:hover { border-color: var(--accent); background: var(--bg-input); }
.session-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--active-bg); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--accent); }
.session-del-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 8px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.session-del-btn:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.current-badge { background: var(--accent); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 700; }

/* Watch History Deletion styles */
.history-del-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    opacity: 0;
}
.vid-card-wrapper:hover .history-del-btn {
    opacity: 1;
}
.history-del-btn:hover {
    background: var(--danger) !important;
    color: #fff !important;
    transform: scale(1.1);
}


/* ===== Search Suggestions ===== */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
}
.search-suggestions.active {
  display: flex;
  animation: dropIn 0.2s ease;
}
.sug-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
  text-align: left;
}
.sug-item:hover, .sug-item.selected {
  background: var(--hover-bg);
}
.sug-item i {
  color: var(--text-muted);
  font-size: 16px;
}

/* ===== Share Modal ===== */
.share-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  padding: 32px;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: 0.3s;
  box-shadow: var(--shadow);
  text-align: center;
}
.modal-overlay.active .share-modal-box {
  transform: translateY(0) scale(1);
}
.share-modal-box h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
}
.share-social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.share-social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}
.share-social-item:hover {
  transform: translateY(-2px);
}
.share-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  transition: 0.2s;
}
.share-social-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.share-social-item.telegram .share-icon-circle { background: #229ED9; }
.share-social-item.vk .share-icon-circle { background: #0077FF; }
.share-social-item.whatsapp .share-icon-circle { background: #25D366; }
.share-social-item.viber .share-icon-circle { background: #7309F1; }

.share-link-copy-wrap {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  align-items: center;
}
.share-link-copy-wrap input {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  outline: none;
}
.share-link-copy-wrap button {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}
.share-link-copy-wrap button:hover {
  filter: brightness(0.9);
}



/* ===== Heart Double Tap Animation ===== */
.heart-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  color: var(--danger);
  pointer-events: none;
  z-index: 15;
  animation: heartFly 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.4));
}
@keyframes heartFly {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8) translateY(-40px); opacity: 0; }
}

/* ===== Double Tap Seek Overlays ===== */
.seek-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  z-index: 14;
  pointer-events: none;
  animation: seekFlash 0.6s ease forwards;
}
.seek-overlay.left {
  left: 0;
  border-radius: 16px 0 0 16px;
}
.seek-overlay.right {
  right: 0;
  border-radius: 0 16px 16px 0;
}
.seek-overlay i {
  font-size: 24px;
}
@keyframes seekFlash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}



/* ===== EPG TV Program Timeline Sidebar ===== */
.epg-list-container {
  height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  padding: 20px 16px;
  position: relative;
  box-shadow: var(--shadow);
}
.epg-list {
  display: flex;
  flex-direction: column;
  position: relative;
}
.epg-timeline-item {
  display: flex;
  position: relative;
  padding-bottom: 12px;
}
.epg-timeline-item:last-child {
  padding-bottom: 0;
}
.epg-timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 16px;
  position: relative;
  width: 16px;
}
.epg-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-card);
  z-index: 2;
  transition: 0.3s;
  margin-top: 14px;
}
.epg-timeline-item.past .epg-timeline-dot {
  background: var(--text-muted);
  opacity: 0.5;
}
.epg-timeline-item.live .epg-timeline-dot {
  background: var(--accent);
  width: 14px;
  height: 14px;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.3), 0 0 10px var(--accent);
  animation: pulseDot 2s infinite;
  margin-top: 12px;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0px rgba(108, 92, 231, 0.5), 0 0 6px var(--accent); }
  70% { box-shadow: 0 0 0 6px rgba(108, 92, 231, 0), 0 0 12px var(--accent); }
  100% { box-shadow: 0 0 0 0px rgba(108, 92, 231, 0), 0 0 6px var(--accent); }
}
.epg-timeline-item.future .epg-timeline-dot {
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
}
.epg-timeline-line {
  position: absolute;
  top: 20px;
  bottom: -20px;
  width: 2px;
  background: var(--border);
  z-index: 1;
}
.epg-timeline-item.live .epg-timeline-line {
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
.epg-timeline-item.past .epg-timeline-line {
  background: var(--text-muted);
  opacity: 0.3;
}
.epg-timeline-item:last-child .epg-timeline-line {
  display: none;
}
.epg-timeline-content {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: 0.3s;
  text-align: left;
}
.epg-timeline-item.past .epg-timeline-content {
  opacity: 0.5;
  background: transparent;
  border-color: transparent;
}
.epg-timeline-item.live .epg-timeline-content {
  background: rgba(108, 92, 231, 0.08);
  border-color: rgba(108, 92, 231, 0.25);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.08);
  transform: scale(1.02);
}
.epg-timeline-content:hover {
  background: var(--hover-bg);
}
.epg-timeline-item.past .epg-timeline-content:hover {
  background: var(--hover-bg);
  opacity: 0.8;
}
.epg-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.epg-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.epg-timeline-item.live .epg-time {
  color: var(--accent);
}
.epg-live-badge {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--danger);
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.epg-live-badge i {
  font-size: 8px;
  animation: pulse 1.5s infinite;
}
.epg-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.epg-timeline-item.past .epg-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}
.epg-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.epg-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}



/* ===== Theater Mode Widescreen ===== */
.watch-wrap.theater-mode {
  grid-template-columns: 1fr;
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
.watch-wrap.theater-mode .watch-left {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}
.watch-wrap.theater-mode .player-wrap {
  border-radius: 0;
  max-width: 100%;
}
.watch-wrap.theater-mode .watch-right {
  max-width: 1400px;
  width: 100%;
  margin: 24px auto 0;
  padding: 0 24px;
}

/* ===== Voice Search Button ===== */
.voice-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  width: 34px;
  height: 34px;
}
.voice-btn:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.voice-btn.listening {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
  animation: pulseMic 1.5s infinite;
}
@keyframes pulseMic {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== Progress Bar Chapters Tooltip ===== */
.player-tooltip {
  position: absolute;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Interactive Timestamp Chapters Links ===== */
.timestamp-link {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  transition: 0.2s;
}
.timestamp-link:hover {
  color: #818cf8;
}



/* ===== YouTube Studio Table & Dashboard ===== */
.studio-stat-card {
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  transition: 0.3s;
}
.studio-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.studio-stat-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.studio-stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.studio-stat-label i {
  font-size: 16px;
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.studio-table th {
  background: var(--hover-bg);
  color: var(--text-muted);
  font-weight: 700;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.studio-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
  text-align: left;
}
.studio-table tr {
  transition: 0.2s;
}
.studio-table tr:hover {
  background: rgba(255, 255, 255, 0.015);
}
[data-theme="light"] .studio-table tr:hover {
  background: rgba(0, 0, 0, 0.01);
}
.studio-video-info {
  display: flex;
  align-items: center;
  gap: 16px;
}
.studio-thumb-wrap {
  width: 110px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border);
}
.studio-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.studio-video-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.studio-video-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  line-height: 1.4;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-video-title:hover {
  color: var(--accent);
}
.studio-video-date {
  font-size: 12px;
  color: var(--text-muted);
}
.studio-cat-badge {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Premium Date Input & Custom Select Enhancements ===== */
.premium-date-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
  transition: all 0.25s ease;
  font-family: inherit;
  width: 100%;
  max-width: 280px;
  outline: none;
  cursor: pointer;
}
.premium-date-input:hover {
  border-color: var(--accent);
  background: var(--hover-bg);
}
.premium-date-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.premium-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
  transition: 0.2s;
}
.premium-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* CS-Options max height and scrolling */
.cs-options {
  max-height: 260px;
  overflow-y: auto;
}
.cs-options::-webkit-scrollbar {
  width: 5px;
}
.cs-options::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 99px;
}

/* Country flag initials badges */
.country-flag-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.flag-ru { background: linear-gradient(135deg, #1e3c72, #2a5298); }
.flag-us { background: linear-gradient(135deg, #3a7bd5, #3a6073); }
.flag-de { background: linear-gradient(135deg, #f12711, #f5af19); }
.flag-fr { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.flag-gb { background: linear-gradient(135deg, #11998e, #38ef7d); }
.flag-kz { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.flag-ua { background: linear-gradient(135deg, #FFE000, #799F0C); }
.flag-by { background: linear-gradient(135deg, #134E5E, #71B280); }
.flag-az { background: linear-gradient(135deg, #0575E6, #00F260); }
.flag-ge { background: linear-gradient(135deg, #e55d87, #5fc3e4); }
.flag-am { background: linear-gradient(135deg, #F09819, #EDDE5D); }
.flag-tr { background: linear-gradient(135deg, #ff416c, #ff4b2b); }
.flag-jp { background: linear-gradient(135deg, #e1eec3, #f05053); }
.flag-cn { background: linear-gradient(135deg, #f857a6, #ff5858); }
.flag-es { background: linear-gradient(135deg, #f12711, #f5af19); }
.flag-it { background: linear-gradient(135deg, #11998e, #38ef7d); }
.flag-pl { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.flag-br { background: linear-gradient(135deg, #56ab2f, #a8ff78); }
.flag-other { background: linear-gradient(135deg, #434343, #000000); }

/* ===== TV Search Bar Styles ===== */
.tv-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border-radius: 99px;
  padding: 10px 18px;
  width: 100%;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.tv-search-bar:focus-within {
  border-color: var(--border-active);
  background: var(--bg-input);
}
.tv-search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

/* ===== Admin Panel Premium Styles ===== */
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.admin-stat-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-stat-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.admin-stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Colors for admin stat icon wrap gradients */
.asc-users { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.asc-videos { background: linear-gradient(135deg, #10b981, #059669); }
.asc-comments { background: linear-gradient(135deg, #ef4444, #dc2626); }
.asc-sessions { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.asc-database { background: linear-gradient(135deg, #f59e0b, #d97706); }
.asc-uploads { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

/* Inputs in admin table */
.premium-admin-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
  outline: none;
}
.premium-admin-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

/* Alany OAuth Button Styles */
.alany-auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff !important;
  border-radius: 99px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  margin-bottom: 12px;
}
.alany-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, #4f46e5, #4338ca);
}

/* TV Channel Thumb styling to prevent stretching */
.vid-thumb.tv-thumb {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #15151a !important;
  height: 0 !important;
  padding-bottom: 56.25% !important; /* Perfect 16:9 ratio across all platforms and engines */
  position: relative !important;
  border: 1px solid var(--border);
}
.vid-thumb.tv-thumb img {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-width: 65% !important;
  max-height: 60% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
.tv-placeholder {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: var(--text-secondary);
  width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



/* ================= CLEAN MONOCHROME OVERRIDE (NO ACCENT GLOW) ================= */
:root {
  --accent: #ffffff !important;
  --accent-color: #ffffff !important;
  --accent-hover: #e5e7eb !important;
  --accent-text: #0b0d12 !important;
  --accent-glow: none !important;
  --primary: #ffffff !important;
  --primary-glow: none !important;
}

[data-theme="light"] {
  --accent: #0f172a !important;
  --accent-color: #0f172a !important;
  --accent-hover: #1e293b !important;
  --accent-text: #ffffff !important;
  --primary: #0f172a !important;
}

/* Remove colored purple/green accents and glows on tabs, icons, logo */
.settings-tab.active,
.settings-nav-btn.active,
.settings-nav-item.active,
.settings-pill.active,
.tab-btn.active,
.nav-tab.active,
[class*="settings"] .active {
  background: var(--accent) !important;
  color: var(--accent-text) !important;
  box-shadow: none !important;
}

.settings-tab.active *,
.settings-nav-btn.active *,
.settings-nav-item.active *,
.settings-pill.active *,
.tab-btn.active *,
.nav-tab.active *,
[class*="settings"] .active * {
  color: var(--accent-text) !important;
}

.settings-label i,
.settings-label svg,
.form-label i,
.form-label svg,
.logo-sub,
.brand-sub,
.video-tag {
  color: var(--text-secondary, #9ca3af) !important;
  text-shadow: none !important;
}

.brand-mark,
.logo-img,
.sidebar-logo img {
  box-shadow: none !important;
  filter: none !important;
  border-radius: 10px !important;
}
