/* ==========================================================================
   WhatsApp & Social Floating Widget Component (Unify Design System)
   ========================================================================== */

/* Main Fixed Wrapper */
.wa-widget-container {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: inherit;
}

/* Floating Action Trigger Button */
.wa-trigger-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  border: none;
  cursor: pointer;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
  text-decoration: none !important;
  padding: 0;
}

.wa-trigger-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55);
  color: #ffffff !important;
}

.wa-trigger-btn:active {
  transform: scale(0.95);
}

.wa-trigger-icon {
  font-size: 32px;
  transition: transform 0.3s ease, opacity 0.2s ease;
  line-height: 1;
}

.wa-trigger-close-icon {
  font-size: 20px;
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
  transition: transform 0.3s ease, opacity 0.2s ease;
}

/* Active State Trigger Transforms */
.wa-widget-container.is-open .wa-trigger-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.wa-widget-container.is-open .wa-trigger-close-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Online Pulse Ring Animation */
.wa-pulse-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: waPulse 2.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes waPulse {
  0% {
    transform: scale(0.95);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.18);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

.wa-widget-container.is-open .wa-pulse-ring {
  animation: none;
  display: none;
}

/* Online Status Badge Dot */
.wa-status-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #25D366;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Popup Chat Window */
.wa-chat-window {
  position: fixed;
  left: 24px;
  bottom: 96px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16), 0 4px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom left;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease;
}

.wa-widget-container.is-open .wa-chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header Styling */
.wa-chat-header {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 24px 20px 20px 20px;
  overflow: hidden;
}

.wa-chat-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(18, 140, 126, 0.92) 0%, rgba(7, 94, 84, 0.95) 100%);
  z-index: 1;
}

.wa-chat-header-content {
  position: relative;
  z-index: 2;
}

.wa-chat-header-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff !important;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.wa-chat-header-close:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

.wa-chat-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
}

.wa-chat-subtitle {
  font-size: 13px;
  font-weight: 300;
  opacity: 0.94;
  margin-bottom: 10px;
  color: #ffffff;
  line-height: 1.4;
}

.wa-online-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-weight: 500;
}

.wa-online-dot {
  width: 7px;
  height: 7px;
  background-color: #25D366;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 6px #25D366;
}

/* Body / Channel List */
.wa-chat-body {
  padding: 16px 16px 20px 16px;
  background-color: #ffffff;
}

.wa-channel-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none !important;
  color: #2b2b2b;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
}

.wa-channel-item:last-child {
  margin-bottom: 0;
}

.wa-channel-item:hover {
  background-color: #f7f9fa;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  color: #000000;
}

.wa-channel-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-right: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wa-channel-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.wa-channel-info {
  flex-grow: 1;
  min-width: 0;
}

.wa-channel-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px 0;
  color: #1c1e21;
  line-height: 1.3;
}

.wa-channel-desc {
  font-size: 12px;
  color: #65676b;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-channel-arrow {
  color: #bcc0c4;
  font-size: 16px;
  margin-left: 8px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.wa-channel-item:hover .wa-channel-arrow {
  color: #128C7E;
  transform: translateX(3px);
}

/* Dark Mode Overrides */
html.dark-mode .wa-chat-window,
body.dark-mode .wa-chat-window {
  background-color: #1a202c;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

html.dark-mode .wa-chat-body,
body.dark-mode .wa-chat-body {
  background-color: #1a202c;
}

html.dark-mode .wa-channel-item,
body.dark-mode .wa-channel-item {
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.06);
  background-color: #212936;
}

html.dark-mode .wa-channel-item:hover,
body.dark-mode .wa-channel-item:hover {
  background-color: #2d3748;
  color: #ffffff;
}

html.dark-mode .wa-channel-title,
body.dark-mode .wa-channel-title {
  color: #f7fafc;
}

html.dark-mode .wa-channel-desc,
body.dark-mode .wa-channel-desc {
  color: #a0aec0;
}

html.dark-mode .wa-channel-arrow,
body.dark-mode .wa-channel-arrow {
  color: #4a5568;
}

html.dark-mode .wa-channel-item:hover .wa-channel-arrow,
body.dark-mode .wa-channel-item:hover .wa-channel-arrow {
  color: #25D366;
}

html.dark-mode .wa-status-badge,
body.dark-mode .wa-status-badge {
  border-color: #1a202c;
}
