/* chat-widget.css — FAB + Mini-Chat Panel + Profile Popup */

/* ===== FLOATING ACTION BUTTON (FAB) ===== */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 999;
  transition: transform 0.3s ease;
}

.chat-fab:hover {
  transform: scale(1.08);
}

.chat-fab.hidden {
  display: none !important;
}

.chat-fab__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #0B3B24;
  box-shadow: 0 4px 20px rgba(11, 59, 36, 0.3);
}

.chat-fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: badgeBounce 2s ease-in-out infinite;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.chat-fab__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #0B3B24;
  animation: fabPulse 2s ease-in-out infinite;
}

@keyframes fabPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 0; transform: scale(1.3); }
}

/* ===== MINI-CHAT PANEL ===== */
.mini-chat-container {
  position: fixed;
  bottom: 100px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 420px;
  transform-origin: bottom right;
  animation: chatPanelIn 0.3s ease-out;
}

.mini-chat-container.hidden {
  display: none !important;
}

@keyframes chatPanelIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* -- Chat Header -- */
.mini-chat-container .chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0B3B24, #1a6b3c);
  flex-shrink: 0;
}

.mini-chat-container .chat-avatar {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-chat-container .chat-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.mini-chat-container .online-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #25d366;
  border-radius: 50%;
  border: 2px solid #0B3B24;
}

.mini-chat-container .chat-info {
  flex: 1;
  cursor: pointer;
}

.mini-chat-container .chat-info h3 {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
}

.mini-chat-container .chat-info p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  margin: 1px 0 0;
}

.mini-chat-container .chat-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mini-chat-container .chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* -- Chat Messages Area -- */
.mini-chat-container .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f0f2f5;
  min-height: 140px;
  max-height: 240px;
}

/* -- Chat Message Bubbles -- */
.mini-chat-container .chat-msg {
  display: flex;
  max-width: 85%;
}

.mini-chat-container .chat-msg.dr {
  align-self: flex-start;
}

.mini-chat-container .chat-msg.user {
  align-self: flex-end;
}

.mini-chat-container .chat-msg .bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.45;
  word-break: break-word;
}

.mini-chat-container .chat-msg.dr .bubble {
  background: #ffffff;
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.mini-chat-container .chat-msg.user .bubble {
  background: #dcf8c6;
  color: #1f2937;
  border-bottom-right-radius: 4px;
}

.mini-chat-container .chat-msg.typing .bubble {
  background: #e4e6ea;
  color: #6b7280;
  font-style: italic;
  font-size: 0.8rem;
}

/* -- Chat Input Area -- */
.mini-chat-container .chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.mini-chat-container .chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  font-size: 0.86rem;
  outline: none;
  background: #f9fafb;
  font-family: 'Poppins', sans-serif;
}

.mini-chat-container .chat-input-area input:focus {
  border-color: #0B3B24;
  background: #fff;
}

.mini-chat-container .chat-input-area input::placeholder {
  color: #9ca3af;
}

.mini-chat-container .btn-send {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0B3B24, #2D8F5C);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mini-chat-container .btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(11, 59, 36, 0.25);
}


/* ===== WHATSAPP PROFILE OVERLAY / POPUP ===== */
.whatsapp-profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.whatsapp-profile-overlay.show {
  opacity: 1;
}

.close-profile {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: background 0.2s;
}

.close-profile:hover {
  background: rgba(255, 255, 255, 0.35);
}

.whatsapp-profile-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: profilePop 0.35s ease-out;
}

@keyframes profilePop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.whatsapp-profile-card .profile-header-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.whatsapp-profile-card .profile-info {
  padding: 20px;
}

.whatsapp-profile-card .profile-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0B3B24;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.whatsapp-profile-card .profile-specialties {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.whatsapp-profile-card .profile-detail-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 4px;
}

.whatsapp-profile-card .detail-label {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.whatsapp-profile-card .detail-value {
  display: block;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.5;
}

.whatsapp-profile-card .blurred-phone {
  filter: blur(3px);
  user-select: none;
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .chat-fab {
    bottom: 18px;
    right: 18px;
    width: 56px;
    height: 56px;
  }

  .chat-fab__avatar {
    width: 56px;
    height: 56px;
  }

  .mini-chat-container {
    bottom: 86px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: 380px;
    border-radius: 16px;
  }

  .whatsapp-profile-card .profile-header-img {
    height: 220px;
  }
}
