/* ========================================================
   Bot de Reservas por WhatsApp — Premium Style Sheet
   DSSD © 2026
   ======================================================== */

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1321;
  --bg-surface: rgba(15, 23, 42, 0.65);
  --bg-glass: rgba(22, 34, 57, 0.45);
  --bg-glass-strong: rgba(15, 23, 42, 0.85);

  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glass-hover: rgba(255, 255, 255, 0.12);

  --green: #10b981;
  --green-light: #34d399;
  --green-glow: rgba(16, 185, 129, 0.25);
  --wa-green: #25d366;
  --wa-green-dark: #128c7e;

  --blue: #3b82f6;
  --purple: #8b5cf6;
  --amber: #f59e0b;
  --red: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(37, 211, 102, 0.15);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Background Orbs --- */
.background {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.25;
  animation: orbFloat 16s infinite alternate ease-in-out;
}
.orb-1 { width: 550px; height: 550px; background: var(--green); top: -10%; right: -5%; }
.orb-2 { width: 450px; height: 450px; background: var(--purple); bottom: -10%; left: -5%; animation-delay: -6s; }
.orb-3 { width: 350px; height: 350px; background: var(--blue); top: 40%; left: 30%; opacity: 0.12; animation-delay: -12s; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(80px, 50px) scale(1); }
}

/* --- Back to Home Button --- */
.back-btn {
  position: fixed;
  top: 20px; left: 20px;
  z-index: 999;
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-light);
  padding: 10px;
  width: 44px; height: 44px;
  text-decoration: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: var(--transition);
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
}

.back-btn:hover {
  width: 175px;
  background: rgba(16, 185, 129, 0.3);
  border-color: var(--green-light);
  box-shadow: 0 0 15px var(--green-glow);
}

.back-btn .icon {
  font-size: 18px;
  min-width: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.back-btn .text {
  opacity: 0;
  margin-left: 10px;
  transition: opacity 0.25s ease;
  font-size: 0.88rem;
}

.back-btn:hover .text {
  opacity: 1;
}

/* --- Layout Grid --- */
.app-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 30px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 80px 30px 40px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  align-items: center;
}

/* --- Left Side: Business CRM Dashboard --- */
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-header {
  margin-bottom: 8px;
}

.dashboard-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 6px;
}

/* --- Metrics Grid --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.metric-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-icon {
  width: 48px; height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-card.green-theme .metric-icon { background: rgba(16, 185, 129, 0.12); color: var(--green-light); }
.metric-card.blue-theme .metric-icon { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.metric-card.purple-theme .metric-icon { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }
.metric-card.amber-theme .metric-icon { background: rgba(245, 158, 11, 0.12); color: var(--amber-light); }

.metric-info label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.metric-info .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

/* --- Weekly Calendar View --- */
.calendar-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.calendar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  gap: 8px;
  text-align: center;
}

.calendar-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.time-col {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.calendar-cell {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 0.75rem;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-muted);
  cursor: pointer;
}

.calendar-cell:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

.calendar-cell.booked {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green-light);
  font-weight: 600;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
}

.calendar-cell.just-booked {
  animation: bookingPulse 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bookingPulse {
  0% {
    transform: scale(0.95);
    background: rgba(16, 185, 129, 0.8);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
  }
  100% {
    transform: scale(1);
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: var(--green-light);
    box-shadow: 0 0 0px transparent;
  }
}

.calendar-cell .client-name {
  font-size: 0.68rem;
  opacity: 0.9;
  margin-top: 2px;
}

.calendar-cell.pre-booked {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

/* --- Scenario Panel --- */
.scenarios-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.scenarios-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.scenarios-card > p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.scenario-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scenario-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.scenario-btn span {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* --- Right Side: Phone Wrapper & Chat simulator --- */
.phone-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.phone-card {
  width: 320px;
  height: 640px;
  background: rgba(25, 36, 56, 0.35);
  border: 4px solid rgba(255, 255, 255, 0.08);
  outline: 1px solid rgba(0, 0, 0, 0.8);
  border-radius: 44px;
  padding: 10px;
  box-shadow: var(--shadow-lg), 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  position: relative;
}

.phone-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 60%);
  pointer-events: none;
}

/* Screen Notch */
.phone-notch {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 24px;
  background: #000;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 20;
}

.phone-screen {
  width: 100%; height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: #090e17;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* WhatsApp Theme Headers */
.wa-header {
  background: rgba(22, 34, 57, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 28px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 10;
}

.wa-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--wa-green), var(--wa-green-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.25);
}

.wa-status h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.wa-status span {
  font-size: 0.68rem;
  color: var(--wa-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-status span::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--wa-green);
  border-radius: 50%;
  animation: statusPulse 1.2s infinite alternate ease-in-out;
}

@keyframes statusPulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Chat Body */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-image: radial-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 12px 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.8rem;
  line-height: 1.4;
  position: relative;
  animation: messageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg.client {
  background: var(--wa-green);
  color: #050a12;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.chat-msg.bot {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg-time {
  font-size: 0.62rem;
  opacity: 0.6;
  text-align: right;
  margin-top: 4px;
}

/* Typing indicator */
.typing-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-bubble span {
  width: 6px; height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1s infinite alternate;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  from { transform: translateY(0); opacity: 0.3; }
  to { transform: translateY(-4px); opacity: 1; }
}

/* Chat Input bar */
.chat-footer {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 34, 57, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-input-form {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.8rem;
  outline: none;
  transition: var(--transition);
}

.chat-input-field:focus {
  border-color: rgba(37, 211, 102, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.chat-send-btn {
  width: 36px; height: 36px;
  background: var(--wa-green);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000;
  font-size: 0.95rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.3);
}

/* --- Context Demo Box --- */
.demo-context {
  position: fixed;
  bottom: 24px; left: 24px;
  background: var(--bg-glass-strong);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid var(--green);
  color: #fff;
  padding: 18px;
  border-radius: var(--radius-lg);
  max-width: 340px;
  z-index: 999;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  animation: contextSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.demo-context h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--green-light);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-context .demo-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.demo-context .demo-close:hover {
  color: #fff;
}

.demo-context p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- Toast Notification System --- */
.toast-container {
  position: fixed;
  top: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: #fff;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(120%);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast.success { border-left-color: var(--green); }
.toast.warning { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--red); }

@keyframes toastIn {
  to { transform: translateX(0); }
}

.toast-out {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastOut {
  to { transform: translateX(150%); opacity: 0; }
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding-top: 100px;
    gap: 40px;
  }

  .phone-wrapper {
    order: -1; /* Muestra el teléfono arriba en pantallas medianas/pequeñas */
  }

  .dashboard-header {
    text-align: center;
  }
}

@media (max-width: 600px) {
  .app-layout {
    padding-left: 15px;
    padding-right: 15px;
  }

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

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

  .calendar-grid {
    font-size: 0.65rem;
    grid-template-columns: 60px repeat(5, 1fr);
  }

  .time-col {
    font-size: 0.65rem;
  }

  .calendar-cell {
    font-size: 0.65rem;
    min-height: 40px;
  }
}
