/**
 * style.css - Estilos completos para reproductor y panel
 * Compatible: Cloudflare Pages, Tailscale, Pendrive Offline
 * Responsive: Móvil y escritorio
 * Incluye estilos anti-captura
 */

:root {
  /* Tema principal - Estilo WhatsApp/Profesional */
  --bg-primary: #0f1419;
  --bg-secondary: #1a232e;
  --bg-tertiary: #202c38;
  --bg-card: #1f2c3a;
  --bg-hover: #2a3f54;
  --bg-input: #15202b;

  --text-primary: #e8eef4;
  --text-secondary: #8b9cb3;
  --text-muted: #627488;
  --text-inverse: #0f1419;

  --accent-primary: #00a884;
  --accent-primary-hover: #00c896;
  --accent-primary-dim: rgba(0, 168, 132, 0.15);
  --accent-secondary: #0077b5;
  --accent-danger: #e0245e;
  --accent-warning: #ffad1f;
  --accent-info: #34b7f1;

  --border-primary: #2a3f54;
  --border-secondary: #3a4f63;
  --border-focus: #00a884;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 168, 132, 0.3);

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

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-anti-capture: 2147483640;
}

/* Tema claro (opcional) */
@media (prefers-color-scheme: light) {
  :root:not(.dark) {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8ebef;
    --bg-card: #ffffff;
    --bg-hover: #e8ebef;
    --bg-input: #f0f2f5;

    --text-primary: #1c1e21;
    --text-secondary: #65676b;
    --text-muted: #8a8d91;

    --border-primary: #dcdfe3;
    --border-secondary: #ccd0d5;
  }
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-primary-hover); }

code, pre { font-family: var(--font-mono); font-size: 0.875em; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-secondary); }

/* Layout principal */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header / Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.navbar-brand svg { width: 32px; height: 32px; color: var(--accent-primary); }

.navbar-nav { display: flex; align-items: center; gap: 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  background: transparent;
  border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-primary);
}

.nav-link svg { width: 20px; height: 20px; }

/* Indicador de red */
.network-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.network-indicator.online { background: var(--accent-primary-dim); color: var(--accent-primary); }
.network-indicator.tailscale { background: rgba(52, 183, 241, 0.15); color: var(--accent-info); }
.network-indicator.offline { background: rgba(224, 36, 94, 0.15); color: var(--accent-danger); }

.network-indicator::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Main content */
.main-content {
  flex: 1;
  padding: 24px 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto;
}

/* Search & Filters */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.search-box { flex: 1; min-width: 280px; position: relative; }

.search-input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.search-input::placeholder { color: var(--text-muted); }

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
}

.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-btn {
  padding: 10px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent-primary-dim);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Channels Grid */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.channel-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.channel-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.channel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.channel-card:hover .channel-thumb img { transform: scale(1.05); }

.channel-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-youtube { background: rgba(255, 0, 0, 0.2); color: #ff4444; border: 1px solid rgba(255, 0, 0, 0.3); }
.badge-vimeo { background: rgba(26, 183, 234, 0.2); color: #1ab7ea; border: 1px solid rgba(26, 183, 234, 0.3); }
.badge-twitch { background: rgba(100, 65, 165, 0.2); color: #bf94ff; border: 1px solid rgba(100, 65, 165, 0.3); }
.badge-dailymotion { background: rgba(0, 184, 164, 0.2); color: #00b8a4; border: 1px solid rgba(0, 184, 164, 0.3); }
.badge-hls { background: rgba(255, 173, 31, 0.2); color: #ffad1f; border: 1px solid rgba(255, 173, 31, 0.3); }
.badge-mp4 { background: rgba(0, 168, 132, 0.2); color: var(--accent-primary); border: 1px solid rgba(0, 168, 132, 0.3); }
.badge-encrypted { background: rgba(224, 36, 94, 0.2); color: var(--accent-danger); border: 1px solid rgba(224, 36, 94, 0.3); }
.badge-m3u { background: rgba(52, 183, 241, 0.2); color: var(--accent-info); border: 1px solid rgba(52, 183, 241, 0.3); }

.channel-live {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-danger);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  animation: blink 1.5s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.channel-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }

.channel-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.channel-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.channel-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-primary);
  flex: 1;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
  border-color: var(--accent-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #c81e54;
}

.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-lg { padding: 16px 28px; font-size: 1rem; }
.btn-icon { padding: 10px; }

.btn svg { width: 18px; height: 18px; }

/* Video Player Section */
.player-section {
  margin-top: 32px;
  display: none;
}

.player-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.player-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  flex-wrap: wrap;
  gap: 12px;
}

.player-title { font-size: 1.1rem; font-weight: 600; flex: 1; min-width: 200px; }

.player-controls-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.external-link-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.external-link-btn:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  color: white;
}

.close-player-btn {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.close-player-btn:hover {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: white;
}

.player-container {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

.player-container video,
.player-container canvas,
.player-container iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.player-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  color: var(--text-primary);
}

.player-fallback-icon { font-size: 4rem; opacity: 0.5; }

.player-fallback-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }

.player-fallback-message { color: var(--text-secondary); max-width: 400px; line-height: 1.6; }

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.player-container:hover .player-overlay { opacity: 1; }

.play-overlay-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9);
  transition: transform var(--transition-fast);
}

.player-container:hover .play-overlay-btn { transform: scale(1); }

.play-overlay-btn:hover { background: var(--accent-primary-hover); box-shadow: var(--shadow-glow); }

.play-overlay-btn svg { width: 32px; height: 32px; margin-left: 4px; }

/* Loading spinner */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text { color: var(--text-secondary); font-size: 0.9rem; }

.loading-progress {
  width: 200px;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-hover));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

/* Decrypt modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
}

.modal-title { font-size: 1.25rem; font-weight: 600; }

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--accent-danger); border-color: var(--accent-danger); color: white; }

.modal-close svg { width: 20px; height: 20px; }

/* Forms */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input.error { border-color: var(--accent-danger); }

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--accent-danger);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checkbox-input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.checkbox-label a { color: var(--accent-primary); }

/* Progress */
.progress-container { margin-top: 16px; }

.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-hover));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

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

.toast.success { border-left: 4px solid var(--accent-primary); }
.toast.error { border-left: 4px solid var(--accent-danger); }
.toast.warning { border-left: 4px solid var(--accent-warning); }
.toast.info { border-left: 4px solid var(--accent-info); }

.toast-icon { font-size: 1.25rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--accent-primary); }
.toast.error .toast-icon { color: var(--accent-danger); }
.toast.warning .toast-icon { color: var(--accent-warning); }
.toast.info .toast-icon { color: var(--accent-info); }

.toast-message { flex: 1; font-size: 0.9rem; line-height: 1.4; }
.toast-close {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 1.25rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-message { max-width: 400px; line-height: 1.6; }

/* Footer */
.footer {
  padding: 24px 20px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links { display: flex; justify-content: center; gap: 24px; margin-top: 12px; flex-wrap: wrap; }

/* Panel Admin Specific */
.panel-container { max-width: 1000px; margin: 0 auto; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-title { font-size: 1.5rem; font-weight: 700; }

.panel-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.panel-tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.panel-tab:hover { color: var(--text-primary); }
.panel-tab.active { background: var(--accent-primary); color: var(--text-inverse); }

.panel-section { display: none; }
.panel-section.active { display: block; animation: fadeIn 0.2s ease; }

/* Table */
.table-container { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table tr:hover td { background: var(--bg-hover); }

.table-actions { display: flex; gap: 8px; }

/* Modal large */
.modal-large { max-width: 700px; }

/* Key generator */
.key-gen-options { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.key-gen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.key-gen-btn:hover { border-color: var(--accent-primary); background: var(--accent-primary-dim); }

.key-gen-btn-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.key-gen-btn-icon svg { width: 24px; height: 24px; }

.key-gen-btn-content { text-align: left; }

.key-gen-btn-title { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.key-gen-btn-desc { font-size: 0.8rem; color: var(--text-muted); }

.generated-key {
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  position: relative;
}

.generated-key-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* File drop zone */
.drop-zone {
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: var(--accent-primary-dim);
}

.drop-zone-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.7; }
.drop-zone-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.drop-zone-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.drop-zone-input { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; height: 56px; }
  .navbar-nav { display: none; }
  .main-content { padding: 16px 12px; }
  .search-filters { padding: 16px; flex-direction: column; }
  .search-box { min-width: 0; }
  .filter-group { justify-content: center; }
  .channels-grid { grid-template-columns: 1fr; }
  .player-header { flex-direction: column; align-items: flex-start; }
  .player-controls-header { width: 100%; justify-content: space-between; }
  .form-row { flex-direction: column; gap: 0; }
  .modal { margin: 12px; padding: 20px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

/* Animaciones adicionales */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.shake { animation: shake 0.4s ease; }

/* Utilidades */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-primary); }
.text-danger { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-info { color: var(--accent-info); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Anti-capture specific styles (injected by anti-capture.js but defined here for completeness) */
#forensic-watermark, #warning-banner { pointer-events: none !important; }
video[data-protected], canvas[data-protected] { pointer-events: none !important; }