/**
 * Estilos para Guía turístico virtual con GPS y voz
 * Paleta Midnight Slate + Acentos Esmeralda / Ámbar dorado
 */

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

  /* Colores tema oscuro (por defecto) */
  --bg-app: #0b0f17;
  --bg-card: #131926;
  --bg-card-sub: #1b2333;
  --bg-input: #101622;
  --border-color: #243049;
  --border-hover: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-emerald-bg: rgba(16, 185, 129, 0.15);

  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.15);

  --accent-cyan: #06b6d4;
  --accent-cyan-bg: rgba(6, 182, 212, 0.15);

  --radar-grid: rgba(16, 185, 129, 0.2);
  --radar-sweep: rgba(16, 185, 129, 0.35);

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #10b981;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --radar-grid: rgba(16, 185, 129, 0.3);
  --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.section-subtitle,
.sight-name,
.modal-title,
.faq-section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}

.mono {
  font-family: var(--font-mono);
}

/* Layout y wrapper */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
  flex: 1 0 auto;
}

.tool-with-sidebar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

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

/* Tarjeta base */
.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Barra de mandos superior (Selector de ciudad, modo y acciones)
   ========================================================================== */
.guide-control-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-bar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.city-selector-group,
.mode-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 240px;
  min-width: 0;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 44px;
  padding: 0 40px 0 1rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Píldoras de modo (GPS vs Simulador) */
.mode-pill-container {
  display: flex;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.mode-pill {
  flex: 1 1 0%;
  min-height: 38px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-pill.active {
  background-color: var(--accent-emerald);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.mode-pill:hover:not(.active) {
  color: var(--text-main);
}

/* Fila de botones principales */
.action-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-action-primary,
.btn-action-assistant {
  min-height: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  padding: 0 1rem;
}

.btn-action-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-action-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-action-primary.active {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-action-assistant {
  background-color: var(--bg-card-sub);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.btn-action-assistant:hover {
  background-color: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-action-assistant.listening {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Workbench Grid (Radar HUD + Tarjeta de monumento)
   ========================================================================== */
.tour-workbench-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

/* Columna Radar */
.hud-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hud-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #94a3b8;
}

.hud-status-badge.active .status-pulse-dot {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: radar-pulse 1.8s infinite;
}

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

.telemetry-box {
  font-size: 0.82rem;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--accent-emerald);
  font-weight: 700;
}

.telemetry-label {
  color: var(--text-dim);
  font-weight: 500;
  margin-right: 4px;
}

/* Radar circular */
.radar-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0.5rem auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(11, 15, 23, 0.95) 75%);
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.15), 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#canvas-radar {
  width: 100%;
  height: 100%;
  display: block;
}

.radar-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent-emerald);
  pointer-events: none;
}

.radar-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot-in-sight {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

.dot-nearby {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
}

.dot-visited {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #64748b;
}

/* Controles de simulador */
.sim-controls-panel {
  width: 100%;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.sim-controls-panel.active {
  display: flex;
}

.sim-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

.sim-dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 220px;
  margin: 0 auto;
}

.btn-dpad {
  min-height: 42px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-dpad:hover {
  background-color: var(--accent-emerald);
  color: #fff;
  border-color: var(--accent-emerald);
}

.btn-dpad-center {
  background-color: var(--bg-card-sub);
  color: var(--text-dim);
}

.sim-tip {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
}

/* ==========================================================================
   Columna derecha: Tarjeta "Lo que estás viendo"
   ========================================================================== */
.sight-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  justify-content: flex-start;
}

.sight-card-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.sight-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  background-color: var(--bg-card-sub);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.distance-badge {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-amber);
  background-color: var(--accent-amber-bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.sight-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sight-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.sight-native-name {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Caja de narración */
.narration-box {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.narration-waveform-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}

.wave-bar {
  width: 3px;
  height: 6px;
  background-color: var(--text-dim);
  border-radius: 2px;
  transition: height 0.2s;
}

.narration-waveform-bar.speaking .wave-bar {
  background-color: var(--accent-emerald);
  animation: wave-bounce 1s infinite ease-in-out;
}

.narration-waveform-bar.speaking .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.narration-waveform-bar.speaking .wave-bar:nth-child(2) { animation-delay: 0.25s; }
.narration-waveform-bar.speaking .wave-bar:nth-child(3) { animation-delay: 0.4s; }
.narration-waveform-bar.speaking .wave-bar:nth-child(4) { animation-delay: 0.15s; }
.narration-waveform-bar.speaking .wave-bar:nth-child(5) { animation-delay: 0.3s; }

@keyframes wave-bounce {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

.narration-status-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

.narration-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* Controles de audio */
.audio-player-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.btn-player {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* Botones de historia y curiosidades */
.sight-deep-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-secondary-sight {
  min-height: 42px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-sight:hover {
  background-color: var(--bg-card-sub);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Lista de monumentos cercanos */
.nearby-places-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.section-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.nearby-places-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.nearby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.nearby-item:hover {
  border-color: var(--accent-emerald);
  transform: translateX(2px);
}

.nearby-item.active {
  border-color: var(--accent-emerald);
  background-color: rgba(16, 185, 129, 0.1);
}

.nearby-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nearby-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.nearby-item-clock {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.nearby-item-dist {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-amber);
}

/* ==========================================================================
   Mapa Satelital (Leaflet)
   ========================================================================== */
.map-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.map-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.map-badges-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-layer-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

.btn-sm-map {
  min-height: 32px;
  padding: 0 10px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm-map:hover {
  background-color: var(--border-color);
  color: var(--accent-emerald);
}

.tour-map-viewport {
  width: 100%;
  height: 420px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background-color: #0b0f17;
  z-index: 1;
}

/* Marcadores Leaflet personalizados */
.user-map-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.user-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4);
}

.user-marker-cone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  transform-origin: 0 0;
  pointer-events: none;
}

.poi-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-card);
  border: 2px solid var(--accent-amber);
  color: var(--accent-amber);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

.poi-map-marker:hover,
.poi-map-marker.active {
  transform: scale(1.2);
  background-color: var(--accent-emerald);
  border-color: #ffffff;
  color: #ffffff;
}

/* ==========================================================================
   Guía didáctica SEO
   ========================================================================== */
.seo-guide-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.step-card {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.step-desc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ==========================================================================
   Modales canónicos (HTML/CSS sin alerts)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modal-appear 0.2s ease-out;
}

.modal-dialog-lg {
  max-width: 680px;
}

@keyframes modal-appear {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background-color 0.15s;
}

.btn-modal-close:hover {
  background-color: var(--bg-card-sub);
  color: var(--text-main);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.btn-secondary {
  min-height: 42px;
  padding: 0 1.25rem;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Componentes internos de modales */
.modal-section-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-top: 0.25rem;
}

.modal-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
}

.modal-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-tip-box {
  background-color: var(--accent-amber-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.86rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* Modal de asistente de voz */
.assistant-mic-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.assistant-mic-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--bg-card-sub);
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.assistant-mic-ring.active {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.assistant-state-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Visor de voz en tiempo real */
.live-speech-box {
  background-color: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.2s ease-out;
}

.live-speech-pulse-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-speech-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

.live-speech-status-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 0.03em;
}

.live-speech-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  min-height: 2.4rem;
  margin: 0;
  font-style: italic;
}

.live-speech-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.chat-bubbles-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.75rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.chat-bubble {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-bubble-guide {
  background-color: var(--bg-card-sub);
  color: var(--text-main);
  border-left: 3px solid var(--accent-emerald);
}

.chat-bubble-user {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  align-self: flex-end;
  border-right: 3px solid var(--accent-cyan);
}

.chat-bubble-thinking {
  background-color: var(--bg-card-sub);
  color: var(--text-muted);
  border-left: 3px solid var(--accent-cyan);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.bubble-sender {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

/* Barra de entrada por texto en asistente */
.assistant-input-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.assistant-input-bar input {
  flex: 1 1 0%;
  min-width: 0;
  height: 40px;
}

.assistant-input-bar button {
  white-space: nowrap;
  height: 40px;
  padding: 0 1rem;
}

.quick-questions-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
}

.quick-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quick-chip {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Modal de configuración */
.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.setting-row-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-switch-row {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.setting-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.setting-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.form-range {
  width: 100%;
  accent-color: var(--accent-emerald);
}

.form-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-emerald);
  cursor: pointer;
}

/* ==========================================================================
   Adaptación Responsive (Móvil y Tablet)
   ========================================================================== */
@media (max-width: 900px) {
  .tour-workbench-grid {
    grid-template-columns: 1fr;
  }

  .hud-card {
    order: 2;
  }

  .sight-card {
    order: 1;
  }

  .radar-container {
    width: 250px;
    height: 250px;
  }

  .action-buttons-row {
    grid-template-columns: 1fr;
  }

  .audio-player-controls {
    grid-template-columns: 1fr;
  }

  .sight-deep-actions {
    grid-template-columns: 1fr;
  }

  .btn-action-primary,
  .btn-action-assistant,
  .btn-player,
  .btn-secondary-sight {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 600px) {
  .tool-layout {
    padding: 0 0.5rem;
    margin: 1rem auto 2rem;
  }

  .card-main {
    padding: 1rem;
  }

  .sight-name {
    font-size: 1.25rem;
  }

  .tour-map-viewport {
    height: 320px;
  }
}

/* ==========================================================================
   Estilos del Explorador Universal de Destinos
   ========================================================================== */
.city-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
}

.btn-text-link:hover {
  color: #38bdf8;
  background-color: var(--accent-cyan-bg);
}

.modal-intro-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.explorer-search-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 42px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.btn-action-gps-scan {
  height: 44px;
  padding: 0 14px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--accent-emerald);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-action-gps-scan:hover {
  background-color: var(--accent-emerald-bg);
  border-color: var(--accent-emerald);
}

.explorer-radius-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.form-select-sm {
  height: 38px;
  font-size: 0.88rem;
  max-width: 240px;
}

/* Sugerencias de búsqueda desplegables */
.city-suggestions-box {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.city-suggestion-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.city-suggestion-item:last-child {
  border-bottom: none;
}

.city-suggestion-item:hover {
  background-color: rgba(6, 182, 212, 0.12);
}

.city-sug-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.city-sug-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Progreso / Spinner */
.ingestion-progress-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-main);
}

.spinner-circle {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Contenedor de hitos descubiertos */
.pois-discovered-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.discovered-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.count-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
}

.discovered-pois-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.discovered-poi-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: flex-start;
}

.discovered-poi-thumb {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--bg-input);
  flex-shrink: 0;
}

.discovered-poi-thumb-fallback {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-amber);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.discovered-poi-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.discovered-poi-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discovered-poi-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Modo Guía Pro (IA Conversacional: Groq / DeepSeek)
   ========================================================================== */

.hud-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.02em;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  transition: all 0.2s ease;
}

.hud-ai-badge.badge-deepseek {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.hud-wakelock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

.hud-wakelock-badge svg {
  color: #fbbf24;
  animation: pulseWakeLock 2.5s infinite ease-in-out;
}

@keyframes pulseWakeLock {
  0%, 100% { opacity: 0.7; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 4px #fbbf24); }
}

.ai-sparkle-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: aiPulse 2s infinite ease-in-out;
}

.hud-ai-badge.badge-deepseek .ai-sparkle-dot {
  background-color: #c084fc;
  box-shadow: 0 0 8px #c084fc;
}

@keyframes aiPulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
    filter: brightness(1.2);
  }
}

.setting-section-divider {
  margin: 1.25rem 0 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.section-divider-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-divider-title svg {
  color: #38bdf8;
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-password-wrapper .form-input {
  padding-right: 42px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.btn-toggle-eye {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.btn-toggle-eye:hover {
  color: var(--text-main);
}

.setting-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.setting-privacy-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-emerald);
}

.setting-ai-test-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.setting-test-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.setting-test-status.success {
  color: var(--accent-emerald);
}

.setting-test-status.error {
  color: var(--accent-rose);
}

.setting-test-status.loading {
  color: #38bdf8;
}

.chat-bubble-ai-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.chat-bubble-ai-meta.provider-groq {
  background-color: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.chat-bubble-ai-meta.provider-deepseek {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.btn-highlight-explorer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background-color: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-highlight-explorer:hover {
  background-color: var(--accent-emerald);
  color: #0b0f17;
  transform: translateY(-1px);
}


