/* ========================================================
   ARDROSSAN NAILS & SPA — LIVE CHAT WIDGET STYLES
   Designed for luxury nail salon customer experience
======================================================== */

:root {
  --as-chat-gold-1: #c9935a;
  --as-chat-gold-2: #ad783f;
  --as-chat-gold-hover: #9c6731;
  --as-chat-gold-light: #fdf8f3;
  --as-chat-gold-border: rgba(201, 147, 90, 0.35);
  --as-chat-bg: #ffffff;
  --as-chat-text: #2d2a29;
  --as-chat-muted: #736b66;
  --as-chat-bubble-owner: #f5ece3;
  --as-chat-bubble-owner-text: #2c2520;
  --as-chat-radius: 20px;
  --as-chat-shadow: 0 16px 40px -6px rgba(45, 42, 41, 0.22), 0 0 0 1px rgba(201, 147, 90, 0.15);
}

/* Floating Launch Button */
.as-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.as-chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--as-chat-gold-1) 0%, var(--as-chat-gold-2) 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(173, 120, 63, 0.42);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  outline: none;
}

.as-chat-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(173, 120, 63, 0.52);
}

.as-chat-btn:active {
  transform: scale(0.96);
}

.as-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.as-chat-btn.open .as-icon-chat {
  display: none;
}
.as-chat-btn:not(.open) .as-icon-close {
  display: none;
}

/* Pulse Glow Effect */
.as-chat-pulse {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--as-chat-gold-1);
  animation: as-pulse-anim 2.4s infinite cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  opacity: 0;
}

@keyframes as-pulse-anim {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Unread Badge */
.as-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e11d48;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
}

/* Teaser Prompt Pill */
.as-chat-pill {
  background: #ffffff;
  color: var(--as-chat-text);
  padding: 9px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--as-chat-gold-border);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  animation: as-slide-pill 0.4s ease;
  white-space: nowrap;
}

.as-chat-pill:hover {
  background: var(--as-chat-gold-light);
}

.as-chat-pill-close {
  color: #999;
  font-size: 14px;
  padding: 0 2px;
  cursor: pointer;
}
.as-chat-pill-close:hover {
  color: #333;
}

@keyframes as-slide-pill {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========================================================
   MAIN CHAT WINDOW
======================================================== */
.as-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--as-chat-bg);
  border-radius: var(--as-chat-radius);
  box-shadow: var(--as-chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.as-chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.as-chat-header {
  background: linear-gradient(135deg, var(--as-chat-gold-1) 0%, var(--as-chat-gold-2) 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.as-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.as-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.as-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.as-chat-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.as-chat-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.as-chat-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.as-chat-header-actions button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.as-chat-header-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Chat Body */
.as-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #faf8f5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Welcome Card */
.as-chat-welcome {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(201, 147, 90, 0.2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  text-align: center;
  margin-bottom: 6px;
}

.as-chat-welcome-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.as-chat-welcome h4 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--as-chat-text);
}

.as-chat-welcome p {
  margin: 0;
  font-size: 12.5px;
  color: var(--as-chat-muted);
  line-height: 1.45;
}

/* First-time Customer Info Bar */
.as-chat-contact-bar {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--as-chat-gold-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.as-chat-contact-bar span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--as-chat-gold-2);
}

.as-chat-inputs {
  display: flex;
  gap: 8px;
}

.as-chat-inputs input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #e5e0dc;
  border-radius: 8px;
  outline: none;
  background: #fdfcfb;
}

.as-chat-inputs input:focus {
  border-color: var(--as-chat-gold-1);
}

/* Message Rows */
.as-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: as-msg-fade 0.2s ease-out;
}

.as-msg-row.customer {
  align-self: flex-end;
  align-items: flex-end;
}

.as-msg-row.owner {
  align-self: flex-start;
  align-items: flex-start;
}

.as-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.as-msg-row.customer .as-msg-bubble {
  background: linear-gradient(135deg, var(--as-chat-gold-1) 0%, var(--as-chat-gold-2) 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(173, 120, 63, 0.25);
}

.as-msg-row.owner .as-msg-bubble {
  background: #ffffff;
  color: var(--as-chat-text);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(201, 147, 90, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.as-msg-meta {
  font-size: 10.5px;
  color: #999;
  margin-top: 3px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

@keyframes as-msg-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quick Suggestion Chips */
.as-chat-chips {
  padding: 6px 14px 4px 14px;
  background: #ffffff;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid #f0ebe5;
  scrollbar-width: none;
}
.as-chat-chips::-webkit-scrollbar { display: none; }

.as-chat-chip {
  background: var(--as-chat-gold-light);
  border: 1px solid var(--as-chat-gold-border);
  color: var(--as-chat-gold-2);
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.as-chat-chip:hover {
  background: var(--as-chat-gold-1);
  color: #ffffff;
}

/* Chat Footer / Input */
.as-chat-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #f0ebe5;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.as-chat-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #e5dfd9;
  background: #fdfcfb;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.as-chat-input:focus {
  border-color: var(--as-chat-gold-1);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 147, 90, 0.15);
}

.as-chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--as-chat-gold-1) 0%, var(--as-chat-gold-2) 100%);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 3px 10px rgba(173, 120, 63, 0.35);
}

.as-chat-send-btn:hover {
  transform: scale(1.06);
  background: var(--as-chat-gold-hover);
}

.as-chat-send-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  margin-left: 2px;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .as-chat-launcher {
    bottom: 18px;
    right: 18px;
  }
  .as-chat-btn {
    width: 54px;
    height: 54px;
  }
  .as-chat-pill {
    display: none; /* Hide teaser on small mobile to save screen space */
  }
  .as-chat-window {
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-width: none;
    height: calc(100vh - 110px);
    border-radius: 18px;
  }
}
