/* Fixed FAQ chat widget — ThinkarHouse green */

.faq-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 500;
  font-family: var(--th-font-family);
}

.faq-chat__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #00e5b0 0%, #00c896 55%, #009970 100%);
  color: #0b0c0e;
  cursor: pointer;
  box-shadow:
    0 8px 28px rgba(0, 200, 150, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    width 0.25s ease,
    border-radius 0.25s ease,
    padding 0.25s ease;
}

.faq-chat__toggle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 12px 36px rgba(0, 200, 150, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.faq-chat__toggle-icon {
  font-size: 26px;
  line-height: 1;
}

.faq-chat__toggle-label {
  display: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.faq-chat.is-open .faq-chat__toggle {
  width: auto;
  min-width: 58px;
  padding: 0 18px;
  border-radius: 999px;
}

.faq-chat.is-open .faq-chat__toggle .faq-chat__toggle-icon {
  font-size: 20px;
}

.faq-chat.is-open .faq-chat__toggle-label {
  display: inline;
  margin-left: 8px;
}

.faq-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(380px, calc(100vw - 48px));
  max-height: min(520px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #13151a;
  border: 1px solid rgba(0, 200, 150, 0.28);
  border-radius: 16px;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform-origin: bottom right;
  animation: faqChatIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-chat__panel[hidden] {
  display: none !important;
}

@keyframes faqChatIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.faq-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(135deg, #009970 0%, #00c896 100%);
  color: #0b0c0e;
}

.faq-chat__title {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.faq-chat__status {
  display: block;
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}

.faq-chat__close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(11, 12, 14, 0.15);
  color: #0b0c0e;
  cursor: pointer;
  transition: background 0.2s ease;
}

.faq-chat__close:hover {
  background: rgba(11, 12, 14, 0.28);
}

.faq-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.faq-chat__bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  animation: faqBubbleIn 0.25s ease;
}

@keyframes faqBubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-chat__bubble--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: #e8ecf0;
  border-bottom-left-radius: 4px;
}

.faq-chat__bubble--user {
  align-self: flex-end;
  background: rgba(0, 200, 150, 0.18);
  color: #f0f0f0;
  border: 1px solid rgba(0, 200, 150, 0.25);
  border-bottom-right-radius: 4px;
}

.faq-chat__bubble a {
  color: #00e5b0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.faq-chat__bubble a:hover {
  color: #fff;
}

.faq-chat__choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  width: 100%;
}

.faq-chat__choices--categories {
  gap: 6px;
}

.faq-chat__choice--category {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.faq-chat__choice--category .fa {
  width: 18px;
  text-align: center;
  color: #00e5b0;
  flex-shrink: 0;
}

.faq-chat__choice {
  display: block;
  width: 100%;
  padding: 11px 14px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: #e8ecf0;
  background: rgba(0, 200, 150, 0.08);
  border: 1px solid rgba(0, 200, 150, 0.22);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.faq-chat__choice:hover {
  background: rgba(0, 200, 150, 0.16);
  border-color: #00c896;
  transform: translateX(2px);
}

.faq-chat__link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #0b0c0e !important;
  text-decoration: none !important;
  background: #00c896;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.faq-chat__link-btn:hover {
  background: #00e5b0;
  color: #0b0c0e !important;
}

.faq-chat__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #0f1114;
}

.faq-chat__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #e8ecf0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.faq-chat__back:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 200, 150, 0.35);
}

.faq-chat__back[hidden] {
  display: none !important;
}

.faq-chat__contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #00c896 !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.faq-chat__contact-link:hover {
  color: #00e5b0 !important;
}

@media (max-width: 480px) {
  .faq-chat {
    right: 16px;
    bottom: 16px;
  }

  .faq-chat__panel {
    width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-chat__panel,
  .faq-chat__bubble {
    animation: none;
  }

  .faq-chat__toggle {
    transition: none;
  }
}
