/*
  chatbot.css — Genius Tax MTD Assistant Widget
  Floating chat bubble + window, fully mobile-responsive.
  Brand colour: #E5007D (pink)
*/

/* ── Chat Bubble ── */
#gtax-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e5007d;
  box-shadow: 0 4px 24px rgba(229,0,125,0.45);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: gtax-pulse 2.8s ease-in-out infinite;
  border: none;
  outline: none;
}
#gtax-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(229,0,125,0.65);
  animation: none;
}
#gtax-bubble svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  transition: transform 0.25s ease, opacity 0.2s;
}
#gtax-bubble .gtax-icon-close {
  position: absolute;
  font-size: 22px;
  color: #fff;
  font-weight: 300;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}
#gtax-bubble.open svg { opacity: 0; }
#gtax-bubble.open .gtax-icon-close { opacity: 1; }

@keyframes gtax-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(229,0,125,0.45); transform: scale(1); }
  50%       { box-shadow: 0 4px 40px rgba(229,0,125,0.72); transform: scale(1.05); }
}

/* ── Chat Window ── */
#gtax-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 375px;
  max-height: 570px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 56px rgba(0,0,0,0.18), 0 2px 12px rgba(0,0,0,0.08);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.82) translateY(24px);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.22s ease;
  font-family: 'Montserrat', Arial, sans-serif;
}
#gtax-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.gtax-hdr {
  background: linear-gradient(135deg, #e5007d 0%, #c2006a 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.gtax-hdr-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.gtax-hdr-info { flex: 1; min-width: 0; }
.gtax-hdr-name {
  font-size: 0.87rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.gtax-hdr-status {
  font-size: 0.67rem;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.gtax-hdr-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
}
.gtax-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
}
.gtax-close-btn:hover { background: rgba(255,255,255,0.28); }

/* Message area */
.gtax-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #f8f8f8;
  scroll-behavior: smooth;
}
.gtax-msgs::-webkit-scrollbar { width: 3px; }
.gtax-msgs::-webkit-scrollbar-track { background: transparent; }
.gtax-msgs::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.gtax-msg {
  max-width: 90%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.81rem;
  line-height: 1.62;
  font-weight: 500;
  color: #111111;
  animation: gtax-msg-pop 0.22s ease;
  word-wrap: break-word;
}
@keyframes gtax-msg-pop {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gtax-msg.bot {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}
.gtax-msg.user {
  background: #e5007d;
  color: #ffffff;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
  border: none;
}
.gtax-msg b, .gtax-msg strong { font-weight: 800; }
.gtax-msg em { font-style: italic; color: #666; }

/* CTA button inside messages */
.gtax-cta {
  display: inline-block;
  margin-top: 10px;
  background: #e5007d;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: background 0.18s;
  letter-spacing: 0.2px;
}
.gtax-cta:hover { background: #c2006a; }

/* Quick replies */
.gtax-qr-wrap {
  padding: 9px 12px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f8f8f8;
  border-top: 1px solid #ececec;
  flex-shrink: 0;
}
.gtax-qr-btn {
  background: #ffffff;
  border: 1.5px solid #e5007d;
  color: #e5007d;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  font-family: 'Montserrat', Arial, sans-serif;
  letter-spacing: 0.1px;
  white-space: nowrap;
}
.gtax-qr-btn:hover { background: #e5007d; color: #fff; }
.gtax-qr-btn:active { transform: scale(0.96); }

/* Contact form (inside chat) */
.gtax-cf {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8f8f8;
  border-top: 1px solid #ececec;
  flex-shrink: 0;
}
/* Override page-level input styles for the chatbot form */
.gtax-cf input[type="text"],
.gtax-cf input[type="email"],
.gtax-cf textarea {
  width: 100% !important;
  padding: 9px 11px !important;
  background: #ffffff !important;
  border: 1.5px solid #e0e0e0 !important;
  border-radius: 8px !important;
  font-size: 0.79rem !important;
  font-family: 'Montserrat', Arial, sans-serif !important;
  color: #111111 !important;
  transition: border-color 0.2s !important;
  outline: none !important;
  resize: none !important;
  box-sizing: border-box !important;
  appearance: none !important;
}
.gtax-cf input[type="text"]:focus,
.gtax-cf input[type="email"]:focus,
.gtax-cf textarea:focus {
  border-color: #e5007d !important;
}
.gtax-cf input[type="text"]::placeholder,
.gtax-cf input[type="email"]::placeholder,
.gtax-cf textarea::placeholder { color: #aaa !important; }
.gtax-cf textarea { height: 68px; }
.gtax-cf-submit {
  background: #e5007d;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 100px;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Montserrat', Arial, sans-serif;
  transition: background 0.18s;
  letter-spacing: 0.3px;
}
.gtax-cf-submit:hover { background: #c2006a; }
.gtax-cf-submit:disabled { background: #ccc; cursor: not-allowed; }
.gtax-cf-cancel {
  background: transparent;
  border: none;
  color: #999;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  padding: 2px 0;
  transition: color 0.2s;
}
.gtax-cf-cancel:hover { color: #e5007d; }

/* ── Mobile Responsive ── */
@media (max-width: 430px) {
  #gtax-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-height: 82vh;
    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
  }
  #gtax-bubble {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}

/* ── Free-text input row ────────────────────── */
.gtax-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  border-radius: 0 0 1rem 1rem;
}

#gtax-user-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1px solid #ddd;
  border-radius: 1.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #f9f9f9;
  color: #333;
}

#gtax-user-input:focus {
  border-color: #E5007D;
  background: #fff;
}

#gtax-user-input::placeholder {
  color: #999;
}

.gtax-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E5007D;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  padding: 7px;
  color: #fff;
}

.gtax-send-btn:hover {
  background: #c70069;
}

.gtax-send-btn svg {
  width: 18px;
  height: 18px;
}

/* Typing indicator */
.gtax-typing {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border-radius: 1rem;
  color: #999;
  font-style: italic;
  font-size: 0.82rem;
}

@media (max-width: 430px) {
  .gtax-input-row {
    padding: 0.5rem;
  }
  #gtax-user-input {
    font-size: 16px; /* Prevents iOS zoom */
  }
}
