/* ==========================================================================
   ShradhaSetu - Interactive WhatsApp Chat Bot Widget Styles
   ========================================================================== */

/* --- Floating Button Container --- */
.ws-bot-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 1040;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating WhatsApp Trigger Button */
.ws-bot-trigger {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 6px 20px rgba(18, 140, 126, 0.45);
  cursor: pointer;
  border: 2px solid #ffffff;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}

.ws-bot-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 25px rgba(18, 140, 126, 0.6);
  color: #ffffff;
}

/* Pulse animation ring around the button */
.ws-bot-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid #25d366;
  border-radius: 50%;
  animation: ws-pulse-ring 2.4s infinite cubic-bezier(0.4, 0, 0.6, 1);
  pointer-events: none;
}

@keyframes ws-pulse-ring {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Online Badge on Trigger Button */
.ws-online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #25d366;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

/* Speech Prompt Preview Pill (Visible before opening) */
.ws-preview-bubble {
  position: absolute;
  right: 72px;
  bottom: 10px;
  background: #ffffff;
  color: #333333;
  padding: 9px 15px;
  border-radius: 20px 20px 4px 20px;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15);
  border: 1px solid #ebd9b0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  animation: wsFadeSlide 0.5s ease-out;
  transition: all 0.25s ease;
}

.ws-preview-bubble:hover {
  background: #fff8e7;
  border-color: #d4af37;
  transform: translateX(-3px);
}

.ws-preview-bubble .ws-preview-close {
  color: #999999;
  font-size: 13px;
  padding-left: 4px;
  cursor: pointer;
  transition: color 0.2s;
}

.ws-preview-bubble .ws-preview-close:hover {
  color: #6a1b1b;
}

@keyframes wsFadeSlide {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Chat Widget Modal Window --- */
.ws-chat-window {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 30px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85) translateY(20px);
  z-index: 1050;
}

.ws-chat-window.ws-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Chat Header */
.ws-chat-header {
  background: linear-gradient(135deg, #6a1b1b 0%, #440e0e 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #d4af37;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.ws-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-avatar-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d4af37;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ws-avatar-icon {
  color: #6a1b1b;
  font-size: 20px;
}

.ws-header-online-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  background-color: #25d366;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.ws-header-info {
  display: flex;
  flex-direction: column;
}

.ws-header-title {
  font-family: 'Cinzel', serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  line-height: 1.2;
}

.ws-verified-badge {
  color: #25d366;
  font-size: 13px;
}

.ws-header-status {
  font-size: 0.72rem;
  color: #fff8e7;
  opacity: 0.88;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-header-status-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #25d366;
  border-radius: 50%;
}

.ws-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-header-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.ws-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fae084;
}

/* Chat Body (WhatsApp Theme with Subtle Wallpaper) */
.ws-chat-body {
  flex: 1;
  padding: 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f7f4ed;
  background-image: radial-gradient(#d4af37 0.75px, transparent 0.75px), radial-gradient(#6a1b1b 0.75px, #f7f4ed 0.75px);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  background-opacity: 0.05;
  scroll-behavior: smooth;
}

/* Custom Scrollbar for Chat Body */
.ws-chat-body::-webkit-scrollbar {
  width: 5px;
}
.ws-chat-body::-webkit-scrollbar-thumb {
  background: #d4af37;
  border-radius: 10px;
}

/* Time Pill */
.ws-chat-timestamp {
  text-align: center;
  margin: 4px 0 8px;
}

.ws-chat-timestamp span {
  background: rgba(0, 0, 0, 0.06);
  color: #666666;
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.4px;
}

/* Messages */
.ws-message {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: wsMessageIn 0.3s ease-out;
}

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

.ws-bot-message {
  align-self: flex-start;
}

.ws-user-message {
  align-self: flex-end;
}

.ws-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.ws-bot-message .ws-bubble {
  background: #ffffff;
  color: #2c2c2c;
  border: 1px solid #ebd9b0;
  border-top-left-radius: 3px;
}

.ws-user-message .ws-bubble {
  background: #dcf8c6;
  color: #111111;
  border: 1px solid #c2e7a7;
  border-top-right-radius: 3px;
}

.ws-msg-time {
  font-size: 0.65rem;
  color: #888888;
  text-align: right;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.ws-user-message .ws-msg-time {
  color: #558b2f;
}

/* Quick Action Options List */
.ws-quick-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
  width: 100%;
}

.ws-quick-btn {
  background: #ffffff;
  border: 1.5px solid #ebd9b0;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6a1b1b;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ws-quick-btn:hover {
  background: #fff8e7;
  border-color: #d4af37;
  color: #440e0e;
  transform: translateX(3px);
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.25);
}

.ws-quick-btn i.fa-chevron-right {
  font-size: 0.75rem;
  color: #d4af37;
  transition: transform 0.2s;
}

.ws-quick-btn:hover i.fa-chevron-right {
  transform: translateX(2px);
  color: #6a1b1b;
}

/* WhatsApp Action Link Buttons inside Chat */
.ws-cta-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.ws-whatsapp-link-btn {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
  transition: all 0.2s ease;
}

.ws-whatsapp-link-btn:hover {
  background: linear-gradient(135deg, #1ebe5d 0%, #0d6e63 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 211, 102, 0.5);
  color: #ffffff !important;
}

.ws-internal-link-btn {
  background: #ffffff;
  color: #6a1b1b !important;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1px solid #ebd9b0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.ws-internal-link-btn:hover {
  background: #fff8e7;
  border-color: #d4af37;
  color: #440e0e !important;
}

.ws-reset-menu-btn {
  background: none;
  border: none;
  color: #888888;
  font-size: 0.74rem;
  text-decoration: underline;
  padding: 4px;
  margin-top: 2px;
  cursor: pointer;
  text-align: center;
  display: block;
}

.ws-reset-menu-btn:hover {
  color: #6a1b1b;
}

/* Typing Indicator */
.ws-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #ebd9b0;
  border-radius: 14px;
  border-top-left-radius: 3px;
  width: fit-content;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.ws-typing-dot {
  width: 6px;
  height: 6px;
  background-color: #888888;
  border-radius: 50%;
  animation: wsDotPulse 1.4s infinite ease-in-out;
}

.ws-typing-dot:nth-child(1) { animation-delay: 0s; }
.ws-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ws-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes wsDotPulse {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Chat Footer / Input Form */
.ws-chat-footer {
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid #eedec0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-input-wrapper {
  flex: 1;
  position: relative;
}

.ws-chat-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ebd9b0;
  border-radius: 24px;
  font-size: 0.85rem;
  font-family: inherit;
  color: #333333;
  outline: none;
  background: #faf8f5;
  transition: all 0.2s ease;
}

.ws-chat-input:focus {
  background: #ffffff;
  border-color: #25d366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.ws-chat-input::placeholder {
  color: #999999;
  font-size: 0.82rem;
}

.ws-send-btn {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 3px 10px rgba(18, 140, 126, 0.3);
}

.ws-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 5px 14px rgba(18, 140, 126, 0.45);
}

.ws-send-btn:active {
  transform: scale(0.95);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .ws-bot-container {
    bottom: 18px;
    right: 18px;
  }
  .ws-bot-trigger {
    width: 54px;
    height: 54px;
    font-size: 26px;
  }
  .ws-chat-window {
    bottom: 68px;
    right: 0;
    width: calc(100vw - 36px);
    height: 480px;
    max-height: calc(100vh - 100px);
    border-radius: 16px;
  }
  .ws-preview-bubble {
    display: none !important;
  }
}
