/* velada app.css — estilos de la aplicacion */
/* ── TEMA CLARO (default) ── */
:root {
  --noche:   #2C1A0E;
  --madera:  #7A4A2A;
  --terra:   #C17A4A;
  --durazno: #E8A870;
  --dorado:  #F5C87A;
  --crema:   #F5EDE0;
  --lienzo:  #FDF8F2;
  --muted:   #B4A99A;
  --text:    #3D2212;
  --textsub: #7A5A46;
  --border:  rgba(193,122,74,0.18);

  /* tokens semánticos — modo claro */
  --bg-app:      #FDF8F2;
  --bg-card:     #FFFFFF;
  --bg-input:    #F5EDE0;
  --bg-header:   rgba(253,248,242,0.92);
  --bg-settings: #FFFFFF;
  --bg-tip:      #F5EDE0;
  --bg-noresult: #FDF0E0;
  --color-text:     #3D2212;
  --color-textsub:  #7A5A46;
  --color-heading:  #2C1A0E;
  --color-loading:  #2C1A0E;
  --shadow-phone: 0 8px 32px rgba(44,26,14,0.12);
}

/* ── TEMA OSCURO ── */
[data-theme="dark"] {
  --bg-app:      #180E06;
  --bg-card:     #231208;
  --bg-input:    #2C1A0E;
  --bg-header:   rgba(24,14,6,0.95);
  --bg-settings: #231208;
  --bg-tip:      #2C1A0E;
  --bg-noresult: #2C1A0E;
  --color-text:     #F5EDE0;
  --color-textsub:  #C8A882;
  --color-heading:  #FDF8F2;
  --color-loading:  #F5EDE0;
  --border:      rgba(193,122,74,0.22);
  --shadow-phone: 0 8px 32px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-app);
  color: var(--color-text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ── HEADER ── */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem 1rem;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 0.5px solid var(--border);
}
.header-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.header-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--terra);
  display: flex; align-items: center; justify-content: center;
}
.header-icon svg { width: 16px; height: 16px; }
.header-wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 500; color: var(--color-heading); letter-spacing: 0.03em;
}
.header-settings {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--bg-input); border: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: background 0.15s;
  color: var(--color-textsub);
}
.header-settings:hover { background: var(--bg-tip); }

/* ── SETTINGS PANEL ── */
.settings-panel {
  background: var(--bg-settings); border: 0.5px solid var(--border);
  border-radius: 16px; padding: 1rem 1.25rem;
  margin: 0 1rem 0; display: none;
  animation: slideDown 0.2s ease;
}
.settings-panel.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0;
}
.settings-row + .settings-row {
  border-top: 0.5px solid var(--border);
  margin-top: 0.25rem; padding-top: 0.75rem;
}
.settings-label { font-size: 13px; color: var(--color-textsub); }
.lang-toggle { display: flex; gap: 6px; }
.lang-btn {
  font-size: 12px; padding: 5px 12px;
  border: 0.5px solid var(--border); border-radius: 99px;
  background: none; color: var(--color-textsub); cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.lang-btn.active {
  background: var(--terra); color: var(--lienzo);
  border-color: var(--terra); font-weight: 500;
}

/* Theme toggle */
.theme-toggle { display: flex; gap: 4px; }
.theme-btn {
  width: 34px; height: 30px; border-radius: 8px;
  border: 0.5px solid var(--border); background: none;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; color: var(--color-textsub);
}
.theme-btn.active {
  background: var(--bg-input); border-color: var(--terra);
  color: var(--terra);
}

/* ── MAIN ── */
.app-main { padding: 1.25rem 1rem 5rem; }

/* ── WELCOME ── */
.welcome { margin-bottom: 1.5rem; }
.welcome-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 300; color: var(--color-heading);
  line-height: 1.2;
}
.welcome-title em { font-style: italic; color: var(--terra); }
.welcome-sub { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 300; }

/* ── CARDS ── */
.input-card {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: 16px; padding: 1.1rem 1.25rem;
  margin-bottom: 12px;
}
.card-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 10px;
}

/* Mode selector */
.mode-row { display: flex; gap: 8px; }
.mode-btn {
  flex: 1; padding: 10px 8px; border-radius: 12px;
  border: 0.5px solid var(--border); background: var(--bg-app);
  cursor: pointer; text-align: center; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.mode-btn.active { background: var(--bg-input); border-color: var(--terra); }
.mode-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.mode-name { font-size: 12px; font-weight: 500; color: var(--color-heading); }
.mode-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Budget */
.budget-row { display: flex; align-items: center; gap: 8px; }
.budget-field {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--bg-input); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
}
.budget-field label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.budget-field input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 15px; font-weight: 500; color: var(--color-heading);
  font-family: 'DM Sans', sans-serif; width: 100%; text-align: center;
}
.budget-sep { font-size: 13px; color: var(--muted); }
.budget-sym { font-size: 13px; color: var(--terra); font-weight: 500; }

/* Time */
.time-row { display: flex; align-items: center; gap: 10px; }
.time-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
}
.time-field input {
  background: none; border: none; outline: none;
  font-size: 15px; font-weight: 500; color: var(--color-heading);
  font-family: 'DM Sans', sans-serif;
  color-scheme: light dark;
}
.time-hint { font-size: 12px; color: var(--muted); font-weight: 300; }

/* Filters */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 99px;
  border: 0.5px solid var(--border); background: none;
  font-size: 13px; color: var(--color-textsub);
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s;
}
.filter-chip.active { background: #EAF3DE; border-color: #639922; color: #3B6D11; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.filter-chip.active .chip-dot { opacity: 1; }

/* Location */
.loc-row { display: flex; align-items: center; gap: 10px; }
.loc-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.loc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; transition: background 0.3s; }
.loc-dot.ok { background: #1D9E75; }
.loc-text { font-size: 14px; color: var(--color-textsub); }

/* Generate button */
.gen-btn {
  width: 100%; padding: 16px;
  background: var(--terra); color: var(--lienzo);
  border: none; border-radius: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 400;
  letter-spacing: 0.02em; cursor: pointer;
  transition: all 0.2s; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.gen-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gen-btn:not(:disabled):hover { background: var(--madera); transform: translateY(-1px); }
.gen-btn:not(:disabled):active { transform: scale(0.98); }
.gen-btn svg { width: 18px; height: 18px; }

/* ── LOADING ── */
.loading-state { text-align: center; padding: 3rem 1rem; display: none; }
.loading-state.show { display: block; }
.loading-candle { font-size: 36px; animation: flicker 1.5s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50% { transform: scale(1.05) rotate(1deg); }
}
.loading-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 300; font-style: italic;
  color: var(--color-loading); margin: 1rem 0 0.5rem;
}
.loading-sub { font-size: 13px; color: var(--muted); font-weight: 300; }

/* ── RESULTS ── */
.results { display: none; }
.results.show { display: block; }
.results-header { margin-bottom: 1.5rem; }
.results-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 300; color: var(--color-heading); line-height: 1.2;
}
.results-title em { font-style: italic; color: var(--terra); }
.results-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Map */
.map-section { margin-bottom: 1.5rem; }
.map-label { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.map-wrap { border-radius: 16px; overflow: hidden; border: 0.5px solid var(--border); height: 220px; }
.map-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.map-open-btn {
  width: 100%; margin-top: 8px; padding: 11px;
  border: 0.5px solid var(--border); border-radius: 12px;
  background: var(--bg-app); color: var(--madera);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.map-open-btn:hover { background: var(--bg-input); }

/* Stop card */
.stop-card {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: 18px; overflow: hidden; margin-bottom: 8px;
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stop-img-wrap { position: relative; height: 150px; background: var(--bg-input); overflow: hidden; }
.stop-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: none; }
.stop-img-wrap img.loaded { display: block; }
.stop-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.stop-disclaimer {
  position: absolute; bottom: 6px; right: 8px;
  font-size: 10px; color: rgba(255,255,255,0.9);
  background: rgba(44,26,14,0.45); padding: 2px 8px; border-radius: 4px; display: none;
}
.stop-disclaimer.show { display: block; }
.stop-body { padding: 1rem 1.1rem; }
.stop-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; letter-spacing: 0.07em; color: var(--terra); text-transform: uppercase; margin-bottom: 6px; }
.stop-tag-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--terra); }
.stop-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.stop-name { font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 400; color: var(--color-heading); line-height: 1.2; }
.stop-price { font-size: 13px; font-weight: 500; color: var(--terra); white-space: nowrap; }
.stop-time { font-size: 11px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.02em; }
.stop-hook {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px; font-style: italic; color: var(--color-textsub);
  line-height: 1.5; margin-bottom: 8px;
  padding-left: 10px; border-left: 2px solid var(--dorado);
}
.stop-desc { font-size: 13px; color: var(--color-textsub); line-height: 1.5; margin-bottom: 12px; font-weight: 300; }
.stop-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stop-phone {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 7px 12px;
  border: 0.5px solid var(--border); border-radius: 10px;
  color: var(--color-textsub); text-decoration: none;
  background: var(--bg-app); transition: all 0.15s;
}
.stop-phone:hover { background: var(--bg-input); }
.stop-maps {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 7px 12px;
  border: 0.5px solid rgba(55,138,221,0.3); border-radius: 10px;
  color: #185FA5; text-decoration: none; background: #E6F1FB; transition: all 0.15s;
}
.stop-phone-note { font-size: 11px; color: var(--muted); }

/* Connector */
.connector { display: flex; align-items: center; gap: 8px; padding: 6px 8px 2px 18px; }
.connector-line { width: 1.5px; height: 18px; background: var(--border); border-radius: 1px; }
.connector-label { font-size: 11px; color: var(--muted); }

/* Tip box */
.tip-box {
  background: var(--bg-tip); border-radius: 14px;
  padding: 1rem 1.1rem; margin-top: 8px;
  border: 0.5px solid rgba(193,122,74,0.2);
}
.tip-total { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 400; color: var(--color-heading); margin-bottom: 6px; }
.tip-total span { color: var(--terra); }
.tip-text { font-size: 13px; color: var(--color-textsub); line-height: 1.6; font-weight: 300; font-style: italic; }

/* Regen button */
.regen-btn {
  width: 100%; padding: 13px;
  border: 1.5px solid var(--terra); border-radius: 14px;
  background: transparent; color: var(--terra);
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; cursor: pointer;
  margin-top: 12px; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.regen-btn:hover { background: var(--bg-input); }

/* No results */
.no-results {
  background: var(--bg-noresult); border: 0.5px solid rgba(193,122,74,0.3);
  border-radius: 14px; padding: 1.5rem; text-align: center; display: none;
}
.no-results.show { display: block; }
.no-results p { font-size: 14px; color: var(--madera); margin-bottom: 1rem; line-height: 1.5; }
.expand-btn {
  padding: 10px 20px; background: var(--terra); color: var(--lienzo);
  border: none; border-radius: 99px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
}

/* Error */
.error-msg { font-size: 13px; color: #E24B4A; text-align: center; padding: 1rem; }

/* ── BOTÓN DE RUTA CON MAPA DE FONDO ── */
.map-section { margin: 12px 0; }

.map-route-btn {
  width: 100%; border: none; padding: 0;
  border-radius: 18px; overflow: hidden;
  cursor: pointer; display: block;
  position: relative; height: 110px;
  box-shadow: 0 4px 20px rgba(44,26,14,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.map-route-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(44,26,14,0.22); }
.map-route-btn:active { transform: scale(0.98); }

.map-route-bg {
  position: absolute; inset: 0;
  background: #e8e0d8;
}
.map-static-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  filter: brightness(0.75) saturate(0.8);
}
.map-route-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(44,26,14,0.65) 0%, rgba(193,122,74,0.5) 100%);
}

.map-route-content {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 0 1.25rem; gap: 14px;
}
.map-route-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.map-route-text {
  flex: 1; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
}
.map-route-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 500;
  color: white; line-height: 1.2;
}
.map-route-sub {
  font-size: 11px; color: rgba(255,255,255,0.75);
  font-weight: 300; line-height: 1.3;
}
.map-route-arrow {
  flex-shrink: 0; opacity: 0.8;
}
