/* ===================================================
   StreamHub IPTV - Modern Streaming Platform Styles
   =================================================== */

:root {
  --bg-main: #0b0e14;
  --bg-surface: #121721;
  --bg-card: #182030;
  --bg-card-hover: #222c42;
  --bg-elevated: #1e2638;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-gold: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #273349;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b4b68;
}

/* Utilities */
.hidden {
  display: none !important;
}

.pulsing {
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ===================================================
   BUTTONS & FORM ELEMENTS
   =================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ===================================================
   LOGIN VIEW
   =================================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: radial-gradient(circle at 50% 20%, #151d30 0%, #0b0e14 70%);
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: rgba(18, 23, 33, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  z-index: 10;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo), var(--accent-pink));
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.nav-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Admin Modal Tabs & Tables */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.admin-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.admin-tab.active {
  background: var(--accent-blue);
  color: #fff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.role-pill {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.role-pill.admin {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
}
.role-pill.viewer {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}

.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-brand h1 span {
  color: var(--accent-blue);
}

.login-brand .tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Quick Login Card */
.quick-login-card {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.quick-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-blue);
  margin-bottom: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  display: inline-block;
}
.status-dot.pulsing {
  background: var(--accent-blue);
}

.quick-details {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.detail-row:last-child {
  margin-bottom: 0;
}
.detail-row .label {
  color: var(--text-muted);
}
.detail-row .val {
  color: var(--text-primary);
  font-family: monospace;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.divider span {
  padding: 0 12px;
}

/* Form inputs */
.input-group {
  margin-bottom: 16px;
}
.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper i {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-wrapper input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.9rem;
  transition: var(--transition);
}
.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.login-error {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fca5a5;
  font-size: 0.85rem;
}
.login-error i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===================================================
   MAIN DASHBOARD LAYOUT
   =================================================== */

.main-dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navbar */
.navbar {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon i {
  width: 20px;
  height: 20px;
  color: #fff;
}
.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.brand-text span {
  color: var(--accent-blue);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.nav-tab i {
  width: 16px;
  height: 16px;
}
.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-tab.active {
  color: #fff;
  background: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Single Unified Master Navigation Tab */
.single-nav {
  background: transparent;
  padding: 0;
}

.nav-tab-dropdown-wrapper {
  position: relative;
  display: inline-flex;
}

.master-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(79, 70, 229, 0.3));
  border: 1px solid rgba(59, 130, 246, 0.5);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
  transition: all 0.25s ease;
}

.master-nav-btn:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(79, 70, 229, 0.45));
  border-color: rgba(96, 165, 250, 0.8);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

/* Dancing Animated Triangle / Chevron */
.dancing-triangle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  animation: danceBounce 1.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.dancing-triangle i,
.dancing-triangle svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.6;
}

@keyframes danceBounce {
  0%, 100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  20% {
    transform: translateY(4px) scale(1.3) rotate(-14deg);
    color: #60a5fa;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 1));
  }
  40% {
    transform: translateY(-3px) scale(1.1) rotate(12deg);
    color: #38bdf8;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9));
  }
  60% {
    transform: translateY(3px) scale(1.22) rotate(-8deg);
    color: #818cf8;
    filter: drop-shadow(0 0 9px rgba(129, 140, 248, 0.9));
  }
  80% {
    transform: translateY(-1px) scale(1.05) rotate(4deg);
    color: #38bdf8;
  }
}

.nav-tab-dropdown-wrapper.open .dancing-triangle {
  animation: none;
  transform: rotate(180deg) scale(1.15);
  color: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.9));
}

.nav-tab-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: rgba(18, 23, 33, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 15px rgba(59, 130, 246, 0.2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 300;
  animation: slideInDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab-dropdown-menu.hidden {
  display: none !important;
}

.dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.dropdown-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dropdown-option.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
}
.dropdown-option i {
  width: 16px;
  height: 16px;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navbar Search */
.nav-center {
  flex: 1;
  max-width: 440px;
  margin: 0 20px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar i {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  padding: 9px 38px 9px 40px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.85rem;
  transition: var(--transition);
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.55);
}
.clear-search {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-green);
  cursor: pointer;
  transition: var(--transition);
}
.sub-pill:hover {
  background: rgba(16, 185, 129, 0.2);
}
.sub-pill .sep {
  color: rgba(255, 255, 255, 0.2);
}

/* ===================================================
   CONTENT BODY & SIDEBAR
   =================================================== */

.content-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Category Sidebar */
.sidebar {
  width: 290px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-search {
  padding: 10px 16px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-search i {
  position: absolute;
  left: 26px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}
.sidebar-search input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.8rem;
}
.sidebar-search input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.category-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.category-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.category-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  font-weight: 700;
  border-left: 3px solid var(--accent-blue);
}
.category-item .cat-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

/* ===================================================
   STREAM CATALOG & CHANNELS GRID
   =================================================== */

.stream-catalog {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 32px;
  background: var(--bg-main);
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Grid Layout */
.streams-grid.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* Stream Card */
.stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.stream-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card-thumb {
  height: 125px;
  background: #0f1522;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}
.card-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: var(--transition);
}
.stream-card:hover .card-thumb img {
  transform: scale(1.08);
}

/* Fallback channel icon */
.thumb-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.stream-card:hover .card-play-overlay {
  opacity: 1;
}
.play-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
  transform: scale(0.85);
  transition: var(--transition);
}
.stream-card:hover .play-badge {
  transform: scale(1);
}

.card-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 5;
}
.card-favorite-btn:hover {
  color: var(--accent-gold);
  background: rgba(0, 0, 0, 0.85);
}
.card-favorite-btn.favorited {
  color: var(--accent-gold);
}

.card-details {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}
.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.card-tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.card-tag.live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  font-weight: 700;
}

/* List Mode Layout */
.streams-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.streams-grid.list-mode .stream-card {
  flex-direction: row;
  align-items: center;
  padding: 10px 16px;
}
.streams-grid.list-mode .card-thumb {
  width: 60px;
  height: 40px;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.streams-grid.list-mode .card-details {
  padding: 0 16px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}
.streams-grid.list-mode .card-title {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Loading & Empty States */
.loading-state,
.streams-loader,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  gap: 12px;
}
.empty-state i {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.large {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================================
   THEATER VIDEO PLAYER
   =================================================== */

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.player-theater {
  position: relative;
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.player-header {
  height: 54px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  transition: opacity 0.3s ease;
}

.now-playing-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
}
.live-tag .dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.2s infinite;
}
.now-playing-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.now-playing-info .cat-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.close-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}

/* Video Container */
.video-container {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

video#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Buffering Spinner */
.player-spinner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px 30px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(6px);
  z-index: 15;
}

/* Error Overlay */
.player-error {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: rgba(20, 10, 10, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 28px 36px;
  border-radius: var(--radius-lg);
  text-align: center;
  z-index: 15;
}
.player-error i {
  width: 44px;
  height: 44px;
  color: var(--accent-red);
}

/* Custom Controls Bar */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
  transition: opacity 0.3s ease;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.volume-container input[type="range"] {
  width: 75px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.stream-badge-info {
  margin-left: 10px;
}
.stream-badge-info span {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

/* Quick Channel Drawer inside Player */
.player-drawer {
  position: absolute;
  top: 54px;
  bottom: 64px;
  right: -320px;
  width: 300px;
  background: rgba(18, 23, 33, 0.95);
  backdrop-filter: blur(14px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
}
.player-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.drawer-header h4 {
  font-size: 0.88rem;
  font-weight: 700;
}

.drawer-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}
.drawer-search input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.78rem;
}
.drawer-search input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.drawer-channels {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.drawer-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.drawer-channel-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.drawer-channel-item.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  font-weight: 700;
}
.drawer-channel-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* ===================================================
   MODALS & TOASTS
   =================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-blue);
}
.title-with-icon h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.modal-body {
  padding: 20px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===================================================
   LIVE MATCHES & SCORES STYLES
   =================================================== */

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
}

.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.75rem;
}
.match-league {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
}
.match-league img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.match-status-badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.match-status-badge.live {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.match-status-badge.live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

.match-teams-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}
.match-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}
.match-team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.match-team-name {
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-score-center {
  padding: 0 12px;
  text-align: center;
}
.score-numbers {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.score-vs {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.match-actions {
  display: flex;
  gap: 8px;
}
.match-actions .btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 0.8rem;
}

/* Win Rate Probability Bar */
.win-rate-section {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}
.win-rate-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.win-rate-bar {
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.rate-seg {
  height: 100%;
  transition: width 0.4s ease;
}
.rate-seg.home { background: var(--accent-blue); }
.rate-seg.draw { background: var(--text-muted); }
.rate-seg.away { background: var(--accent-pink); }

.win-rate-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
}
.label-home { color: var(--accent-blue); }
.label-draw { color: var(--text-secondary); }
.label-away { color: var(--accent-pink); }

/* Lineups View */
.lineups-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lineup-team-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
}
.lineup-team-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.formation-tag {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.player-row {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  gap: 8px;
  padding: 3px 0;
}
.player-num {
  width: 20px;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.player-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.player-pos {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Match Stats Table */
.stats-table {
  width: 100%;
  font-size: 0.82rem;
}
.stats-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}
.stats-table .stat-label {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}
.stats-table .stat-val-h {
  text-align: left;
  font-weight: 700;
  color: var(--accent-blue);
}
.stats-table .stat-val-a {
  text-align: right;
  font-weight: 700;
  color: var(--accent-pink);
}

@media (max-width: 900px) {
  .sidebar {
    width: 220px;
  }
  .stream-catalog {
    padding: 16px;
  }
  .player-theater {
    width: 96vw;
    height: 90vh;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 14px;
  }
  .nav-left {
    gap: 14px;
  }
  .nav-center {
    display: none;
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 64px;
    bottom: 0;
    width: 260px;
    z-index: 50;
    transition: left 0.3s ease;
  }
  .sidebar.mobile-open {
    left: 0;
  }
}
