/* Farzana Hair Salon Chatbot */
.fh-chat-root {
  --fh-chat-primary: #1c1714;
  --fh-chat-accent: #6e4a38;
  --fh-chat-champagne: #c9a87c;
  --fh-chat-bg: #f3eee8;
  --fh-chat-panel: #fffaf6;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
}

.fh-chat-launcher {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, var(--fh-chat-primary), var(--fh-chat-accent));
  color: #fffaf6;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 1.25rem 0.85rem 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(28, 23, 20, 0.28);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fh-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(28, 23, 20, 0.34);
}

.fh-chat-launcher.hidden {
  display: none;
}

.fh-chat-launcher-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 250, 246, 0.14);
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.fh-chat-panel {
  display: none;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 6rem));
  background: var(--fh-chat-panel);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(28, 23, 20, 0.28);
  border: 1px solid rgba(28, 23, 20, 0.08);
  flex-direction: column;
}

.fh-chat-panel.open {
  display: flex;
  animation: fh-chat-up 0.28s ease;
}

@keyframes fh-chat-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fh-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(135deg, var(--fh-chat-primary), var(--fh-chat-accent));
  color: #fffaf6;
}

.fh-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.fh-chat-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(201, 168, 124, 0.35);
  color: #fffaf6;
  display: grid;
  place-items: center;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  flex-shrink: 0;
}

.fh-chat-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.fh-chat-header p {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  opacity: 0.82;
}

.fh-chat-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 250, 246, 0.14);
  color: #fffaf6;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.fh-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(201, 168, 124, 0.16), transparent 60%),
    var(--fh-chat-bg);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.fh-msg {
  max-width: 85%;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.fh-msg-bot {
  align-self: flex-start;
  background: #fffaf6;
  color: #1c1714;
  border: 1px solid rgba(28, 23, 20, 0.08);
  border-bottom-left-radius: 0.3rem;
}

.fh-msg-user {
  align-self: flex-end;
  background: var(--fh-chat-primary);
  color: #fffaf6;
  border-bottom-right-radius: 0.3rem;
}

.fh-msg-system {
  align-self: center;
  max-width: 95%;
  background: rgba(110, 74, 56, 0.1);
  color: #3d342e;
  font-size: 0.85rem;
  text-align: center;
}

.fh-typing {
  align-self: flex-start;
  display: flex;
  gap: 0.3rem;
  padding: 0.75rem 0.9rem;
  background: #fffaf6;
  border-radius: 1rem;
  border: 1px solid rgba(28, 23, 20, 0.08);
}

.fh-typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--fh-chat-champagne);
  animation: fh-bounce 1s infinite ease-in-out;
}

.fh-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.fh-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fh-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.fh-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  background: var(--fh-chat-panel);
  border-top: 1px solid rgba(28, 23, 20, 0.08);
  max-height: 140px;
  overflow-y: auto;
}

.fh-chip {
  border: 1px solid rgba(28, 23, 20, 0.14);
  background: #fffaf6;
  color: #1c1714;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fh-chip:hover {
  border-color: var(--fh-chat-accent);
  background: rgba(110, 74, 56, 0.06);
}

.fh-chip-primary {
  background: var(--fh-chat-primary);
  border-color: var(--fh-chat-primary);
  color: #fffaf6;
}

.fh-chip-primary:hover {
  background: var(--fh-chat-accent);
  border-color: var(--fh-chat-accent);
  color: #fffaf6;
}

.fh-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--fh-chat-panel);
  border-top: 1px solid rgba(28, 23, 20, 0.08);
}

.fh-chat-input {
  flex: 1;
  border: 1px solid rgba(28, 23, 20, 0.14);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: #1c1714;
}

.fh-chat-input:focus {
  outline: 2px solid rgba(201, 168, 124, 0.55);
  border-color: transparent;
}

.fh-chat-send {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: var(--fh-chat-primary);
  color: #fffaf6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.fh-chat-send:hover {
  background: var(--fh-chat-accent);
}

@media (max-width: 480px) {
  .fh-chat-root {
    bottom: 0.85rem;
    right: 0.85rem;
  }

  .fh-chat-panel {
    width: calc(100vw - 1.7rem);
    height: min(70vh, 560px);
  }

  .fh-chat-launcher-text {
    display: none;
  }

  .fh-chat-launcher {
    padding: 0.85rem;
  }
}
