@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800&family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  /* Kairos Viator Color Palette */
  --bg-cream: #FDFBF7;             /* Cream background */
  --bg-card: #FFFFFF;              /* White card background */
  --franciscan-brown: #4A3B32;     /* Deep Franciscan Brown */
  --franciscan-brown-light: #5E4C40;
  --franciscan-brown-dark: #372B25;
  --soft-gold: #B38F4F;            /* Gold accent */
  --soft-gold-bright: #D4AF37;     /* Bright metallic gold */
  --soft-gold-dim: #96743A;
  --text-dark: #2B221C;            /* High contrast readable text */
  --text-muted: #6C5F55;
  --border-gold: rgba(179, 143, 79, 0.4);
  --border-gold-bright: rgba(212, 175, 55, 0.8);
  
  /* Typography */
  --font-serif-title: 'Cinzel', serif;
  --font-serif-body: 'Lora', serif;
  --font-sans: 'Montserrat', sans-serif;
  
  /* Shadows & Radius */
  --shadow-premium: 0 10px 30px rgba(74, 59, 50, 0.12), 0 2px 6px rgba(74, 59, 50, 0.08);
  --shadow-hover: 0 14px 36px rgba(74, 59, 50, 0.18), 0 4px 10px rgba(179, 143, 79, 0.25);
  --border-radius-main: 16px;
  --border-radius-btn: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-cream);
  color: var(--text-dark);
  font-family: var(--font-serif-body);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
}

/* App Container (Mobile viewport emulator on desktop) */
.app-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  background-color: var(--bg-cream);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--franciscan-brown-dark);
  border-radius: 24px;
  overflow: hidden;
}

@media (max-width: 480px) {
  body {
    background-color: var(--bg-cream);
  }
  .app-container {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border: none;
    border-radius: 0;
  }
}

.hidden {
  display: none !important;
}

/* ==========================================
   1. PANTALLA CATALOGO MULTIDESTINO
   ========================================== */
.catalog-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-cream);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
  padding: 24px 18px 36px 18px;
  animation: fadeIn 0.4s ease-out;
}

.catalog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.brand-logo-large {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 10px rgba(179, 143, 79, 0.3));
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.brand-title-large {
  font-family: var(--font-serif-title);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--franciscan-brown);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.catalog-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft-gold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.catalog-instruction {
  text-align: center;
  margin-bottom: 18px;
}

.catalog-instruction h2 {
  font-family: var(--font-serif-title);
  font-size: 1.15rem;
  color: var(--franciscan-brown-dark);
  margin-bottom: 4px;
}

.catalog-instruction p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tour-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.tour-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--border-radius-main);
  padding: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-premium);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.tour-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, var(--soft-gold-bright), var(--franciscan-brown));
  border-radius: 4px 0 0 4px;
}

.tour-card:hover, .tour-card:focus {
  transform: translateY(-3px);
  border-color: var(--soft-gold-bright);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.tour-card-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--franciscan-brown);
  background-color: rgba(179, 143, 79, 0.15);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tour-card-title {
  font-family: var(--font-serif-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--franciscan-brown-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.tour-card-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft-gold-dim);
  margin-bottom: 6px;
}

.tour-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.tour-card-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: #FFFFFF;
  background-color: var(--franciscan-brown);
  border: none;
  border-radius: var(--border-radius-btn);
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tour-card:hover .tour-card-btn {
  background-color: var(--franciscan-brown-dark);
}

.catalog-footer {
  text-align: center;
  margin-top: auto;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   2. PANTALLA SELECTOR DE IDIOMA
   ========================================== */
.language-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-cream);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
}

.lang-content {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-gold);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-premium);
}

.btn-back-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  display: inline-block;
  transition: color 0.2s;
}

.btn-back-link:hover {
  color: var(--franciscan-brown);
}

.selected-tour-name {
  font-family: var(--font-serif-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--franciscan-brown);
  margin-top: 12px;
  margin-bottom: 6px;
}

.lang-subtitle {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.lang-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background-color: var(--bg-cream);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--border-radius-btn);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.btn-lang:hover, .btn-lang:focus {
  background-color: var(--franciscan-brown);
  border-color: var(--soft-gold-bright);
  transform: translateY(-2px);
  outline: none;
}

.btn-lang:hover .lang-name,
.btn-lang:hover .lang-desc,
.btn-lang:focus .lang-name,
.btn-lang:focus .lang-desc {
  color: #FFFFFF;
}

.lang-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.lang-info {
  display: flex;
  flex-direction: column;
}

.lang-name {
  font-family: var(--font-serif-title);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--franciscan-brown-dark);
}

.lang-desc {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   3. VISTA DEL REPRODUCTOR & HEADER & MAIN
   ========================================== */
.player-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
}

header {
  background-color: var(--franciscan-brown);
  border-bottom: 2px solid var(--soft-gold);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  z-index: 20;
}

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

.btn-header-link {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-gold);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-header-link:hover {
  background: var(--soft-gold);
  color: var(--franciscan-brown-dark);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-logo-svg {
  width: 26px;
  height: 26px;
  fill: var(--soft-gold-bright);
}

.brand-name {
  font-family: var(--font-serif-title);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: var(--soft-gold);
  text-transform: uppercase;
}

.btn-change-lang {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.2s;
}

.btn-change-lang:hover {
  transform: scale(1.1);
}

.active-tour-indicator {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
}

.stop-selector-wrapper {
  width: 100%;
}

.stop-selector {
  width: 100%;
  padding: 8px 12px;
  background-color: var(--franciscan-brown-dark);
  border: 1px solid var(--border-gold);
  border-radius: var(--border-radius-btn);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23D4AF37'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  text-align: center;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.stop-selector:focus {
  outline: none;
  border-color: var(--soft-gold-bright);
}

/* Offline Progress Bar */
.offline-status-bar {
  background-color: var(--franciscan-brown-dark);
  border-bottom: 1px solid var(--border-gold);
  padding: 6px 14px;
  transition: opacity 0.5s ease;
  z-index: 15;
}

.offline-status-text {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--soft-gold);
  text-align: center;
  margin-bottom: 4px;
  font-weight: 500;
}

.offline-progress-track {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.offline-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--soft-gold), var(--soft-gold-bright));
  transition: width 0.3s ease;
}

/* Main Content Area (Fluid vertical scroll with fixed footer padding) */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  padding-bottom: 95px; /* Room for fixed footer */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 14px;
}

.fade-enter {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.fade-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease-in, transform 0.25s ease-in;
}

.stop-info {
  text-align: center;
}

.stop-number {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--soft-gold-dim);
  display: block;
  margin-bottom: 2px;
}

.stop-title {
  font-family: var(--font-serif-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--franciscan-brown-dark);
  line-height: 1.3;
}

.image-container {
  width: 100%;
  border-radius: var(--border-radius-main);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  border: 2px solid var(--border-gold);
  background-color: var(--franciscan-brown-dark);
  aspect-ratio: 4 / 3;
}

.stop-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

/* Audio Player Component */
.audio-player-container {
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--border-radius-main);
  padding: 14px 16px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(74, 59, 50, 0.15);
  outline: none;
  cursor: pointer;
}

.timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--soft-gold-bright);
  border: 2px solid var(--franciscan-brown);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timeline::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--soft-gold-bright);
  border: 2px solid var(--franciscan-brown);
  cursor: pointer;
}

.time-indicators {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speed-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--franciscan-brown);
  background: var(--bg-cream);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.speed-btn:hover {
  background: var(--franciscan-brown);
  color: #FFFFFF;
}

.secondary-control {
  background: none;
  border: none;
  color: var(--franciscan-brown);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.secondary-control svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.secondary-control:hover {
  transform: scale(1.1);
}

.play-pause-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--franciscan-brown), var(--franciscan-brown-dark));
  border: 2px solid var(--soft-gold-bright);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(74, 59, 50, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.play-pause-btn svg {
  width: 26px;
  height: 26px;
  fill: #FFFFFF;
}

.play-pause-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(74, 59, 50, 0.4);
}

/* ==========================================
   4. FIXED FOOTER NAVIGATION BAR
   ========================================== */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  background-color: var(--franciscan-brown-dark);
  border-top: 2px solid var(--soft-gold);
  padding: 10px 16px;
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .fixed-footer {
    left: 0;
    transform: none;
  }
}

.nav-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--border-radius-btn);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
}

.btn .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border: 1px solid var(--border-gold);
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.2);
}

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

.btn-primary {
  background-color: var(--soft-gold);
  color: var(--franciscan-brown-dark);
}

.btn-primary:hover {
  background-color: var(--soft-gold-bright);
}

/* ==========================================
   5. FLOATING FAB & TEXT/VOICE CHAT (FRANCISCO)
   ========================================== */
.ask-guide-fab {
  position: absolute;
  bottom: 74px;
  right: 16px;
  background: linear-gradient(135deg, var(--franciscan-brown), var(--franciscan-brown-dark));
  border: 1.5px solid var(--soft-gold-bright);
  color: #FFFFFF;
  border-radius: 30px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(179, 143, 79, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 110;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  animation: fabGentlePulse 3.5s ease-in-out infinite;
}

.ask-guide-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.55), 0 12px 30px rgba(0, 0, 0, 0.45);
  border-color: #FFFFFF;
}

.ask-guide-fab:active {
  transform: translateY(0) scale(0.98);
}

.fab-mic-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft-gold-bright);
}

@keyframes fabGentlePulse {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(179, 143, 79, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.65), 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

.ask-guide-fab.listening {
  background: linear-gradient(135deg, #C62828, #8E0000) !important;
  border-color: #FFCDD2 !important;
  color: #FFFFFF !important;
  animation: fabPulseGlow 1.5s infinite !important;
}

.ask-guide-fab.listening .fab-mic-icon-wrapper {
  color: #FFFFFF;
}

@keyframes fabPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7), 0 6px 20px rgba(0,0,0,0.35);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(198, 40, 40, 0), 0 8px 24px rgba(0,0,0,0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0), 0 6px 20px rgba(0,0,0,0.35);
  }
}

/* Floating Chat Sheet Bubble */
.chat-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80%;
  background-color: var(--bg-cream);
  border-radius: 20px 20px 0 0;
  border-top: 2px solid var(--soft-gold);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  z-index: 150;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.chat-drag-handle {
  width: 36px;
  height: 4px;
  background-color: rgba(74, 59, 50, 0.25);
  border-radius: 2px;
  margin: 8px auto 4px auto;
  cursor: pointer;
}

.chat-header {
  padding: 8px 16px 12px 16px;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--franciscan-brown);
  color: #FFFFFF;
}

.chat-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--soft-gold);
  color: var(--franciscan-brown-dark);
  font-family: var(--font-serif-title);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-header h3 {
  font-family: var(--font-serif-title);
  font-size: 0.95rem;
  color: var(--soft-gold-bright);
}

.chat-status {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.75);
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.chat-icon-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s;
}

.chat-icon-btn:hover {
  color: var(--soft-gold);
}

/* Selector rápido de idioma para el asistente */
.chat-lang-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--franciscan-brown-dark);
  border-bottom: 1px solid var(--border-gold);
}

.chat-lang-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-right: 2px;
}

.chat-lang-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 3px 9px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-lang-pill:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--soft-gold-bright);
  color: #FFFFFF;
}

.chat-lang-pill.active {
  background: var(--soft-gold);
  border-color: var(--soft-gold-bright);
  color: var(--franciscan-brown-dark);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.chat-config-panel {
  padding: 12px 16px;
  background-color: var(--franciscan-brown-dark);
  color: #FFFFFF;
  border-bottom: 1px solid var(--border-gold);
}

.chat-config-panel h4 {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--soft-gold);
  margin-bottom: 4px;
}

.chat-config-panel p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.api-key-input-wrapper {
  display: flex;
  gap: 8px;
}

.api-key-input-wrapper input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: #FFFFFF;
  font-size: 0.8rem;
}

.chat-btn {
  padding: 6px 12px;
  background: var(--soft-gold);
  color: var(--franciscan-brown-dark);
  border: none;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.message.guide {
  align-self: flex-start;
  background-color: #FFFFFF;
  color: var(--text-dark);
  border: 1px solid var(--border-gold);
  border-bottom-left-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.message.user {
  align-self: flex-end;
  background-color: var(--franciscan-brown);
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
}

.message-time {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  opacity: 0.65;
  margin-top: 4px;
  text-align: right;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  width: fit-content;
  align-self: flex-start;
}

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

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

@keyframes typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.chat-input-area {
  padding: 10px 14px;
  border-top: 1px solid var(--border-gold);
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(74, 59, 50, 0.2);
  border-radius: 20px;
  font-family: var(--font-serif-body);
  font-size: 0.85rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--soft-gold);
}

.chat-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.send-btn {
  background-color: var(--franciscan-brown);
  color: #FFFFFF;
}

.send-btn:hover {
  background-color: var(--franciscan-brown-dark);
}

/* Mic button inside chat input */
.mic-btn {
  background-color: #F8F5F0;
  color: var(--franciscan-brown);
  border: 1.5px solid var(--border-gold);
  transition: all 0.25s ease;
}

.mic-btn:hover {
  background-color: #ECE3D4;
  color: var(--franciscan-brown-dark);
  border-color: var(--soft-gold-bright);
}

.mic-btn.listening {
  background: #C62828 !important;
  color: #FFFFFF !important;
  border-color: #EF9A9A !important;
  animation: micPulseGlow 1.4s infinite;
}

@keyframes micPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(198, 40, 40, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(198, 40, 40, 0);
  }
}

/* Listening status bar inside chat sheet */
.chat-listening-status {
  padding: 8px 14px;
  background: linear-gradient(90deg, rgba(198, 40, 40, 0.12), rgba(198, 40, 40, 0.05));
  border-top: 1px solid rgba(198, 40, 40, 0.25);
  border-bottom: 1px solid rgba(198, 40, 40, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #B71C1C;
  font-weight: 600;
  animation: fadeIn 0.25s ease-out;
}

.sound-wave-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.sound-wave-bars span {
  display: block;
  width: 3px;
  height: 100%;
  background-color: #C62828;
  border-radius: 2px;
  animation: waveBar 1.2s infinite ease-in-out;
}

.sound-wave-bars span:nth-child(1) { animation-delay: 0.0s; height: 35%; }
.sound-wave-bars span:nth-child(2) { animation-delay: 0.2s; height: 75%; }
.sound-wave-bars span:nth-child(3) { animation-delay: 0.4s; height: 100%; }
.sound-wave-bars span:nth-child(4) { animation-delay: 0.15s; height: 60%; }
.sound-wave-bars span:nth-child(5) { animation-delay: 0.35s; height: 45%; }

@keyframes waveBar {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1.0); }
}

.btn-stop-listening {
  background: rgba(198, 40, 40, 0.15);
  border: 1px solid rgba(198, 40, 40, 0.35);
  color: #B71C1C;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-stop-listening:hover {
  background: #C62828;
  color: #FFF;
}

/* Audio listen button on guide message cards */
.msg-tts-btn {
  background: none;
  border: none;
  color: var(--soft-gold-dim);
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 6px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  border-radius: 4px;
  transition: color 0.2s, transform 0.1s;
}

.msg-tts-btn:hover {
  color: var(--soft-gold-bright);
  transform: scale(1.1);
}

.msg-tts-btn.speaking {
  color: #C62828;
  animation: pulseSpeaking 1s infinite alternate;
}

@keyframes pulseSpeaking {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(1.2); opacity: 1; }
}

/* ==========================================
   6. PANTALLA DE SEGURIDAD Y EXPIRACIÓN (12H)
   ========================================== */
.expiration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-cream);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.expiration-content {
  background: #FFFFFF;
  border: 2px solid var(--border-gold-bright);
  border-radius: 20px;
  padding: 32px 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  max-width: 360px;
}

.expiration-title {
  font-family: var(--font-serif-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--franciscan-brown-dark);
  margin-top: 14px;
  margin-bottom: 8px;
}

.expiration-message {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.expiration-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
