/* =========================================
   Top10Live — Custom Dark Theme Stylesheet
   ========================================= */

:root {
  --bg-body: #0b0e14;
  --bg-surface: #141922;
  --bg-surface-hover: #1c2333;
  --bg-player: #000000;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 10px;
  --radius-sm: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans Bengali', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.ambient {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  pointer-events: none; z-index: -1;
}

.page { max-width: 1400px; margin: 0 auto; padding: 10px; }

.notice-board {
  background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 8px 12px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px; overflow: hidden;
}
.notice-tag { background: var(--accent); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.notice-track-wrap { overflow: hidden; flex: 1; }
.notice-track { display: flex; align-items: center; gap: 20px; white-space: nowrap; animation: marquee 30s linear infinite; font-size: 13px; color: var(--text-secondary); }
.notice-dot { font-size: 6px; color: var(--accent); }
@keyframes marquee { 0% { transform: translateX(0%); } 100% { transform: translateX(-50%); } }

.site-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), #8b5cf6); border-radius: 10px; display: flex; justify-content: center; align-items: center; color: #fff; font-size: 18px; box-shadow: 0 4px 15px var(--accent-glow); }
.brand-text { font-size: 24px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.brand-text span { color: var(--accent); }
.header-meta { display: flex; align-items: center; gap: 15px; font-weight: 600; color: var(--text-secondary); }
.live-badge { background: rgba(239, 68, 68, 0.15); color: var(--danger); padding: 4px 10px; border-radius: 4px; font-size: 12px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.dot { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

.filter-bar { display: flex; gap: 8px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-color); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.3s; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.filter-pill:hover { background: var(--bg-surface-hover); border-color: var(--text-muted); }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-pip { width: 8px; height: 8px; border-radius: 50%; }
.cnt { font-size: 11px; opacity: 0.8; }

.main-layout { display: flex; gap: 12px; height: 65vh; min-height: 400px; }

.sidebar { width: 280px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.sidebar-title { font-weight: 700; font-size: 14px; color: var(--text-secondary); }
.sidebar-title b { color: var(--accent); margin-left: 4px; }
.icon-btn { width: 32px; height: 32px; display: flex; justify-content: center; align-items: center; background: transparent; border: none; color: var(--text-muted); cursor: pointer; border-radius: 6px; transition: all 0.2s; }
.icon-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.search-bar { padding: 8px 14px; display: none; border-bottom: 1px solid var(--border-color); }
.search-bar.open { display: flex; align-items: center; gap: 8px; background: var(--bg-body); }
.search-bar .si { color: var(--text-muted); font-size: 14px; }
.search-bar input { background: transparent; border: none; outline: none; color: var(--text-primary); font-family: inherit; font-size: 13px; width: 100%; }
.search-bar input::placeholder { color: var(--text-muted); }

.channel-list { flex: 1; overflow-y: auto; padding: 6px; scrollbar-width: thin; scrollbar-color: var(--bg-surface-hover) transparent; }
.channel-list::-webkit-scrollbar { width: 4px; }
.channel-list::-webkit-scrollbar-thumb { background: var(--bg-surface-hover); border-radius: 4px; }
.no-results { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px; }
.no-results i { font-size: 24px; margin-bottom: 10px; display: block; }

.channel-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s; }
.channel-item:hover { background: var(--bg-surface-hover); }
.channel-item.active { background: rgba(59, 130, 246, 0.1); border-left: 3px solid var(--accent); }
.ch-logo { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; justify-content: center; align-items: center; font-weight: 800; font-size: 16px; color: #fff; flex-shrink: 0; overflow: hidden; }
.ch-logo img { width: 100%; height: 100%; object-fit: cover; }
.fb { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background: var(--bg-surface-hover); color: var(--accent); }
.ch-name { font-size: 13px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.cat-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.ch-type { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; margin-left: auto; }
.channel-item.active .eq { display: flex; }
.eq span { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 0.8s infinite ease-in-out alternate; }
.eq span:nth-child(1) { height: 4px; animation-delay: 0s; }
.eq span:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.eq span:nth-child(3) { height: 6px; animation-delay: 0.4s; }
.eq span:nth-child(4) { height: 12px; animation-delay: 0.1s; }
@keyframes eq { 0% { height: 4px; } 100% { height: 16px; } }

.sidebar-fade { position: absolute; left: 0; right: 0; height: 30px; pointer-events: none; z-index: 2; opacity: 0; transition: opacity 0.3s; }
.sidebar-fade.visible { opacity: 1; }
.top-fade { top: 50px; background: linear-gradient(to bottom, var(--bg-surface), transparent); }
.bottom-fade { bottom: 0; background: linear-gradient(to top, var(--bg-surface), transparent); }
.sidebar-scroll-btns { display: none; flex-direction: column; position: absolute; bottom: 10px; right: 10px; z-index: 3; gap: 4px; }
.sidebar-scroll-btns.show { display: flex; }
.sb-scroll-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 12px; box-shadow: 0 2px 8px var(--accent-glow); }
.mobile-nav { display: none; }

.player-area { flex: 1; display: flex; flex-direction: column; }

.player-wrap { 
  flex: 1; 
  background: var(--bg-player); 
  border-radius: var(--radius); 
  overflow: hidden; 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  border: 1px solid var(--border-color); 
}

.player-host { 
  flex: 1; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  position: relative; 
  z-index: 1; 
}

.player-host video { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
  display: block;
}

.player-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; z-index: 5; backdrop-filter: blur(4px); }
.player-overlay.hidden { display: none; }
.loader-ring { width: 40px; height: 40px; border: 3px solid rgba(255, 255, 255, 0.1); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; display: none; }
.loader-ring.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-channel { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: #fff; }
.overlay-url { font-size: 11px; color: var(--text-muted); max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay-play, .overlay-retry { background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; display: none; align-items: center; gap: 6px; font-family: inherit; transition: transform 0.2s, background 0.2s; }
.overlay-play.show, .overlay-retry.show { display: flex; }
.overlay-play:hover, .overlay-retry:hover { background: #2563eb; transform: scale(1.05); }
.overlay-retry { background: rgba(255, 255, 255, 0.1); font-size: 12px; padding: 6px 12px; }
.overlay-retry:hover { background: rgba(255, 255, 255, 0.2); }

.player-controls { 
  display: flex; justify-content: space-between; align-items: center; 
  padding: 6px 10px; 
  background: #0f1219; border-top: 1px solid var(--border-color); 
  position: relative; z-index: 50; flex-shrink: 0;
}
.ctrl-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctrl-btn { background: transparent; border: none; color: #ffffff; font-size: 14px; cursor: pointer; padding: 4px; transition: color 0.2s; }
.ctrl-btn:hover, .ctrl-btn.active { color: var(--accent); }
.volume-slider { width: 70px; height: 4px; -webkit-appearance: none; appearance: none; background: #3a3f4b; border-radius: 2px; outline: none; cursor: pointer; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--accent); border-radius: 50%; cursor: pointer; }

.bridge-line { height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); margin: 12px 0; opacity: 0.3; }
.carousel-section { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.carousel-viewport { flex: 1; overflow: hidden; }
.thumb-track { display: flex; gap: 10px; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.thumb { width: 80px; height: 55px; flex-shrink: 0; border-radius: var(--radius-sm); border: 2px solid var(--border-color); display: flex; justify-content: center; align-items: center; font-size: 12px; font-weight: 700; color: #fff; cursor: pointer; transition: all 0.3s; overflow: hidden; position: relative; background: var(--bg-surface); }
.thumb:hover { border-color: var(--text-muted); transform: translateY(-2px); }
.thumb.active { border-color: var(--accent); box-shadow: 0 4px 15px var(--accent-glow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.carousel-nav { width: 30px; height: 30px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; flex-shrink: 0; }
.carousel-nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.utility-row { display: flex; gap: 10px; margin-bottom: 12px; }
.util-btn { flex: 1; padding: 10px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 600; font-family: inherit; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 8px; transition: all 0.2s; }
.util-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); border-color: var(--text-muted); }
.site-footer { text-align: center; font-size: 11px; color: var(--text-muted); padding: 10px 0; border-top: 1px solid var(--border-color); }

.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; max-width: 400px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal h2 { font-size: 18px; margin-bottom: 15px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.modal ul li { padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 10px; }
.modal ul li i { color: var(--accent); width: 16px; text-align: center; }
.modal-close { width: 100%; padding: 10px; margin-top: 15px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.2s; }
.modal-close:hover { background: #2563eb; }

.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--bg-surface); border: 1px solid var(--border-color); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); box-shadow: 0 4px 15px rgba(0,0,0,0.3); animation: slideIn 0.3s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.error i { color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.info i { color: var(--accent); }
.toast.removing { animation: slideOut 0.3s ease-in forwards; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }


/* ==========================================
   মোবাইল লেআউট
   ========================================== */
@media (max-width: 768px) {
  .page {
    max-width: 100%; padding: 5px;
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden; 
  }

  .notice-board { margin-bottom: 4px; padding: 4px 8px; }
  .notice-tag { font-size: 10px; padding: 3px 6px; }
  .notice-track { font-size: 11px; gap: 15px; }
  
  .site-header { padding: 5px 0; }
  .brand-icon { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }
  .brand-text { font-size: 16px; }
  .header-meta { font-size: 11px; gap: 8px; }
  .live-badge { font-size: 10px; padding: 2px 6px; }

  .filter-bar { padding-bottom: 6px; gap: 6px; }
  .filter-pill { padding: 6px 12px; font-size: 12px; border-radius: 16px; }
  .cat-pip { width: 7px; height: 7px; }
  .cnt { font-size: 10px; }

  .main-layout {
    flex-direction: column; height: auto;
    flex: 1; min-height: 0; gap: 5px; overflow: hidden;
  }

  .player-area { 
    order: 1; flex: 0 0 35vh; 
    min-height: 160px; max-height: 250px;
  }
  
  .player-controls { padding: 3px 6px; z-index: 50; }
  .ctrl-btn { font-size: 12px; color: #ffffff; padding: 2px; }
  .volume-slider { width: 40px; height: 3px; background: #3a3f4b; }
  .volume-slider::-webkit-slider-thumb { width: 10px; height: 10px; }

  .sidebar {
    width: 100%; order: 2; flex: 1; min-height: 0;
    background: linear-gradient(135deg, #101520 0%, #141922 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); overflow: hidden;
    padding-bottom: 10px; 
  }

  .sidebar-top { padding: 6px 8px; border-bottom: 1px solid var(--border-color); }
  .sidebar-title { font-size: 11px; }
  .icon-btn { width: 24px; height: 24px; font-size: 11px; }

  .channel-list {
    display: flex; flex-direction: row; 
    overflow-x: auto; overflow-y: hidden; 
    flex-wrap: nowrap; padding: 10px 8px; gap: 12px;
    height: 100%; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; 
    align-items: flex-start; 
  }

  .channel-list::-webkit-scrollbar { display: none; }

  .channel-item {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    padding: 10px 2px 6px 2px; 
    text-align: center;
    background: var(--bg-body);
    border-radius: 20px; 
    border: 1px solid var(--border-color);
    min-width: 72px; 
    max-width: 72px;
    flex-shrink: 0; 
  }

  .channel-item.active {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid var(--accent); 
  }

  .ch-logo { 
    width: 50px; 
    height: 50px; 
    margin: 0 auto 5px auto; 
    border-radius: 50%; 
    border: 2px solid var(--border-color);
  }
  
  .ch-name { 
    font-size: 9px; 
    justify-content: center; 
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 3px;
    color: var(--text-primary);
    font-weight: 600;
  }
  
  .ch-type { display: none; }
  .eq { display: none !important; }

  .search-bar { display: none !important; }
  .mobile-nav { display: none !important; }
  .sidebar-fade, .sidebar-scroll-btns { display: none !important; }
  
  .bridge-line { display: none; }
  .carousel-section { display: none; }
  
  .utility-row {
    order: 3; display: flex; margin-bottom: 0; margin-top: 5px;
    gap: 5px; flex-shrink: 0;
  }
  .util-btn { padding: 8px; font-size: 12px; border-radius: 6px; }
  .util-btn i { font-size: 12px; }

  .site-footer {
    order: 4; display: block; font-size: 9px;
    padding: 5px 0 5px 0; border-top: 1px solid var(--border-color); flex-shrink: 0;
  }
}