/* ============================================================
   Maxxage Valencia — Chat Widget
   Palette: burgundy #664750 · cream #fdf7f2 · warm tan #bfa498
   Fonts: EB Garamond (serif display) + Muli (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@500;600;700&family=Muli:wght@400;500;600;700&display=swap');

#maxxag-chat-root * {
  box-sizing: border-box; margin: 0; padding: 0;
  font-family: 'Muli', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── VLC Color tokens ────────────────────────────────────────── */
/* --primary: #664750 (burgundy)
   --primary-rgb: 102,71,80
   --accent: #bfa498 (warm tan)
   --bg-dark: #3a2c39 (charcoal plum)
   --bg-window: rgba(58,44,57,0.75)
   --text: #fdf7f2 (cream)  */

/* ── Floating button ─────────────────────────────────────────── */
#maxxag-chat-btn {
  position: fixed; bottom: 28px; right: 28px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #664750, #3a2c39);
  box-shadow: 0 8px 28px rgba(102,71,80,0.5);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border: none; z-index: 99998;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#maxxag-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(102,71,80,0.65);
}
#maxxag-chat-btn svg { width: 26px; height: 26px; fill: #fdf7f2; }
#maxxag-chat-btn::before {
  content: ''; position: absolute; width: 100%; height: 100%;
  border-radius: 50%; background: rgba(102,71,80,0.35);
  animation: maxxag-pulse 2.6s ease-out infinite;
}
@keyframes maxxag-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(2.1); opacity: 0; }
}
.maxxag-notif {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px;
  background: #f51957; border-radius: 50%; border: 2px solid #3a2c39;
  font-size: 9px; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* ── Chat window ─────────────────────────────────────────────── */
#maxxag-chat-window {
  position: fixed; bottom: 104px; right: 28px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 580px; max-height: calc(100vh - 130px);
  background: rgba(58,44,57,0.8);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border-radius: 24px;
  border: 1px solid rgba(191,164,152,0.15);
  box-shadow: 0 40px 100px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; overflow: hidden;
  z-index: 99999;
  transform: translateY(22px) scale(0.96);
  opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34,1.5,0.64,1), opacity 0.28s ease;
}
#maxxag-chat-window.maxxag-open {
  transform: translateY(0) scale(1); opacity: 1; pointer-events: all;
}

/* ── Header ──────────────────────────────────────────────────── */
#maxxag-chat-header {
  flex-shrink: 0;
  background: rgba(102,71,80,0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(191,164,152,0.12);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.maxxag-header-avatar-wrap {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(191,164,152,0.35);
  flex-shrink: 0; background: rgba(191,164,152,0.1);
  display: flex; align-items: center; justify-content: center;
}
.maxxag-header-avatar-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 2px; }
.maxxag-avatar-letter { font-size: 16px; font-weight: 700; color: #fdf7f2; font-family: 'EB Garamond', serif; }
.maxxag-header-info { flex: 1; min-width: 0; }
.maxxag-bot-name {
  font-size: 15px; font-weight: 600; color: #fdf7f2;
  font-family: 'EB Garamond', serif;
  letter-spacing: 0.2px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.maxxag-status {
  font-size: 11px; color: rgba(253,247,242,0.5);
  margin-top: 2px; display: flex; align-items: center; gap: 5px;
}
.maxxag-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #28a800; display: inline-block; box-shadow: 0 0 4px #28a800;
  animation: maxxag-blink 2.2s ease-in-out infinite;
}
#maxxag-chat-close {
  background: rgba(253,247,242,0.06); border: none;
  width: 36px; height: 36px; border-radius: 8px;
  color: rgba(253,247,242,0.5); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; line-height: 1; flex-shrink: 0;
}
#maxxag-chat-close:hover { background: rgba(253,247,242,0.12); color: #fdf7f2; }
#maxxag-chat-close svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes maxxag-blink { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ── Messages ────────────────────────────────────────────────── */
#maxxag-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: rgba(191,164,152,0.15) transparent;
}
#maxxag-chat-messages::-webkit-scrollbar { width: 3px; }
#maxxag-chat-messages::-webkit-scrollbar-thumb { background: rgba(191,164,152,0.2); border-radius: 2px; }

.maxxag-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #664750, #4a3440);
  color: #fdf7f2;
  padding: 12px 18px; border-radius: 18px; border-bottom-right-radius: 5px;
  max-width: 75%; font-size: 14.5px; line-height: 1.6;
  word-break: break-word;
  box-shadow: 0 4px 18px rgba(102,71,80,0.35);
  animation: maxxag-fade-in 0.22s ease; white-space: pre-line;
}
.maxxag-bot-group {
  display: flex; flex-direction: column; gap: 4px;
  align-self: flex-start; max-width: 88%; width: 100%;
  animation: maxxag-fade-in 0.22s ease;
}
.maxxag-bot-meta { display: flex; align-items: center; gap: 8px; padding: 0 2px; }
.maxxag-bot-meta-avatar {
  width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(191,164,152,0.25); flex-shrink: 0;
  background: rgba(191,164,152,0.1);
}
.maxxag-bot-meta-avatar img { width: 100%; height: 100%; object-fit: cover; }
.maxxag-bot-meta-name { font-size: 12px; font-weight: 600; color: rgba(253,247,242,0.6); font-family: 'EB Garamond', serif; }
.maxxag-msg.bot {
  background: rgba(253,247,242,0.06);
  border: 1px solid rgba(191,164,152,0.12);
  color: rgba(253,247,242,0.92);
  padding: 12px 18px; border-radius: 18px; border-top-left-radius: 5px;
  font-size: 14px; line-height: 1.6; white-space: pre-line; align-self: flex-start; max-width: 100%;
}
.maxxag-ts { font-size: 10px; color: rgba(253,247,242,0.25); padding: 0 4px; margin-top: 2px; }
.maxxag-ts.right { text-align: right; }
.maxxag-bot-group .maxxag-ts { padding-left: 38px; }
.maxxag-user-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-left: 15%; animation: maxxag-fade-in 0.22s ease; }
@keyframes maxxag-fade-in { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* Typing */
.maxxag-typing {
  display: flex; align-items: center; gap: 5px; padding: 12px 16px;
  background: rgba(253,247,242,0.06); border: 1px solid rgba(191,164,152,0.1);
  border-radius: 18px; border-top-left-radius: 5px;
  align-self: flex-start; width: fit-content; animation: maxxag-fade-in 0.22s ease;
}
.maxxag-typing span { width: 7px; height: 7px; background: rgba(191,164,152,0.5); border-radius: 50%; animation: maxxag-bounce 1.3s ease-in-out infinite; }
.maxxag-typing span:nth-child(2){animation-delay:.18s;}
.maxxag-typing span:nth-child(3){animation-delay:.36s;}
@keyframes maxxag-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* ── Language selector ───────────────────────────────────────── */
.maxxag-lang-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 20px; gap: 10px; animation: maxxag-fade-in 0.3s ease; height: 100%; }
.maxxag-lang-title { font-size: 20px; font-weight: 600; color: #fdf7f2; text-align: center; margin-bottom: 2px; font-family: 'EB Garamond', serif; }
.maxxag-lang-subtitle { font-size: 12px; color: rgba(253,247,242,0.45); text-align: center; margin-bottom: 12px; }
.maxxag-lang-btn {
  width: 100%; padding: 13px 18px;
  background: rgba(253,247,242,0.05); border: 1px solid rgba(191,164,152,0.15);
  border-radius: 14px; color: rgba(253,247,242,0.9); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; gap: 14px;
  transition: all 0.18s; font-family: inherit; text-align: left;
}
.maxxag-lang-btn:hover { background: rgba(102,71,80,0.3); border-color: rgba(102,71,80,0.5); transform: translateY(-2px); }
.maxxag-lang-btn .flag { font-size: 24px; }
.maxxag-lang-btn .lname { font-weight: 600; flex: 1; }
.maxxag-lang-btn .lnat { font-size: 12px; color: rgba(253,247,242,0.35); }

/* ── Buttons ─────────────────────────────────────────────────── */
.maxxag-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; width: 100%; }
.maxxag-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.maxxag-btn-grid .maxxag-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.maxxag-btn-divider { height: 1px; background: rgba(191,164,152,0.1); margin: 2px 0; }
.maxxag-btn {
  background: rgba(253,247,242,0.05); color: rgba(253,247,242,0.88);
  border: 1px solid rgba(191,164,152,0.18); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; font-family: inherit;
  line-height: 1.3; text-align: center; animation: maxxag-btn-in 0.3s ease both;
}
.maxxag-btn-grid .maxxag-btn:nth-child(1){animation-delay:.03s} .maxxag-btn-grid .maxxag-btn:nth-child(2){animation-delay:.08s}
.maxxag-btn-grid .maxxag-btn:nth-child(3){animation-delay:.13s} .maxxag-btn-grid .maxxag-btn:nth-child(4){animation-delay:.18s}
.maxxag-btn-grid .maxxag-btn:nth-child(5){animation-delay:.23s} .maxxag-btn-grid .maxxag-btn:nth-child(6){animation-delay:.28s}
@keyframes maxxag-btn-in { from{opacity:0;transform:translateY(6px) scale(0.96)} to{opacity:1;transform:translateY(0) scale(1)} }
.maxxag-btn:hover { background: rgba(102,71,80,0.35); border-color: rgba(102,71,80,0.55); color: #fdf7f2; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(102,71,80,0.25); }
.maxxag-btn:active { transform: translateY(0); box-shadow: none; }
.maxxag-btn.action-btn { background: linear-gradient(135deg, rgba(102,71,80,0.25), rgba(191,164,152,0.12)); border-color: rgba(102,71,80,0.4); color: #fdf7f2; font-weight: 600; box-shadow: 0 2px 8px rgba(102,71,80,0.15); }
.maxxag-btn.action-btn:hover { background: linear-gradient(135deg, rgba(102,71,80,0.45), rgba(191,164,152,0.2)); box-shadow: 0 4px 16px rgba(102,71,80,0.3); }
.maxxag-btn.full-width { width: 100%; }
.maxxag-btn.wa-btn { background: rgba(37,211,102,0.08); border-color: rgba(37,211,102,0.25); color: #4ade80; font-weight: 600; }
.maxxag-btn.wa-btn:hover { background: rgba(37,211,102,0.18); }
.maxxag-btn.tg-btn { background: rgba(38,161,228,0.08); border-color: rgba(38,161,228,0.25); color: #60aff0; font-weight: 600; }
.maxxag-btn.tg-btn:hover { background: rgba(38,161,228,0.18); }

/* ── Girl cards ──────────────────────────────────────────────── */
.maxxag-girls-grid { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.maxxag-girl-card { background: rgba(253,247,242,0.04); border: 1px solid rgba(191,164,152,0.12); border-radius: 14px; overflow: hidden; display: flex; transition: border-color 0.2s; animation: maxxag-fade-in 0.3s ease; }
.maxxag-girl-card:hover { border-color: rgba(102,71,80,0.4); background: rgba(253,247,242,0.06); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.maxxag-girl-card { transition: all 0.2s ease; }
.maxxag-girl-card img { width: 86px; height: 106px; object-fit: cover; flex-shrink: 0; }
.maxxag-girl-info { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.maxxag-girl-name { font-size: 14px; font-weight: 700; color: #fdf7f2; font-family: 'EB Garamond', serif; }
.maxxag-girl-meta { font-size: 11px; color: rgba(253,247,242,0.45); margin-top: 2px; }
.maxxag-girl-desc { font-size: 12px; color: rgba(253,247,242,0.6); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.maxxag-girl-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.maxxag-badge { background: rgba(102,71,80,0.2); border: 1px solid rgba(102,71,80,0.3); color: rgba(191,164,152,0.9); font-size: 10px; padding: 2px 8px; border-radius: 10px; }
.maxxag-badge.outcall { background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); color: #86efac; }
.maxxag-girl-wa { display: inline-block; margin-top: 7px; background: rgba(37,211,102,0.12); border: 1px solid rgba(37,211,102,0.2); color: #4ade80; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 10px; text-decoration: none; transition: all 0.2s; }
.maxxag-girl-wa:hover { background: rgba(37,211,102,0.22); }

/* ── Rates ───────────────────────────────────────────────────── */
.maxxag-rates { width: 100%; }
.maxxag-rates-title { font-size: 15px; font-weight: 700; color: #fdf7f2; margin-bottom: 10px; font-family: 'EB Garamond', serif; }
.maxxag-rates-table { width: 100%; border-collapse: collapse; }
.maxxag-rates-table tr { border-bottom: 1px solid rgba(191,164,152,0.08); }
.maxxag-rates-table tr:last-child { border-bottom: none; }
.maxxag-rates-table td { padding: 7px 4px; font-size: 13px; color: rgba(253,247,242,0.65); }
.maxxag-rates-table td:last-child { font-weight: 700; color: #bfa498; text-align: right; }
.maxxag-rates-note { font-size: 11px; color: rgba(253,247,242,0.3); margin-top: 8px; font-style: italic; }

/* ── Input bar ───────────────────────────────────────────────── */
#maxxag-chat-input-row {
  background: rgba(102,71,80,0.1); border-top: 1px solid rgba(191,164,152,0.1);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#maxxag-chat-input {
  flex: 1; background: rgba(253,247,242,0.04); border: 1px solid rgba(191,164,152,0.1);
  border-radius: 20px; padding: 8px 16px; outline: none;
  color: rgba(253,247,242,0.9); font-size: 14px; resize: none; max-height: 80px;
  line-height: 1.5; font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
#maxxag-chat-input:focus { border-color: rgba(191,164,152,0.3); background: rgba(253,247,242,0.06); }
#maxxag-chat-input::placeholder { color: rgba(253,247,242,0.28); }
#maxxag-chat-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #664750, #4a3440);
  border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 3px 12px rgba(102,71,80,0.4);
}
#maxxag-chat-send:hover { transform: scale(1.1); box-shadow: 0 5px 18px rgba(102,71,80,0.6); }
#maxxag-chat-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
#maxxag-chat-send svg { width: 17px; height: 17px; fill: #fdf7f2; }

/* ── Proactive notification ──────────────────────────────────── */
.maxxag-proactive {
  position: fixed;
  bottom: 90px; right: 20px;
  background: linear-gradient(135deg, rgba(102,71,80,0.95), rgba(74,52,64,0.95));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: #fdf7f2;
  padding: 14px 18px 14px 16px;
  border-radius: 18px 18px 6px 18px;
  font-size: 14px;
  font-family: inherit;
  box-shadow: 0 8px 32px rgba(102,71,80,0.4), 0 0 0 1px rgba(191,164,152,0.15);
  cursor: pointer;
  animation: maxxag-proactive-in 0.4s ease;
  z-index: 99998;
  max-width: 260px;
  line-height: 1.4;
  display: flex; align-items: center; gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.maxxag-proactive:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 44px rgba(102,71,80,0.5); }
.maxxag-proactive-bell {
  position: relative; font-size: 22px; line-height: 1;
  animation: maxxag-bell-ring 0.6s ease 0.5s;
}
.maxxag-proactive-badge {
  position: absolute; top: -5px; right: -6px;
  background: #f51957; color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(74,52,64,0.95);
}
.maxxag-proactive-text { flex: 1; }
@keyframes maxxag-proactive-in {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes maxxag-bell-ring {
  0% { transform: rotate(0); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-5deg); }
  100% { transform: rotate(0); }
}

/* ── Name screen ────────────────────────────────────────────── */
.maxxag-name-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; padding: 30px 20px; gap: 16px;
}
.maxxag-name-logo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(191,164,152,0.3); }
.maxxag-name-title { font-size: 18px; color: #fdf7f2; font-weight: 500; text-align: center; font-family: 'EB Garamond', serif; }
.maxxag-name-input {
  width: 100%; max-width: 260px; padding: 12px 16px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(191,164,152,0.25);
  border-radius: 12px; color: #fdf7f2; font-size: 15px; text-align: center;
  outline: none; font-family: inherit;
}
.maxxag-name-input:focus { border-color: rgba(191,164,152,0.5); box-shadow: 0 0 0 3px rgba(191,164,152,0.1); }
.maxxag-name-input::placeholder { color: rgba(253,247,242,0.3); }
.maxxag-name-btn {
  padding: 12px 32px; background: linear-gradient(135deg, #664750, #4a3440);
  color: #fdf7f2; border: none; border-radius: 12px; font-size: 15px;
  cursor: pointer; font-family: inherit; font-weight: 500;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(102,71,80,0.4);
}
.maxxag-name-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(102,71,80,0.5); }
.maxxag-name-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Focus & accessibility ───────────────────────────────────── */
.maxxag-btn:focus-visible, .maxxag-lang-btn:focus-visible, .maxxag-name-btn:focus-visible,
#maxxag-chat-close:focus-visible, #maxxag-chat-send:focus-visible {
  outline: 2px solid rgba(191,164,152,0.6);
  outline-offset: 2px;
}
.maxxag-name-input:focus-visible {
  outline: 2px solid rgba(191,164,152,0.6);
  outline-offset: 2px;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 440px) {
  #maxxag-chat-window { bottom:0; right:0; width:100%; max-width:100%; height:100%; max-height:100%; border-radius:0; }
  #maxxag-chat-btn { bottom:18px; right:18px; }
}
