/* ============================================
   ELITE SALOON — Components
   Chat Widget · Lightbox · Toasts
   ============================================ */

/* ---- Chat Toggle Button ---- */
.chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(201,160,48,0.4);
  z-index: 900;
  transition: all 0.3s ease;
  font-size: 1.3rem;
}
.chat-toggle:hover {
  background: var(--gold-light);
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(201,160,48,0.55);
}

/* ---- Chat Window ---- */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
.chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Chat Header */
.chat-header {
  background: var(--bg);
  border-bottom: 1px solid var(--gold-border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.chat-header__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--bg);
  font-weight: 700;
}
.chat-header__info { flex: 1; }
.chat-header__name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}
.chat-header__status {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}
.chat-header__status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2ECC71;
  display: inline-block;
}
.chat-header__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}
.chat-header__close:hover { color: var(--text); }

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 2px; }

.chat-msg {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  animation: msgFade 0.2s ease;
}
@keyframes msgFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg--user { flex-direction: row-reverse; }
.chat-msg__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--bg);
}
.chat-msg--user .chat-msg__avatar {
  background: var(--bg-card-2);
  color: var(--text-muted);
  border: 1px solid var(--gold-border);
}
.chat-msg__bubble {
  max-width: 76%;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-card-2);
  border: 1px solid var(--gold-border);
}
.chat-msg--user .chat-msg__bubble {
  background: var(--gold);
  color: var(--bg);
  border-color: transparent;
}
.chat-msg__time {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card-2);
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  width: fit-content;
}
.chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: typingDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.3; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* Quick replies */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.5rem;
}
.chat-quick-reply {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--gold-border);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.chat-quick-reply:hover { border-color: var(--gold); color: var(--gold); }

/* Input */
.chat-input-area {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--gold-border);
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
  background: var(--bg);
}
.chat-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--gold); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  font-size: 0.85rem;
}
.chat-send:hover { background: var(--gold-light); }
.chat-send:disabled { background: var(--bg-card-2); cursor: not-allowed; }
.chat-footer {
  padding: 0.4rem 1rem;
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  background: var(--bg);
  border-top: 1px solid rgba(201,160,48,0.06);
  flex-shrink: 0;
}
.chat-footer a { color: var(--gold); }

/* Mobile chat */
@media (max-width: 420px) {
  .chat-window { right: 12px; left: 12px; width: auto; bottom: 90px; }
  .chat-toggle { bottom: 20px; right: 20px; }
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox__img {
  max-width: 88vw;
  max-height: 88vh;
  border-radius: 4px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  border: 1px solid var(--gold-border);
}
.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  font-family: var(--font);
}
.lightbox__close:hover { color: var(--gold); }

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  top: 90px; right: 20px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-card-2);
  border: 1px solid var(--gold-border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-family: var(--font);
  letter-spacing: 0.03em;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  max-width: 300px;
}
.toast--success { border-color: rgba(46,204,113,0.4); }
.toast--error   { border-color: rgba(231,76,60,0.4); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
