/* ============================================
   Sicily Vibe - Personal Concierge Widget
   Luxury Mediterranean Aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
  --sv-gold: #c9a96e;
  --sv-gold-light: #e0c994;
  --sv-gold-dark: #a8853d;
  --sv-navy: #1a2332;
  --sv-navy-light: #243044;
  --sv-navy-dark: #0f1620;
  --sv-white: #faf8f5;
  --sv-cream: #f5f0e8;
  --sv-sea: #2e6b7e;
  --sv-sea-light: #3d8a9f;
  --sv-terracotta: #c27c5e;
  --sv-text: #2c2c2c;
  --sv-text-light: #6b6b6b;
  --sv-shadow: rgba(26, 35, 50, 0.15);
  --sv-shadow-strong: rgba(26, 35, 50, 0.3);
  --sv-radius: 16px;
  --sv-font-heading: 'Cormorant Garamond', Georgia, serif;
  --sv-font-body: 'Montserrat', 'Helvetica Neue', sans-serif;
  --sv-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset for widget scope */
.sv-concierge *,
.sv-concierge *::before,
.sv-concierge *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Launcher Button ---- */
.sv-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99998;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sv-navy) 0%, var(--sv-navy-light) 100%);
  box-shadow:
    0 4px 20px var(--sv-shadow-strong),
    0 0 0 0 rgba(201, 169, 110, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--sv-transition);
  animation: sv-pulse 3s ease-in-out infinite;
}

.sv-launcher:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 28px var(--sv-shadow-strong),
    0 0 0 8px rgba(201, 169, 110, 0.15);
}

.sv-launcher.sv-open {
  animation: none;
  transform: rotate(0deg);
}

@keyframes sv-pulse {
  0%, 100% { box-shadow: 0 4px 20px var(--sv-shadow-strong), 0 0 0 0 rgba(201, 169, 110, 0.4); }
  50% { box-shadow: 0 4px 20px var(--sv-shadow-strong), 0 0 0 10px rgba(201, 169, 110, 0); }
}

.sv-launcher-icon {
  width: 28px;
  height: 28px;
  transition: all 0.3s var(--sv-transition);
}

.sv-launcher.sv-open .sv-launcher-icon-chat {
  display: none;
}

.sv-launcher:not(.sv-open) .sv-launcher-icon-close {
  display: none;
}

/* ---- Chat Window ---- */
.sv-chat-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  z-index: 99999;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 140px);
  border-radius: var(--sv-radius);
  background: var(--sv-white);
  box-shadow: 0 12px 48px var(--sv-shadow-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s var(--sv-transition);
}

.sv-chat-window.sv-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ---- Header ---- */
.sv-header {
  background: linear-gradient(135deg, var(--sv-navy) 0%, var(--sv-navy-light) 60%, var(--sv-sea) 100%);
  padding: 20px 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.sv-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.sv-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.sv-header-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sv-gold) 0%, var(--sv-gold-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sv-font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--sv-navy);
  flex-shrink: 0;
}

.sv-header-info h2 {
  font-family: var(--sv-font-heading);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.sv-header-info p {
  font-family: var(--sv-font-body);
  font-size: 11px;
  font-weight: 300;
  opacity: 0.8;
  letter-spacing: 0.3px;
}

.sv-status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  animation: sv-status-blink 2s ease-in-out infinite;
}

@keyframes sv-status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---- Messages Area ---- */
.sv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, var(--sv-cream) 0%, var(--sv-white) 40%);
  scroll-behavior: smooth;
}

.sv-messages::-webkit-scrollbar {
  width: 4px;
}

.sv-messages::-webkit-scrollbar-track {
  background: transparent;
}

.sv-messages::-webkit-scrollbar-thumb {
  background: var(--sv-gold-light);
  border-radius: 4px;
}

/* ---- Message Bubbles ---- */
.sv-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: sv-message-in 0.4s var(--sv-transition);
}

@keyframes sv-message-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sv-message-bot {
  align-self: flex-start;
}

.sv-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.sv-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sv-message-bot .sv-message-avatar {
  background: linear-gradient(135deg, var(--sv-gold) 0%, var(--sv-gold-light) 100%);
  color: var(--sv-navy);
  font-family: var(--sv-font-heading);
  font-weight: 600;
}

.sv-message-user .sv-message-avatar {
  background: var(--sv-sea);
  color: white;
}

.sv-message-bubble {
  padding: 12px 16px;
  font-family: var(--sv-font-body);
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--sv-text);
}

.sv-message-bot .sv-message-bubble {
  background: white;
  border-radius: 2px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sv-message-user .sv-message-bubble {
  background: linear-gradient(135deg, var(--sv-navy) 0%, var(--sv-navy-light) 100%);
  color: white;
  border-radius: 16px 2px 16px 16px;
}

/* ---- Typing Indicator ---- */
.sv-typing {
  display: flex;
  gap: 10px;
  align-self: flex-start;
  max-width: 88%;
}

.sv-typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 18px;
  background: white;
  border-radius: 2px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sv-typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--sv-gold);
  border-radius: 50%;
  animation: sv-typing-bounce 1.4s ease-in-out infinite;
}

.sv-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.sv-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sv-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---- Quick Reply Buttons ---- */
.sv-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px 42px;
  animation: sv-message-in 0.4s var(--sv-transition);
}

.sv-quick-reply {
  padding: 8px 16px;
  border: 1.5px solid var(--sv-gold);
  border-radius: 20px;
  background: white;
  color: var(--sv-navy);
  font-family: var(--sv-font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--sv-transition);
  white-space: nowrap;
}

.sv-quick-reply:hover {
  background: linear-gradient(135deg, var(--sv-gold) 0%, var(--sv-gold-light) 100%);
  color: var(--sv-navy-dark);
  border-color: var(--sv-gold);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(201, 169, 110, 0.3);
}

/* ---- Service Cards ---- */
.sv-card-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px 42px;
  scroll-snap-type: x mandatory;
  animation: sv-message-in 0.4s var(--sv-transition);
}

.sv-card-container::-webkit-scrollbar {
  height: 3px;
}

.sv-card-container::-webkit-scrollbar-thumb {
  background: var(--sv-gold-light);
  border-radius: 3px;
}

.sv-card {
  min-width: 220px;
  max-width: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.3s var(--sv-transition);
  scroll-snap-align: start;
  flex-shrink: 0;
}

.sv-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.sv-card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.sv-card-body {
  padding: 12px 14px;
}

.sv-card-body h4 {
  font-family: var(--sv-font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--sv-navy);
  margin-bottom: 4px;
}

.sv-card-body p {
  font-family: var(--sv-font-body);
  font-size: 11.5px;
  color: var(--sv-text-light);
  line-height: 1.4;
  margin-bottom: 8px;
}

.sv-card-price {
  font-family: var(--sv-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--sv-gold-dark);
}

.sv-card-btn {
  display: block;
  width: 100%;
  padding: 9px;
  border: none;
  background: linear-gradient(135deg, var(--sv-navy) 0%, var(--sv-navy-light) 100%);
  color: var(--sv-gold-light);
  font-family: var(--sv-font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s var(--sv-transition);
}

.sv-card-btn:hover {
  background: linear-gradient(135deg, var(--sv-gold-dark) 0%, var(--sv-gold) 100%);
  color: var(--sv-navy-dark);
}

/* ---- Input Area ---- */
.sv-input-area {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.sv-input-wrapper {
  flex: 1;
  position: relative;
}

.sv-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e2dc;
  border-radius: 24px;
  font-family: var(--sv-font-body);
  font-size: 13.5px;
  color: var(--sv-text);
  background: var(--sv-cream);
  outline: none;
  transition: all 0.25s var(--sv-transition);
  resize: none;
  max-height: 100px;
  line-height: 1.4;
}

.sv-input::placeholder {
  color: #aaa;
  font-weight: 300;
}

.sv-input:focus {
  border-color: var(--sv-gold);
  background: white;
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.12);
}

.sv-send-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sv-gold) 0%, var(--sv-gold-dark) 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--sv-transition);
  flex-shrink: 0;
}

.sv-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 3px 12px rgba(201, 169, 110, 0.4);
}

.sv-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.sv-send-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Footer ---- */
.sv-footer {
  padding: 8px 20px;
  text-align: center;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.sv-footer a {
  font-family: var(--sv-font-body);
  font-size: 10.5px;
  color: var(--sv-text-light);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.sv-footer a:hover {
  color: var(--sv-gold-dark);
}

/* ---- Welcome Screen ---- */
.sv-welcome {
  text-align: center;
  padding: 30px 24px 10px;
}

.sv-welcome-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--sv-gold) 0%, var(--sv-gold-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.sv-welcome h3 {
  font-family: var(--sv-font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--sv-navy);
  margin-bottom: 6px;
}

.sv-welcome p {
  font-family: var(--sv-font-body);
  font-size: 12.5px;
  color: var(--sv-text-light);
  line-height: 1.5;
  font-weight: 300;
}

/* ---- Language Selector ---- */
.sv-lang-selector {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 10px;
}

.sv-lang-btn {
  padding: 5px 12px;
  border: 1px solid #e5e2dc;
  border-radius: 14px;
  background: white;
  font-family: var(--sv-font-body);
  font-size: 11px;
  color: var(--sv-text-light);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ---- Voice Button ---- */
.sv-voice-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--sv-cream);
  color: var(--sv-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--sv-transition);
  flex-shrink: 0;
}

.sv-voice-btn:hover {
  background: var(--sv-navy);
  color: var(--sv-gold-light);
}

.sv-voice-btn.sv-recording {
  background: #ef4444;
  color: white;
  animation: sv-voice-pulse 1s ease-in-out infinite;
}

@keyframes sv-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.sv-voice-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Sound Toggle Button ---- */
.sv-sound-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--sv-cream);
  color: var(--sv-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--sv-transition);
  flex-shrink: 0;
}

.sv-sound-btn:hover,
.sv-sound-btn.sv-active {
  background: var(--sv-navy);
  color: var(--sv-gold-light);
}

.sv-sound-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- Audio Player in Message ---- */
.sv-audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.sv-audio-play-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--sv-gold);
  color: var(--sv-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.sv-audio-play-btn:hover {
  transform: scale(1.1);
}

.sv-audio-label {
  font-size: 11px;
  color: var(--sv-text-light);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .sv-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .sv-launcher {
    bottom: 16px;
    right: 16px;
  }

  .sv-chat-window.sv-visible ~ .sv-launcher {
    display: none;
  }
}
