/* FAQ Chatbot Library - modern, lightweight styles */
:root {
  --faqc-primary: #6d5dfc;
  --faqc-surface: #ffffff;
  --faqc-surface-muted: #f7f8ff;
  --faqc-text: #0f172a;
  --faqc-text-muted: #64748b;
  --faqc-border: rgba(148, 163, 184, 0.25);
  --faqc-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.faqc-widget {
  position: fixed;
  z-index: 9999;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--faqc-text);
  pointer-events: none;
}

.faqc-position-bottom-right {
  bottom: 24px;
  right: 24px;
}

.faqc-position-bottom-left {
  bottom: 24px;
  left: 24px;
}

.faqc-launcher {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  position: fixed;
  bottom: 24px;
  background: linear-gradient(135deg, var(--faqc-primary), #8b5cf6);
  box-shadow: 0 12px 30px rgba(109, 93, 252, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.faqc-position-bottom-right .faqc-launcher {
  right: 24px;
  left: auto;
}

.faqc-position-bottom-left .faqc-launcher {
  left: 24px;
  right: auto;
}

.faqc-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(109, 93, 252, 0.45);
}

.faqc-launcher:focus-visible {
  outline: 3px solid rgba(109, 93, 252, 0.4);
  outline-offset: 3px;
}

.faqc-launcher-icon {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  position: relative;
}

.faqc-launcher-icon::before,
.faqc-launcher-icon::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 999px;
}

.faqc-launcher-icon::before {
  width: 24px;
  height: 18px;
  left: 2px;
  top: 5px;
}

.faqc-launcher-icon::after {
  width: 10px;
  height: 10px;
  left: 7px;
  bottom: 2px;
  transform: rotate(45deg);
}

.faqc-launcher-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 24px;
  border: 1px solid rgba(109, 93, 252, 0.35);
  opacity: 0.75;
  animation: faqc-pulse 2.4s ease-out infinite;
}

.faqc-launcher-hidden {
  opacity: 0;
  pointer-events: none;
}

.faqc-panel {
  pointer-events: auto;
  width: 360px;
  height: 520px;
  max-height: calc(100vh - 120px);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  border: 1px solid var(--faqc-border);
  box-shadow: var(--faqc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.faqc-panel-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.faqc-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(
    135deg,
    rgba(109, 93, 252, 0.12),
    rgba(139, 92, 246, 0.08)
  );
  border-bottom: 1px solid var(--faqc-border);
}

.faqc-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.faqc-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--faqc-primary), #8b5cf6);
  box-shadow: 0 12px 24px rgba(109, 93, 252, 0.25);
  position: relative;
  display: grid;
  place-items: center;
}

.faqc-badge::after {
  content: "";
  position: absolute;
  inset: 12px 14px 14px 12px;
  border-radius: 6px;
  background: #ffffff;
  opacity: 0.9;
}

.faqc-badge-icon {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: contain;
  z-index: 1;
  display: none;
}

.faqc-badge-icon-visible {
  display: block;
}

.faqc-badge:has(.faqc-badge-icon-visible) {
  background: transparent;
  box-shadow: none;
}

.faqc-badge:has(.faqc-badge-icon-visible)::after {
  display: none;
}

.faqc-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.faqc-subtitle {
  font-size: 0.75rem;
  color: var(--faqc-text-muted);
}

.faqc-header-actions {
  display: flex;
  gap: 8px;
}

.faqc-clear,
.faqc-close {
  border: none;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--faqc-text);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faqc-clear:hover,
.faqc-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(148, 163, 184, 0.3);
}

.faqc-messages {
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  background: var(--faqc-surface);
}

.faqc-suggestions {
  padding: 0 18px 8px;
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--faqc-surface);
  border-bottom: 1px solid var(--faqc-border);
}

.faqc-suggestions-visible {
  display: block;
}

.faqc-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--faqc-text-muted);
  margin-bottom: 10px;
  padding-top: 2px;
}

.faqc-suggestions-toggle {
  border: none;
  background: rgba(109, 93, 252, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faqc-suggestions-toggle:hover {
  background: rgba(109, 93, 252, 0.15);
}

.faqc-toggle-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--faqc-primary);
  border-bottom: 2px solid var(--faqc-primary);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
}

.faqc-suggestions-collapsed .faqc-toggle-icon {
  transform: rotate(-135deg);
}

.faqc-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.faqc-suggestions-list::-webkit-scrollbar {
  width: 4px;
}

.faqc-suggestions-list::-webkit-scrollbar-track {
  background: transparent;
}

.faqc-suggestions-list::-webkit-scrollbar-thumb {
  background: rgba(109, 93, 252, 0.2);
  border-radius: 999px;
}

.faqc-suggestions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(109, 93, 252, 0.4);
}

.faqc-suggestions-collapsed .faqc-suggestions-list {
  display: none;
}

.faqc-suggestion {
  border: 1px solid rgba(109, 93, 252, 0.2);
  background: rgba(109, 93, 252, 0.06);
  color: var(--faqc-primary);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.faqc-suggestion:hover {
  transform: translateY(-1px);
  background: rgba(109, 93, 252, 0.12);
  border-color: rgba(109, 93, 252, 0.4);
  box-shadow: 0 4px 12px rgba(109, 93, 252, 0.2);
}

.faqc-suggestion:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.faqc-message {
  display: flex;
}

.faqc-message.faqc-user {
  justify-content: flex-end;
}

.faqc-message.faqc-bot {
  justify-content: flex-start;
}

.faqc-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-line;
  animation: faqc-fade-in 0.25s ease;
}

.faqc-user .faqc-bubble {
  background: linear-gradient(135deg, var(--faqc-primary), #8b5cf6);
  color: #ffffff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 8px 18px rgba(109, 93, 252, 0.24);
}

.faqc-bot .faqc-bubble {
  background: var(--faqc-surface-muted);
  color: var(--faqc-text);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom-left-radius: 6px;
}

.faqc-support-link {
  color: var(--faqc-primary);
  font-weight: 600;
  text-decoration: none;
}

.faqc-support-link:hover {
  text-decoration: underline;
}

.faqc-typing {
  padding: 0 18px 12px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.faqc-typing-visible {
  opacity: 1;
}

.faqc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faqc-primary);
  animation: faqc-typing 1.2s infinite ease-in-out;
}

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

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

.faqc-input {
  padding: 12px 16px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--faqc-border);
  background: #ffffff;
}

.faqc-text-input {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.86rem;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.faqc-text-input:focus {
  border-color: rgba(109, 93, 252, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.15);
}

.faqc-send {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--faqc-primary), #8b5cf6);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(109, 93, 252, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faqc-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(109, 93, 252, 0.3);
}

.faqc-send:disabled,
.faqc-text-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.faqc-reset {
  padding: 12px 16px 18px;
  display: none;
  background: #ffffff;
  border-top: 1px solid var(--faqc-border);
}

.faqc-reset-visible {
  display: block;
}

.faqc-reset-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(109, 93, 252, 0.1);
  color: var(--faqc-primary);
  font-weight: 600;
  cursor: pointer;
}

@keyframes faqc-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes faqc-typing {
  0%,
  80%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.5);
    opacity: 1;
  }
}

@keyframes faqc-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .faqc-panel {
    width: min(92vw, 420px);
    height: 70vh;
  }

  .faqc-position-bottom-right,
  .faqc-position-bottom-left {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }

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