/* ============================================
   SMARTVIEW DASHBOARD - Small Apps Theme
   ============================================ */

/* Import Small Apps Base Styles */
@import url('small-apps/css/style.css');

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #5b4fff;
  --primary-dark: #4a3ecc;
  --secondary: #ff4f7b;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #e9ecef;
  --text: #212529;
  --text-muted: #6c757d;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --sidebar-width: 260px;
  --topbar-height: 70px;
}

/* Dark Mode */
body.dark-mode {
  --bg: #0f0f1e;
  --surface: #1a1a2e;
  --border: #2d2d44;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
}

body.dark-mode .sidebar {
  background: #16162a;
  border-right-color: var(--border);
}

body.dark-mode .content-poster {
  background: linear-gradient(135deg, #4a3f7a 0%, #5a3f6a 100%);
}

body.dark-mode .stat-card {
  background: linear-gradient(135deg, #1e1e3f 0%, #2a2a4a 100%);
}

body.dark-mode .btn-primary {
  box-shadow: 0 4px 12px rgba(91, 79, 255, 0.4);
}

body.dark-mode .btn-primary:hover {
  box-shadow: 0 6px 16px rgba(91, 79, 255, 0.5);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: rgba(91, 79, 255, 0.1);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 14px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-logout:hover {
  background: #c82333;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--primary);
}

/* ── LANGUAGE SELECTOR ── */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--primary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 1000;
}

.lang-dropdown.hidden {
  display: none;
}

.lang-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.lang-option:hover {
  background: var(--bg);
}

/* ── CONTENT AREA ── */
.content-area {
  padding: 30px;
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(91, 79, 255, 0.1);
  color: var(--primary);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

/* ── BUTTONS ── */
.btn-primary {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 79, 255, 0.3);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary);
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  color: var(--text-muted);
}

/* ── TABLES ── */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg);
}

th {
  padding: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

tr:hover {
  background: var(--bg);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--surface);
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.error {
  background: var(--danger);
  color: white;
}

.toast.success {
  background: var(--success);
  color: white;
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  font-size: 14px;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .top-bar {
    padding: 0 20px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  .content-area {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}


/* ── ADDITIONAL DASHBOARD STYLES ── */

/* Playlist Grid */
.playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.playlist-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.playlist-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.playlist-type {
  font-size: 12px;
  padding: 4px 8px;
  background: rgba(91, 79, 255, 0.1);
  color: var(--primary);
  border-radius: 4px;
  text-transform: uppercase;
}

.playlist-info {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.playlist-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-edit {
  background: var(--info);
  color: white;
}

.btn-edit:hover {
  background: #138496;
}

.btn-delete {
  background: var(--danger);
  color: white;
}

.btn-delete:hover {
  background: #c82333;
}

.btn-sync {
  background: var(--success);
  color: white;
}

.btn-sync:hover {
  background: #218838;
}

/* ============================================
   CHANNELS PAGE LAYOUT
   ============================================ */

/* Channels Layout - Two Column (Sidebar + Main) */
.channels-layout {
  display: flex;
  gap: 20px;
  min-height: 500px;
}

/* Category Sidebar */
.category-sidebar {
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  flex-shrink: 0;
}

.category-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.category-sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.btn-icon-small {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-icon-small:hover {
  background: var(--bg);
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid transparent;
}

.category-item:hover {
  background: rgba(91, 79, 255, 0.05);
  border-color: var(--primary);
}

.category-item.active {
  background: rgba(91, 79, 255, 0.1);
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
}

.category-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}

.category-item.active .category-count {
  background: var(--primary);
  color: white;
}

/* Channels Main Content */
.channels-main {
  flex: 1;
  min-width: 0; /* Important for flex overflow */
}

.channels-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-height: 400px;
}

/* Content Grid for Movies & Series */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.content-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(91, 79, 255, 0.2);
}

.content-poster {
  width: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
  position: relative;
}

.content-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-poster::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.content-card:hover .content-poster::after {
  opacity: 1;
}

.content-info {
  padding: 16px;
  flex: 1;
}

.content-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.content-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-play {
  width: 100%;
  padding: 10px 16px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-play:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 79, 255, 0.3);
}

.btn-vlc {
  width: 100%;
  padding: 10px 16px;
  background: #ff8800;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-vlc:hover {
  background: #e67700;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 136, 0, 0.3);
}

.btn-info {
  width: 100%;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-info:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

/* Content Tabs */
.content-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}

.content-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.content-tab:hover {
  background: rgba(91, 79, 255, 0.05);
  border-color: var(--primary);
}

.content-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tab-icon {
  font-size: 18px;
}

.tab-label {
  font-weight: 600;
}

.btn-info-help {
  margin-left: auto;
  padding: 10px 16px;
  background: var(--info);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.btn-info-help:hover {
  background: #138496;
  transform: scale(1.05);
}

/* Page Header (Search + Filter) */
.page-header {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 79, 255, 0.1);
}

.filter-select {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Channels Table */
.channels-table {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 18px;
  font-weight: 700;
}

.table-actions {
  display: flex;
  gap: 12px;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.category-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.category-card.category-hidden {
  opacity: 0.5;
  background: rgba(0,0,0,0.02);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.category-count {
  font-size: 14px;
  color: var(--text-muted);
}

.category-status {
  font-size: 12px;
  color: var(--warning);
  margin-top: 8px;
}

.category-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Content Tabs */
.content-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.content-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-tab:hover {
  color: var(--text);
}

.content-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-icon {
  font-size: 16px;
}

.tab-label {
  font-size: 14px;
}

/* Subscription Card */
.subscription-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
}

.subscription-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.subscription-plan {
  font-size: 24px;
  font-weight: 700;
}

.subscription-status {
  padding: 6px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.subscription-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 13px;
  opacity: 0.8;
}

.info-value {
  font-size: 18px;
  font-weight: 600;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Form Elements */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-desc {
  font-size: 14px;
  margin-bottom: 20px;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.page-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.page-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ============================================
   MOBILE RESPONSIVE DESIGN
   ============================================ */

/* Hamburger Menu Button */
.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
  background: var(--primary);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(91, 79, 255, 0.3);
  transition: all 0.3s;
}

.menu-toggle:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.menu-toggle:active {
  transform: scale(0.95);
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* Show hamburger menu */
  .menu-toggle {
    display: flex;
  }

  /* Hide sidebar by default */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  /* Show sidebar when active */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Show overlay when sidebar is active */
  .sidebar-overlay {
    display: block;
  }

  /* Adjust main content */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Adjust top bar */
  .top-bar {
    padding-left: 70px; /* Space for hamburger button */
  }

  /* Make page title smaller */
  .page-title {
    font-size: 20px;
  }

  /* Stack top actions vertically if needed */
  .top-actions {
    gap: 8px;
  }

  /* Make stats grid single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Make playlists grid single column */
  .playlists-grid {
    grid-template-columns: 1fr;
  }

  /* Make categories grid single column */
  .categories-grid {
    grid-template-columns: 1fr;
  }

  /* Content grid - 2 columns on mobile */
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .content-poster {
    font-size: 2rem;
  }

  .content-info {
    padding: 12px;
  }

  .content-name {
    font-size: 0.85rem;
  }

  .content-category {
    font-size: 0.75rem;
  }

  .content-actions {
    padding: 10px 12px;
    gap: 6px;
  }

  .btn-play,
  .btn-vlc {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  .btn-info {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Channels Layout - Stack vertically on mobile */
  .channels-layout {
    flex-direction: column;
  }

  .category-sidebar {
    width: 100%;
    max-height: 300px;
    margin-bottom: 20px;
  }

  .channels-main {
    width: 100%;
  }

  /* Content tabs - make scrollable */
  .content-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .content-tab {
    flex-shrink: 0;
  }

  /* Page header - stack vertically */
  .page-header {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  /* Adjust table for mobile */
  .channels-table {
    font-size: 14px;
  }

  .channels-table th,
  .channels-table td {
    padding: 10px 8px;
  }

  /* Hide some table columns on very small screens */
  @media (max-width: 480px) {
    .channels-table th:nth-child(3),
    .channels-table td:nth-child(3) {
      display: none; /* Hide category column */
    }
  }

  /* Adjust subscription card */
  .subscription-card {
    padding: 20px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .menu-toggle {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .top-bar {
    padding: 15px;
    padding-left: 60px;
  }

  .page-title {
    font-size: 18px;
  }

  .btn-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  /* Content grid - smaller cards on very small screens */
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .content-poster {
    font-size: 1.5rem;
  }

  .content-info {
    padding: 10px;
  }

  .content-name {
    font-size: 0.8rem;
  }

  .content-actions {
    padding: 8px 10px;
  }

  .btn-play,
  .btn-vlc {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}


/* ============================================
   LIVE TV CHANNELS LIST
   ============================================ */

.live-channels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s;
}

.channel-row:hover {
  border-color: var(--primary);
  background: rgba(91, 79, 255, 0.04);
  transform: translateX(2px);
}

/* Logo */
.channel-logo-wrap {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-logo-fallback {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Info */
.channel-info {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.channel-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.channel-category-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(91, 79, 255, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.channel-type-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(23, 162, 184, 0.1);
  color: var(--info);
  border-radius: 20px;
  font-weight: 600;
}

/* Actions */
.channel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-channel-play {
  padding: 7px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-channel-play:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(91, 79, 255, 0.3);
}

.btn-channel-icon {
  width: 34px;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-channel-icon:hover {
  background: var(--surface);
  border-color: var(--primary);
}

.btn-channel-icon.danger:hover {
  background: rgba(220, 53, 69, 0.1);
  border-color: var(--danger);
}

/* Mobile */
@media (max-width: 600px) {
  .channel-row {
    gap: 10px;
    padding: 8px 10px;
  }

  .channel-logo-wrap {
    width: 40px;
    height: 40px;
  }

  .channel-logo-fallback {
    font-size: 18px;
  }

  .channel-name {
    font-size: 13px;
  }

  .btn-channel-play {
    padding: 6px 10px;
    font-size: 12px;
  }

  .btn-channel-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .channel-type-badge {
    display: none;
  }
}

/* ── TABS STYLING ── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 10px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91, 79, 255, 0.3);
}

/* ── FORM STYLING ── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 79, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--text2);
  opacity: 0.6;
}

/* Force: tab-btn text color override inline styles */
button.tab-btn[data-tab] {
  color: #555 !important;
}

button.tab-btn[data-tab].active {
  color: #fff !important;
  background: #5b4fff !important;
}

/* Tab Content Switching */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}
