/* ═══════════════════════════════════════════
   Sicily Luxury Chatbot — Styles
   Design: luxury editorial, navy + gold
   ═══════════════════════════════════════════ */

/* ─── RESET & VARIABLES ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0f0f23;
  --navy-light:  #1a1a2e;
  --navy-mid:    #252540;
  --gold:        #c9a84c;
  --gold-light:  #d4b95e;
  --gold-pale:   #f5ecd7;
  --white:       #ffffff;
  --off-white:   #f8f7f4;
  --gray-100:    #e8e6e1;
  --gray-200:    #d1cfc8;
  --gray-400:    #8a877e;
  --gray-600:    #5a584f;
  --text-dark:   #2a2a2a;
  --text-body:   #4a4a4a;
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 30px rgba(0,0,0,0.12);
  --radius:      12px;
  --radius-sm:   8px;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-dark);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── APP LAYOUT ─── */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  background: var(--white);
  overflow: hidden;
}

/* ─── HEADER ─── */
.header {
  background: var(--navy);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.header-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.home-logo {
  height: 120px;
  padding-bottom: 20px;
}

.header-text { flex: 1; }

.header-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.header-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-200);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 1px;
}

.lang-toggle {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--gray-200);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}

.lang-btn:hover:not(.active) {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* ─── CHAT AREA ─── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px 12px;
  scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb {
  background: var(--gray-200);
  border-radius: 2px;
}

/* ─── WELCOME SCREEN ─── */
.welcome {
  text-align: center;
  padding: 60px 40px 40px;
  max-width: 700px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.welcome-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--gold);
}

.welcome h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.welcome p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto 28px;
}

.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.welcome-chip {
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-radius: 22px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.welcome-chip:hover {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ─── MESSAGES ─── */
.message {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  max-width: 900px;
  animation: fadeIn 0.3s ease;
}

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

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

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.message.bot .msg-avatar {
  background: var(--navy);
  color: var(--gold);
}

.message.user .msg-avatar {
  background: var(--gold);
  color: var(--navy);
}

.msg-content {
  max-width: 80%;
  min-width: 0;
}

.message.user .msg-content { text-align: right; }

.msg-bubble {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-body);
}

.message.bot .msg-bubble {
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-top-left-radius: 4px;
}

.message.user .msg-bubble {
  background: var(--navy);
  color: rgba(255,255,255,0.95);
  border-top-right-radius: 4px;
  display: inline-block;
  text-align: left;
}

/* ─── SOURCE CARDS ─── */
.msg-sources {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.source-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.source-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.source-icon {
  width: 30px;
  height: 30px;
  background: var(--gold-pale);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.source-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--gold);
}

.source-card .source-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.source-card .source-label {
  font-size: 11px;
  color: var(--gray-400);
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ─── CLARIFY BOX ─── */
.msg-clarify {
  margin-top: 10px;
  padding: 14px 16px;
  background: #fffcf0;
  border: 1px solid #e8ddb5;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.6;
  white-space: pre-line;
}

/* ─── HANDOFF CTA ─── */
.msg-handoff {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.handoff-intro {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 6px;
  line-height: 1.4;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
}

.cta-whatsapp {
  background: #25D366;
  color: #fff;
}
.cta-whatsapp:hover {
  background: #1eb851;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}

.cta-form {
  background: var(--navy);
  color: var(--gold);
}
.cta-form:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.cta-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ─── TYPING INDICATOR ─── */
.typing {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  animation: fadeIn 0.2s ease;
}

.typing .msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 20px;
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  border-top-left-radius: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--gray-400);
  border-radius: 50%;
  animation: dotPulse 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── INPUT AREA ─── */
.input-area {
  flex-shrink: 0;
  padding: 16px 40px 20px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}

.input-area .input-row {
  max-width: 900px;
  margin: 0 auto;
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--off-white);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 6px 6px 6px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

.input-row textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  padding: 10px 0;
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 120px;
}

.input-row textarea::placeholder {
  color: var(--gray-400);
}

.send-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--navy);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.send-btn:hover { background: var(--navy-mid); transform: scale(1.04); }
.send-btn:active { transform: scale(0.96); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.send-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
}

.input-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 10px;
}

.input-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--gray-400);
  transition: color 0.2s ease, transform 0.2s ease;
}

.input-social a:hover {
  color: var(--text-dark);
  transform: scale(1.1);
}

.input-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.input-hint {
  text-align: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray-400);
  letter-spacing: 0.01em;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.input-hint a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.input-hint a:hover { text-decoration: underline; }

/* ─── HOTEL CARDS (LiteAPI) ─── */
.msg-hotels {
  margin-top: 14px;
}
.hotels-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.hotels-title svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
}
.hotels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hotel-card-link {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s ease;
}
.hotel-card-link:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.hotel-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--gray-100);
}
.hotel-card-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hotel-card-img--placeholder svg {
  width: 32px;
  height: 32px;
  fill: var(--gray-200, #d1d5db);
}
.hotel-card-body {
  padding: 10px 12px 12px;
}
.hotel-card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hotel-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-400, #9ca3af);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.hotel-card-stars {
  color: var(--gold);
  letter-spacing: -1px;
}
.hotel-card-rating {
  background: var(--navy);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.hotel-card-city {
  color: var(--gray-400, #9ca3af);
}
.hotel-card-book {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ─── ITINERARY CARDS ─── */
.msg-itineraries {
  margin-top: 14px;
}
.itin-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.itin-title svg {
  width: 16px;
  height: 16px;
  fill: var(--gold);
}
.itin-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.itin-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s ease;
}
.itin-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}
.itin-card--with-img {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.itin-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--gray-100);
}
.itin-card--with-img .itin-card-body {
  padding: 10px 14px 12px;
}
.itin-card-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.itin-card-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 4px;
}
.itin-card-days {
  font-weight: 500;
}
.itin-card-desc {
  font-size: 12px;
  color: var(--text-body);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.itin-card-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.itin-more {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.5;
  padding: 10px 14px;
  background: #fdfcf8;
  border: 1px solid var(--gold-pale);
  border-radius: var(--radius-sm);
}

/* ─── CLARIFY CHIPS ─── */
.msg-chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msg-chip {
  background: var(--off-white);
  border: 1px solid var(--gray-100);
  border-radius: 22px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-body);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.msg-chip:hover {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ─── NEWSLETTER BLOCK ─── */
.msg-newsletter {
  margin-top: 12px;
  padding: 16px 18px;
  background: #fdfcf8;
  border: 1px solid var(--gold-pale);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}

.newsletter-text {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 12px;
}

.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.newsletter-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s ease;
}

.newsletter-input:focus {
  border-color: var(--gold);
}

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

.newsletter-btn-yes {
  padding: 10px 20px;
  background: var(--navy);
  color: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.newsletter-btn-yes:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.newsletter-btn-no {
  padding: 10px 16px;
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
}

.newsletter-btn-no:hover {
  border-color: var(--gray-400);
  color: var(--text-body);
}

.newsletter-micro {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gray-400);
  line-height: 1.4;
}

.newsletter-micro a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
}

.newsletter-micro a:hover {
  text-decoration: underline;
}

.newsletter-confirm {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  padding: 4px 0;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .header { padding: 12px 16px; }
  .header-logo { height: 32px; }
  .header-title { font-size: 18px; }
  .header-subtitle { font-size: 9px; }
  .chat-area { padding: 16px 16px 8px; }
  .input-area { padding: 10px 16px 14px; }
  .msg-content { max-width: 88%; }
  .hotels-grid { grid-template-columns: 1fr; }
  .welcome { padding: 28px 16px 20px; }
  .welcome h2 { font-size: 22px; }
  .welcome p { font-size: 13px; }
  .welcome-chip { font-size: 12px; padding: 7px 14px; }
}

@media (max-width: 380px) {
  .welcome-chips { gap: 6px; }
  .welcome-chip { padding: 6px 12px; font-size: 11px; }
}
