/* ===== THC POPUP WIDGET STYLES ===== */
.thc-popup-wrap,
.thc-popup-wrap *,
.thc-popup-wrap *::before,
.thc-popup-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Circle Icon (minimized state) ---- */
.thc-circle-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #d604b2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  animation: thc-pulse 3s ease-in-out infinite;
  border: none;
  outline: none;
  transition: transform 0.2s ease;
}
.thc-circle-icon:hover {
  transform: scale(1.08);
}
.thc-circle-icon svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}
@keyframes thc-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ---- Popup Container ---- */
.thc-popup-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  z-index: 999999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.thc-popup-wrap.thc-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Header Bar ---- */
.thc-header {
  background: #d604b2;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}
.thc-header-info {
  display: flex;
  flex-direction: column;
}
.thc-header-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.thc-header-subtitle {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  line-height: 1.3;
}
.thc-header-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}
.thc-header-close:hover {
  background: rgba(255,255,255,0.15);
}

/* ---- Video Section ---- */
.thc-video-section {
  position: relative;
  background: #000;
}
.thc-video-section video {
  display: block;
  width: 100%;
  height: auto;
}
.thc-video-controls {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
}
.thc-video-btn {
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.thc-video-btn:hover {
  background: rgba(0,0,0,0.7);
}
.thc-video-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* Mute button — centered on video */
.thc-mute-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: rgba(0,0,0,0.55);
  z-index: 2;
}
.thc-mute-btn svg {
  width: 24px;
  height: 24px;
}
.thc-mute-btn:hover {
  background: rgba(0,0,0,0.75);
}

/* Watch Video button in header */
.thc-header-video-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
  display: none;
}
.thc-header-video-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}
.thc-header-video-btn svg {
  width: 12px;
  height: 12px;
  fill: #fff;
  vertical-align: -1px;
  margin-right: 4px;
}

/* ---- CTA Buttons ---- */
.thc-cta-wrap {
  background: #fff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, padding 0.3s ease;
  padding-top: 0;
  padding-bottom: 0;
}
.thc-cta-wrap.thc-cta-visible {
  opacity: 1;
  max-height: 120px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.thc-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  line-height: 1.2;
}
.thc-btn-primary {
  background: #d604b2;
  color: #fff;
  border-color: #d604b2;
}
.thc-btn-primary:hover {
  background: #9f0385;
  border-color: #9f0385;
}
.thc-btn-secondary {
  background: #fff;
  color: #333;
  border-color: #d604b2;
}
.thc-btn-secondary:hover {
  background: #FFF0F0;
}

/* ---- Chat Section ---- */
.thc-chat-section {
  display: none;
  flex-direction: column;
  background: #fff;
  height: 420px;
}
.thc-chat-section.thc-chat-active {
  display: flex;
}
.thc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thc-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.thc-chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* Chat Bubbles */
.thc-msg {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  animation: thc-msg-in 0.2s ease-out;
  word-wrap: break-word;
}
.thc-msg-bot {
  align-self: flex-start;
  background: #F0F0F0;
  color: #333;
  border-radius: 18px 18px 18px 4px;
}
.thc-msg-user {
  align-self: flex-end;
  background: #007AFF;
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}
@keyframes thc-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing Indicator */
.thc-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #F0F0F0;
  border-radius: 18px 18px 18px 4px;
}
.thc-typing-dot {
  width: 7px;
  height: 7px;
  background: #999;
  border-radius: 50%;
  animation: thc-bounce 1.2s ease-in-out infinite;
}
.thc-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.thc-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes thc-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Quick Reply Buttons */
.thc-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}
.thc-quick-btn {
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid #d604b2;
  background: #fff;
  color: #d604b2;
  transition: background 0.2s, color 0.2s;
  line-height: 1.2;
}
.thc-quick-btn:hover {
  background: #9f0385;
  color: #fff;
}

/* Chat Input Area */
.thc-chat-input-wrap {
  display: flex;
  align-items: center;
  border-top: 1px solid #E5E5E5;
  padding: 10px 12px;
  gap: 8px;
  background: #fff;
  border-radius: 0 0 12px 12px;
}
.thc-chat-input {
  flex: 1;
  border: 1px solid #DDD;
  border-radius: 25px;
  padding: 10px 16px;
  font-size: 16px;
  outline: none;
  color: #333;
  transition: border-color 0.2s;
  background: #FAFAFA;
}
.thc-chat-input:focus {
  border-color: #d604b2;
}
.thc-chat-input::placeholder {
  color: #999;
}
.thc-chat-input:disabled {
  background: #F0F0F0;
  cursor: not-allowed;
}
/* Textarea for question step */
.thc-chat-textarea {
  resize: none;
  overflow-y: auto;
  min-height: 60px;
  max-height: 60px;
  flex: 1 1 0%;
}

.thc-chat-send {
  background: #d604b2;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.thc-chat-send:hover {
  background: #9f0385;
}
.thc-chat-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.thc-chat-send svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}
.thc-chat-send.thc-chat-send-text {
  width: auto;
  border-radius: 25px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.thc-chat-error {
  font-size: 11px;
  color: #d604b2;
  padding: 0 16px 6px;
  display: none;
}

/* Honeypot (hidden) */
.thc-hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---- Mobile Bottom Bar ---- */
.thc-mobile-bar {
  display: none;
}

/* ---- Mobile Backdrop ---- */
.thc-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999998;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
  .thc-popup-wrap {
    width: 88%;
    max-width: 400px;
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%) translateY(20px);
  }
  .thc-popup-wrap.thc-visible {
    transform: translate(-50%, -50%) translateY(0);
  }
  .thc-backdrop.thc-backdrop-visible {
    display: block;
  }
  .thc-chat-section {
    height: 380px;
  }

  /* Mobile Bottom Bar */
  .thc-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999997;
    height: 54px;
  }
  .thc-mobile-bar.thc-mobile-bar-hidden {
    display: none !important;
  }
  .thc-mobile-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1A1A1A;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    letter-spacing: 0.5px;
    transition: background 0.2s;
  }
  .thc-mobile-bar-btn:first-child {
    border-right: 1px solid #333;
  }
  .thc-mobile-bar-btn:hover,
  .thc-mobile-bar-btn:active {
    background: #333;
  }
  .thc-mobile-bar-btn svg {
    width: 18px;
    height: 18px;
    fill: #d604b2;
  }

  /* Hide circle icon on mobile */
  .thc-circle-icon {
    display: none !important;
  }
}
