/**
 * Estilos Principales - Visor de Webcams del Mundo en Vivo
 * Fijate Tools • Earth Studio
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Tema Oscuro por defecto (Midnight Slate & Neon Cyber) */
  --bg-body: #080c14;
  --bg-card: rgba(14, 20, 33, 0.85);
  --bg-card-hover: rgba(22, 31, 50, 0.95);
  --bg-card-solid: #0d1424;
  --bg-glass: rgba(16, 24, 40, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 229, 255, 0.25);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00e5ff;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-live: #ef4444;
  --accent-purple: #8b5cf6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(0, 229, 255, 0.15);
  
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --bg-card-solid: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(0, 160, 220, 0.3);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(0, 160, 220, 0.12);

  color-scheme: light;
}

/* Reset básico y contenedor */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.tool-app-container {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 1.25rem 1.75rem 3.5rem;
  box-sizing: border-box;
}

@media (min-width: 1920px) {
  .tool-app-container {
    max-width: 1920px;
    padding: 1.5rem 2.5rem 4rem;
  }
}

/* Encabezado de la herramienta */
.tool-header-hero {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.15); opacity: 0.8; box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.tool-header-hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tool-header-hero p.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 860px;
}

/* Layout con Sidebar estándar de publicidad */
.tool-with-sidebar {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
}

.tool-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra de control superior (Multiview Switcher & Acciones Rápidas) */
.webcam-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.view-mode-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mode-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.btn-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-mode-toggle:hover {
  background: rgba(0, 229, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(0, 229, 255, 0.3);
}

.btn-mode-toggle.active {
  background: var(--accent-cyan);
  color: #080c14;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
  font-weight: 700;
}

.quick-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.btn-action-icon.active {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

/* =========================================================================
   ÁREA DEL REPRODUCTOR PRINCIPAL / MOSAICO
   ========================================================================= */
.webcam-viewport-container {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  transition: all 0.3s ease;
  scroll-margin-top: 80px;
}

.webcam-viewport-container.viewport-focus-pulse {
  animation: viewportPulse 0.85s ease-out;
}

@keyframes viewportPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.8), var(--shadow-card);
    border-color: var(--accent-cyan);
  }
  50% {
    box-shadow: 0 0 35px 8px rgba(0, 229, 255, 0.5), var(--shadow-card);
    border-color: #ffffff;
  }
  100% {
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: var(--border-color);
  }
}

/* Cuadrícula Multiview Dinámica */
.multiview-grid {
  display: grid;
  gap: 6px;
  background: #000000;
  width: 100%;
  position: relative;
}

/* Variantes de Cuadrícula */
.multiview-grid.layout-1 {
  grid-template-columns: 1fr;
}

.multiview-grid.layout-2 {
  grid-template-columns: repeat(2, 1fr);
}

.multiview-grid.layout-4 {
  grid-template-columns: repeat(2, 1fr);
}

.multiview-grid.layout-6 {
  grid-template-columns: repeat(3, 1fr);
}

/* Slot de Cámara individual en el mosaico */
.cam-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #04060a;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.cam-slot.active-slot {
  border-color: var(--accent-cyan);
}

.cam-slot iframe,
.cam-slot video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto;
}

/* Overlay de Información en Vivo sobre el reproductor */
.cam-slot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.cam-slot-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cam-slot-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.cam-slot-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
}

.btn-slot-control {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-slot-control:hover {
  background: var(--accent-cyan);
  color: #080c14;
  border-color: var(--accent-cyan);
}

/* Barra Inferior del Reproductor Activo (Telemetría y Estado) */
.active-cam-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.telemetry-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 250px;
  flex: 1;
}

.active-cam-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.active-cam-heading h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.location-subtext {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.telemetry-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Píldora de Hora Local en Vivo */
.live-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.clock-icon-daynight {
  font-size: 1.1rem;
}

.clock-text-wrap {
  display: flex;
  flex-direction: column;
}

.clock-time-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.clock-offset-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Botones de acción del player */
.player-action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 40px;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-player-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-player-btn.btn-fav.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

/* =========================================================================
   SECCIÓN DE MAPA INTERACTIVO Y EXPLORACIÓN
   ========================================================================= */
.map-section-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.map-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.map-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.map-header-title h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.map-container-wrapper {
  position: relative;
  width: 100%;
  height: 420px;
  background: #080c14;
}

@media (min-width: 1440px) {
  .map-container-wrapper {
    height: 460px;
  }
}

#worldWebcamMap {
  width: 100%;
  height: 100%;
  background: #080c14;
  z-index: 1;
}

/* Marcadores personalizados de Leaflet */
.custom-webcam-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0d1424;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-webcam-marker:hover {
  transform: scale(1.25);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.8);
  z-index: 999;
}

.custom-webcam-marker.marker-active {
  background: var(--accent-cyan);
  color: #080c14;
  border-color: #ffffff;
  box-shadow: 0 0 22px rgba(0, 229, 255, 1);
  transform: scale(1.2);
}

/* Popups de Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-card-solid) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-card);
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.leaflet-popup-tip {
  background: var(--bg-card-solid) !important;
}

.map-popup-card {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 220px;
}

.map-popup-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.map-popup-loc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.map-popup-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.btn-popup-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px;
  min-height: 34px;
  background: var(--accent-cyan);
  color: #080c14;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-popup-view:hover {
  opacity: 0.9;
}

/* =========================================================================
   EXPLORADOR Y CATÁLOGO DE CÁMARAS
   ========================================================================= */
.catalog-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

/* Pestañas de categorías */
.category-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.btn-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-category-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-category-tab.active {
  background: var(--accent-cyan);
  color: #080c14;
  border-color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.35);
}

/* Barra de búsqueda y filtros rápidos */
.filter-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1 1 0%;
  width: 0;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 1rem 0 2.6rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.quick-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 44px;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.quick-filter-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.quick-filter-badge.active {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Cuadrícula de Tarjetas de Cámara */
.cameras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.cam-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.cam-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 229, 255, 0.15);
}

.cam-card.card-active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
  background: var(--bg-card-hover);
}

.cam-card-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #04060a;
  overflow: hidden;
}

.cam-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.cam-card-badge-live {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ff6b6b;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.cam-card-time-badge {
  position: absolute;
  bottom: 0.6rem;
  right: 0.6rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cam-card-fav-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 5;
}

.cam-card-fav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  color: var(--accent-amber);
  transform: scale(1.1);
}

.cam-card-fav-btn.active {
  color: var(--accent-amber);
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-amber);
}

.cam-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.cam-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.3;
}

.cam-card-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cam-card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.25rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Estado de lista vacía */
.empty-results-box {
  grid-column: 1 / -1;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
}

.empty-results-box h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-main);
  margin: 0.5rem 0;
}

/* =========================================================================
   MODALES Y POPUPS NATIVOS (SIN ALERTS)
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-dialog {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-modal-cancel {
  height: 40px;
  min-height: 40px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-modal-confirm {
  height: 40px;
  min-height: 40px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent-cyan);
  color: #080c14;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-modal-confirm:hover {
  opacity: 0.9;
}

/* Toast flotante de notificación */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.25rem;
  background: rgba(14, 20, 33, 0.95);
  backdrop-filter: blur(10px);
  color: #ffffff;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.3);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notification.active {
  transform: translateY(0);
  opacity: 1;
}

/* =========================================================================
   ESTRUCTURA DE PUBLICIDAD ESTÁNDAR
   ========================================================================= */
.tools-ad-banner-section {
  width: 100%;
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-sizing: border-box;
}

/* =========================================================================
   RESPONSIVIDAD Y CONTROLES MÓVILES (REGLAS OBLIGATORIAS)
   ========================================================================= */
@media (max-width: 1024px) {
  .tool-with-sidebar {
    flex-direction: column;
  }

  .tool-ad-sidebar {
    width: 100%;
    position: static;
  }

  .multiview-grid.layout-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .tool-header-hero h1 {
    font-size: 1.6rem;
  }

  .webcam-top-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .view-mode-selector {
    justify-content: space-between;
    width: 100%;
  }

  .btn-mode-toggle {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .quick-actions-row {
    justify-content: flex-end;
  }

  .multiview-grid.layout-2,
  .multiview-grid.layout-4,
  .multiview-grid.layout-6 {
    grid-template-columns: 1fr;
  }

  .active-cam-telemetry {
    flex-direction: column;
    align-items: stretch;
  }

  .telemetry-right {
    justify-content: space-between;
  }

  .player-action-buttons {
    width: 100%;
  }

  .btn-player-btn {
    flex: 1;
    justify-content: center;
  }

  .filter-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    width: 100%;
    flex: none;
  }

  .quick-filter-badge {
    width: 100%;
    justify-content: center;
  }

  .cameras-grid {
    grid-template-columns: 1fr;
  }

  .map-container-wrapper {
    height: 280px;
  }
}
