/* ============================================================
   BENDITOS SUEÑOS — Light Sky Blue Chat Interface
   ★realmexxxicanfood★ · Madrid
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sky-1:       #5BB8E8;   /* Medium blue — user bubbles, accents */
  --sky-2:       #3A8EC8;   /* Deep blue — hover, send button */
  --sky-3:       #87CEEB;   /* Sky blue — light elements */
  --sky-light:   #C8E8F5;   /* Very light blue — header bg */
  --sky-pale:    #EBF6FD;   /* Near white blue — background */
  --sky-glass:   rgba(91, 184, 232, 0.12);
  --sky-border:  rgba(91, 184, 232, 0.25);
  --sky-border-strong: rgba(91, 184, 232, 0.5);
  --bg-main:     linear-gradient(160deg, #C8E8F5 0%, #DDF0FA 35%, #EBF6FD 65%, #F5FBFF 100%);
  --bubble-ai:   #FFFFFF;
  --bubble-user: #5BB8E8;
  --text-dark:   #1A1A1A;
  --text-mid:    #4A4A4A;
  --text-light:  #888888;
  --text-white:  #FFFFFF;
  --white:       #FFFFFF;
  --shadow-sm:   0 2px 12px rgba(91, 184, 232, 0.12);
  --shadow-md:   0 4px 24px rgba(91, 184, 232, 0.18);
  --shadow-lg:   0 8px 40px rgba(91, 184, 232, 0.25);
  --radius-bubble: 18px;
  --radius-card:   16px;
}

html {
  height: 100%;
  height: -webkit-fill-available;
}

html, body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-main);
  color: var(--text-dark);
  overflow: hidden;
}

body {
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ============================================================
   ROSE DECORATIVE WATERMARKS
   ============================================================ */

.rose-decor {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
}

.rose-decor-1 {
  width: 420px; height: 420px;
  top: -80px; right: -80px;
  background: radial-gradient(circle at 40% 40%,
    #7EC8E8 0%, #5BB8E8 25%, transparent 70%);
  opacity: 0.12;
  filter: blur(35px);
  animation: roseFloat 12s ease-in-out infinite;
}

.rose-decor-2 {
  width: 320px; height: 320px;
  bottom: 120px; left: -80px;
  background: radial-gradient(circle at 60% 40%,
    #87CEEB 0%, #4AABD4 30%, transparent 70%);
  opacity: 0.10;
  filter: blur(30px);
  animation: roseFloat 15s ease-in-out infinite reverse;
}

.rose-decor-3 {
  width: 280px; height: 280px;
  top: 38%; right: -40px;
  background: radial-gradient(circle,
    #9ED5EC 0%, #5BB8E8 35%, transparent 70%);
  opacity: 0.08;
  filter: blur(40px);
  animation: roseFloat 18s ease-in-out infinite 3s;
}

.rose-decor-4 {
  width: 200px; height: 200px;
  top: 55%; left: 15%;
  background: radial-gradient(circle,
    #B3E0F5 0%, #87CEEB 40%, transparent 70%);
  opacity: 0.07;
  filter: blur(25px);
  animation: roseFloat 20s ease-in-out infinite 6s reverse;
}

@keyframes roseFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  33%       { transform: translateY(-18px) scale(1.05); }
  66%       { transform: translateY(10px) scale(0.97); }
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: relative;
  height: 120px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #C2E5F5 0%, #D8EEFA 100%);
  border-bottom: 1px solid var(--sky-border);
  overflow: hidden;
  z-index: 10;
  box-shadow: 0 2px 16px rgba(91, 184, 232, 0.15);
}

.particle-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

.header-content {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  height: 88px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 12px;
  animation: logoFloat 5s ease-in-out infinite, logoGlow 4s ease-in-out infinite;
  will-change: transform, filter;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50%       { transform: translateY(-7px) scale(1.03); }
}

@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 4px 16px rgba(91, 184, 232, 0.4))
            drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
  }
  50% {
    filter: drop-shadow(0 8px 28px rgba(91, 184, 232, 0.7))
            drop-shadow(0 0 18px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 40px rgba(91, 184, 232, 0.2));
  }
}

/* ============================================================
   MAIN — CHAT
   ============================================================ */

.chat-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   MESSAGES
   ============================================================ */

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.messages-area::-webkit-scrollbar { width: 5px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb {
  background: rgba(91, 184, 232, 0.25);
  border-radius: 3px;
}

/* Message row */
.message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: fadeSlideUp 0.28s ease forwards;
  opacity: 0;
}

.message-user { flex-direction: row-reverse; }

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

/* Avatar */
.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.avatar-ai {
  background: linear-gradient(135deg, #5BB8E8, #3A8EC8);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(91, 184, 232, 0.4);
}

.message-user .message-avatar {
  background: linear-gradient(135deg, #3A8EC8, #2272B0);
  color: var(--white);
  font-size: 0.58rem;
}

/* Bubbles */
.message-bubble {
  max-width: 72%;
  padding: 11px 15px;
  border-radius: var(--radius-bubble);
  line-height: 1.6;
  font-size: 0.93rem;
  word-break: break-word;
  overflow-wrap: break-word;
  font-weight: 500;
}

.message-ai .message-bubble {
  background: var(--bubble-ai);
  border: 1px solid rgba(91, 184, 232, 0.18);
  border-bottom-left-radius: 5px;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

.message-user .message-bubble {
  background: var(--bubble-user);
  border-bottom-right-radius: 5px;
  color: var(--white);
  box-shadow: 0 2px 12px rgba(91, 184, 232, 0.35);
}

.message-bubble p { margin: 0; }
.message-bubble p + p { margin-top: 7px; }

.message-ai .message-bubble strong  { color: var(--sky-2); }
.message-user .message-bubble strong { color: rgba(255,255,255,0.92); }

.message-ai .message-bubble em  { color: #6A6A6A; font-style: normal; font-weight: 600; }
.message-user .message-bubble em { color: rgba(255,255,255,0.85); font-style: normal; }

/* Time stamp */
.message-time {
  font-size: 0.66rem;
  color: var(--text-light);
  margin-top: 4px;
  padding: 0 4px;
  align-self: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.typing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 6px;
  animation: fadeSlideUp 0.2s ease forwards;
  opacity: 0;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1px solid rgba(91, 184, 232, 0.2);
  padding: 12px 15px;
  border-radius: var(--radius-bubble);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}

.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sky-1);
  opacity: 0.45;
  animation: dotBounce 1.3s ease-in-out infinite;
}

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

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40%           { transform: translateY(-7px); opacity: 1; }
}

/* ============================================================
   QUICK OPTIONS
   ============================================================ */

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-btn {
  background: rgba(91, 184, 232, 0.08);
  border: 1.5px solid rgba(91, 184, 232, 0.35);
  border-radius: 20px;
  color: var(--sky-2);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 700;
  padding: 7px 15px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.quick-btn:hover {
  background: rgba(91, 184, 232, 0.18);
  border-color: var(--sky-1);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(91, 184, 232, 0.2);
}

/* ============================================================
   RESERVATION COMPLETE CARD
   ============================================================ */

.reservation-card {
  background: linear-gradient(135deg, #EBF6FD, #D8EEFA);
  border: 1.5px solid rgba(91, 184, 232, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-mid);
  font-weight: 600;
}

.reservation-card-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sky-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.whatsapp-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-top: 12px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-link-btn:hover {
  background: #20BB5A;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(37, 211, 102, 0.4);
}

/* ============================================================
   INPUT AREA
   ============================================================ */

.input-area {
  padding: 10px 0 14px;
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid var(--sky-border);
  border-radius: 20px;
  padding: 9px 10px 9px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within {
  border-color: var(--sky-1);
  box-shadow: 0 0 0 3px rgba(91, 184, 232, 0.15), var(--shadow-md);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.5;
  resize: none;
  max-height: 130px;
  overflow-y: auto;
}

.chat-input::placeholder { color: var(--text-light); }
.chat-input::-webkit-scrollbar { width: 3px; }
.chat-input::-webkit-scrollbar-thumb { background: rgba(91,184,232,0.2); border-radius: 2px; }

.send-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-1), var(--sky-2));
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 10px rgba(91, 184, 232, 0.35);
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 16px rgba(91, 184, 232, 0.5);
}

.send-btn:active  { transform: scale(0.93); }
.send-btn:disabled {
  opacity: 0.4; cursor: not-allowed;
  transform: none; box-shadow: none;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
}

.input-hint {
  font-size: 0.71rem;
  color: var(--text-light);
}

.input-hint kbd {
  background: rgba(91, 184, 232, 0.1);
  border: 1px solid rgba(91, 184, 232, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.67rem;
  color: var(--sky-2);
}

.new-chat-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.71rem;
  font-weight: 600;
  padding: 2px 0;
  transition: color 0.2s;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: transparent;
}

.new-chat-btn:hover {
  color: var(--sky-2);
  text-decoration-color: var(--sky-2);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  position: relative;
  height: 62px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #D8EEFA 0%, #C8E8F5 100%);
  border-top: 1px solid var(--sky-border);
  overflow: hidden;
  z-index: 10;
}

.footer-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
  pointer-events: none;
}

.footer-text {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-rose { font-size: 0.85rem; }

.footer-powered {
  font-size: 0.67rem;
  color: var(--sky-2);
  font-weight: 600;
  opacity: 0.75;
}

/* ============================================================
   WHATSAPP FAB BUTTON
   ============================================================ */

.whatsapp-fab {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  border-radius: 50px;
  padding: 12px 20px 12px 16px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  animation: fabBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             fabPulse 2.5s ease-in-out infinite 1s;
  transition: transform 0.15s, box-shadow 0.15s;
}

.whatsapp-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 26px rgba(37, 211, 102, 0.55);
}

@keyframes fabBounce {
  from { transform: scale(0.6) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45); }
  50%       { box-shadow: 0 4px 28px rgba(37, 211, 102, 0.65), 0 0 0 6px rgba(37, 211, 102, 0.1); }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */

@media (max-width: 600px) {
  .site-header { height: 76px; }
  .logo-img     { height: 58px; }

  .site-footer  { display: none; }

  .messages-area { gap: 10px; padding: 14px 0 8px; }
  .message-bubble { max-width: 85%; font-size: 0.9rem; }
  .message-avatar { width: 30px; height: 30px; font-size: 0.56rem; }

  .chat-container { padding: 0 10px; }

  .chat-input { font-size: 16px; max-height: 100px; }
  .input-hint { display: none; }
  .input-footer { justify-content: flex-end; }

  .input-area {
    padding: 8px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .send-btn { width: 44px; height: 44px; }

  .quick-btn { font-size: 0.8rem; padding: 8px 14px; }

  .rose-decor-1 { width: 260px; height: 260px; }
  .rose-decor-2 { width: 200px; height: 200px; }
  .rose-decor-3,
  .rose-decor-4 { display: none; }

  .whatsapp-fab { bottom: 14px; right: 14px; }
}

/* ============================================================
   MAP CARD — QR + Link
   ============================================================ */

.map-card {
  background: linear-gradient(135deg, #EBF6FD, #D8EEFA);
  border: 1.5px solid rgba(91, 184, 232, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 10px;
}

.map-card-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--sky-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.map-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.qr-img {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  border: 2px solid rgba(91, 184, 232, 0.3);
  background: #EBF6FD;
  flex-shrink: 0;
}

.map-card-info { flex: 1; min-width: 140px; }

.maps-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sky-1);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-top: 8px;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 3px 10px rgba(91, 184, 232, 0.3);
}

.maps-link-btn:hover { background: var(--sky-2); transform: translateY(-1px); }

/* ============================================================
   MENU CARD — Carta visual
   ============================================================ */

.menu-card {
  background: var(--white);
  border: 1.5px solid rgba(91, 184, 232, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 10px;
}

.menu-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  margin-top: 8px;
}

.menu-tab {
  background: rgba(91, 184, 232, 0.08);
  border: 1.5px solid rgba(91, 184, 232, 0.25);
  border-radius: 20px;
  color: var(--sky-2);
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.menu-tab.active {
  background: var(--sky-1);
  border-color: var(--sky-1);
  color: var(--white);
}

.menu-img {
  width: 100%;
  max-width: 460px;
  border-radius: 10px;
  border: 1px solid rgba(91, 184, 232, 0.15);
  cursor: zoom-in;
  display: block;
  transition: transform 0.2s;
}

.menu-img:hover { transform: scale(1.01); }

/* ============================================================
   LEAD / CAPTURE FORM (if needed)
   ============================================================ */

.lead-bubble { max-width: 90% !important; }

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
}

.lead-input {
  background: rgba(91, 184, 232, 0.06);
  border: 1.5px solid rgba(91, 184, 232, 0.25);
  border-radius: 10px;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lead-input:focus {
  border-color: var(--sky-1);
  box-shadow: 0 0 0 3px rgba(91, 184, 232, 0.1);
}

.lead-input::placeholder { color: var(--text-light); }

.lead-submit {
  background: linear-gradient(135deg, var(--sky-1), var(--sky-2));
  border: none;
  border-radius: 10px;
  color: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 20px;
  align-self: flex-start;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 12px rgba(91, 184, 232, 0.3);
}

.lead-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.lead-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
