/* ============================================================
   WALLAN PHYSIOTHERAPY CENTRE — Triage & Booking Chatbot Styles
   Theme: Navy (#16345F), Brand Blue (#00AEE6, text/fill variant #006B8F), Muted Red Accent (#C0303A)
   ============================================================ */

.wp-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #16345F;
  -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button */
.wp-chat-launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #16345F;
  color: #FFFFFF;
  border: 2px solid #00AEE6;
  border-radius: 36px;
  padding: 10px 18px 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(22, 52, 95, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.wp-chat-launcher:hover {
  background: #0E2547;
  border-color: #C0303A;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(22, 52, 95, 0.45);
}

.wp-chat-launcher:active {
  transform: translateY(0);
}

.wp-launcher-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #006B8F;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s ease;
}

.wp-chat-launcher:hover .wp-launcher-icon {
  background: #C0303A;
}

.wp-launcher-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.wp-launcher-pulse {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  background: #00AEE6;
  border: 2px solid #16345F;
  border-radius: 50%;
  animation: wp-pulse 2.4s infinite;
}

@keyframes wp-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 174, 230, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(0, 174, 230, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 174, 230, 0); }
}

.wp-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.wp-launcher-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: #FFFFFF;
}

.wp-launcher-sub {
  font-size: 0.74rem;
  color: #D8E6F8;
  line-height: 1.25;
}

/* Chat Window Box */
.wp-chat-box {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 395px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 110px);
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(14, 37, 71, 0.26), 0 0 0 1px rgba(22, 52, 95, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.wp-chat-box.wp-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.wp-chat-header {
  background: #16345F;
  color: #FFFFFF;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #00AEE6;
  position: relative;
}

.wp-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wp-header-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #006B8F 0%, #16345F 100%);
  border: 2px solid #C0303A;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wp-header-titles h4 {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  line-height: 1.15;
}

.wp-header-status {
  font-size: 0.72rem;
  color: #D8E6F8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.wp-status-dot {
  width: 7px;
  height: 7px;
  background: #00AEE6;
  border-radius: 50%;
  display: inline-block;
}

.wp-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wp-btn-icon {
  background: transparent;
  border: none;
  color: #D8E6F8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.wp-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

/* Chat Body */
.wp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #F8FAFD;
  scroll-behavior: smooth;
}

/* Messages */
.wp-msg {
  display: flex;
  max-width: 88%;
  font-size: 0.88rem;
  line-height: 1.45;
  animation: wpFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.wp-msg.wp-bot {
  align-self: flex-start;
}

.wp-msg.wp-user {
  align-self: flex-end;
}

.wp-msg-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  word-break: break-word;
}

.wp-msg.wp-bot .wp-msg-bubble {
  background: #FFFFFF;
  color: #16345F;
  border: 1px solid rgba(22, 52, 95, 0.1);
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 6px rgba(22, 52, 95, 0.05);
}

.wp-msg.wp-user .wp-msg-bubble {
  background: #006B8F;
  color: #FFFFFF;
  border-bottom-right-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 174, 230, 0.25);
  font-weight: 500;
}

/* Options / Quick Buttons */
.wp-options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}

.wp-option-btn {
  background: #FFFFFF;
  border: 1px solid rgba(22, 52, 95, 0.16);
  border-radius: 10px;
  padding: 11px 14px;
  color: #16345F;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  transition: all 0.18s ease;
  box-shadow: 0 2px 4px rgba(22, 52, 95, 0.04);
}

.wp-option-btn:hover {
  background: #F0FAFD;
  border-color: #00AEE6;
  color: #006B8F;
  transform: translateX(3px);
  box-shadow: 0 4px 10px rgba(0, 174, 230, 0.15);
}

.wp-option-btn span {
  color: #006B8F;
  font-weight: 700;
  transition: transform 0.18s ease;
}

.wp-option-btn:hover span {
  transform: translateX(3px);
}

.wp-option-btn.wp-urgent {
  border-color: rgba(192, 48, 58, 0.4);
  background: #FFF8F8;
  color: #96222A;
}

.wp-option-btn.wp-urgent:hover {
  background: #FDE8E9;
  border-color: #C0303A;
  color: #C0303A;
}

.wp-option-btn.wp-urgent span {
  color: #C0303A;
}

/* Online Booking / Splose Highlight Card */
.wp-splose-card {
  background: #FFFFFF;
  border: 2px solid #00AEE6;
  border-radius: 12px;
  padding: 16px;
  margin-top: 6px;
  box-shadow: 0 6px 16px rgba(0, 174, 230, 0.12);
  text-align: center;
}

.wp-splose-card h5 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #16345F;
  margin: 0 0 6px 0;
}

.wp-splose-card p {
  font-size: 0.8rem;
  color: #4C5B75;
  margin: 0 0 12px 0;
  line-height: 1.35;
}

.wp-splose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #006B8F;
  color: #FFFFFF !important;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 174, 230, 0.25);
}

.wp-splose-btn:hover {
  background: #005470;
  transform: translateY(-1px);
}

/* Call Alert Card */
.wp-call-card {
  background: #FFF9F9;
  border: 1px solid rgba(192, 48, 58, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  text-align: center;
}

.wp-call-card h5 {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #96222A;
}

.wp-call-card p {
  margin: 0 0 10px 0;
  font-size: 0.78rem;
  color: #4C5B75;
}

.wp-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #C0303A;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.18s ease;
  width: 100%;
}

.wp-call-btn:hover {
  background: #96222A;
}

/* Contact / Triage Form Card */
.wp-form-card {
  background: #FFFFFF;
  border: 1px solid rgba(22, 52, 95, 0.14);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(22, 52, 95, 0.08);
  width: 100%;
}

.wp-input-field {
  margin-bottom: 11px;
}

.wp-input-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #16345F;
  margin-bottom: 4px;
}

.wp-input-field input,
.wp-input-field select,
.wp-input-field textarea {
  width: 100%;
  border: 1px solid rgba(22, 52, 95, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #16345F;
  background: #FDFEFE;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-input-field input:focus,
.wp-input-field select:focus,
.wp-input-field textarea:focus {
  outline: none;
  border-color: #00AEE6;
  box-shadow: 0 0 0 3px rgba(0, 174, 230, 0.14);
}

.wp-submit-btn {
  width: 100%;
  background: #006B8F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 174, 230, 0.25);
  margin-top: 4px;
}

.wp-submit-btn:hover {
  background: #005470;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 174, 230, 0.35);
}

.wp-submit-btn:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Footer */
.wp-chat-footer {
  background: #FFFFFF;
  border-top: 1px solid rgba(22, 52, 95, 0.1);
  padding: 10px 14px;
  text-align: center;
  font-size: 0.74rem;
  color: #4C5B75;
}

.wp-chat-footer a {
  color: #006B8F;
  font-weight: 700;
  text-decoration: underline;
}

.wp-chat-footer a:hover {
  color: #C0303A;
}

/* Success Card */
.wp-success-card {
  background: #F0FAFD;
  border: 1px solid #00AEE6;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: #16345F;
  margin: 6px 0;
}

.wp-success-card h5 {
  margin: 0 0 4px 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #006B8F;
}

.wp-success-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .wp-chat-widget {
    bottom: 16px;
    right: 16px;
  }

  .wp-chat-launcher {
    padding: 10px 14px 10px 10px;
  }

  .wp-launcher-text {
    display: none; /* Icon-only floating button on small screens */
  }

  .wp-launcher-icon {
    width: 44px;
    height: 44px;
  }

  .wp-chat-box {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Clear the sticky mobile "Book Online / Call Now" bar (.mob-book, site.css)
   which is fixed to the bottom of the viewport at this same breakpoint. */
@media (max-width: 760px) {
  .wp-chat-widget {
    bottom: 90px;
  }
}

@media (max-width: 760px) and (min-width: 481px) {
  .wp-chat-box {
    bottom: 152px;
  }
}

/* Respect reduced-motion preference: keep the widget usable, drop the movement */
@media (prefers-reduced-motion: reduce) {
  .wp-chat-widget * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .wp-launcher-pulse { animation: none; }
  .wp-chat-launcher:hover,
  .wp-option-btn:hover,
  .wp-submit-btn:hover,
  .wp-splose-btn:hover,
  .wp-call-btn:hover {
    transform: none;
  }
  .wp-chat-box,
  .wp-chat-box.wp-open {
    transform: none;
  }
}
