/**
 * Mohd Ghouse Portfolio - WhatsApp Chat Widget Styles
 */

:root {
  --wa-green: #25D366;
  --wa-green-dark: #128C7E;
  --wa-teal: #075E54;
  --wa-bg-dark: #121b22;
  --wa-card-dark: #1f2c34;
  --wa-bubble-in: #202c33;
  --wa-bubble-out: #005c4b;
  --wa-text-primary: #e9edef;
  --wa-text-secondary: #8696a0;
  --wa-border: rgba(255, 255, 255, 0.08);
}

/* Floating Trigger Button */
.wa-widget-container {
  position: fixed;
  bottom: 95px;
  right: 28px;
  z-index: 9998;
  font-family: inherit;
}

.wa-float-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35), 0 4px 10px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  border: none;
  outline: none;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wa-float-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.5), 0 6px 14px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.wa-float-btn i,
.wa-float-btn svg {
  font-size: 32px;
  width: 32px;
  height: 32px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

/* Pulse Animation Ring */
.wa-float-btn::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: waPulse 2s infinite;
  pointer-events: none;
}

@keyframes waPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Online Badge Dot on Button */
.wa-unread-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background-color: #ff3b30;
  border: 2px solid #111111;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.8);
}

/* Tooltip on Button Hover */
.wa-btn-tooltip {
  position: absolute;
  right: 70px;
  background: #191919;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all 0.25s ease;
}

.wa-btn-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  margin-top: -5px;
  border-width: 5px 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent transparent #191919;
}

.wa-widget-container:hover .wa-btn-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Chat Popup Window */
.wa-popup-window {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--wa-bg-dark);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--wa-border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.wa-popup-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.wa-header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  padding: 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.wa-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.wa-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.wa-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background-color: #25D366;
  border: 2px solid #075E54;
  border-radius: 50%;
}

.wa-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px 0;
  color: #ffffff;
  line-height: 1.2;
}

.wa-info span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  display: block;
}

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

.wa-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.wa-body {
  padding: 18px 16px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 190px;
  max-height: 300px;
  overflow-y: auto;
}

.wa-date-chip {
  align-self: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--wa-text-secondary);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Incoming Message Bubble */
.wa-msg-bubble {
  background: var(--wa-bubble-in);
  color: var(--wa-text-primary);
  padding: 12px 14px;
  border-radius: 0 12px 12px 12px;
  max-width: 88%;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.wa-msg-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid var(--wa-bubble-in);
  border-left: 8px solid transparent;
}

.wa-msg-time {
  display: block;
  font-size: 10.5px;
  color: var(--wa-text-secondary);
  text-align: right;
  margin-top: 5px;
}

/* Quick Topic Pills */
.wa-quick-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.wa-topic-chip {
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.25);
  color: #25D366;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-topic-chip:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: #25D366;
  transform: translateY(-1px);
}

/* Footer & Input Area */
.wa-footer {
  background: #1f2c34;
  padding: 12px;
  border-top: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a3942;
  border-radius: 22px;
  padding: 4px 6px 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wa-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e9edef;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  line-height: 1.4;
  padding: 4px 0;
}

.wa-input::placeholder {
  color: #8696a0;
}

.wa-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

.wa-send-btn:hover {
  background: #1ebd5b;
  transform: scale(1.05);
}

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

.wa-send-btn i,
.wa-send-btn svg {
  font-size: 15px;
  width: 15px;
  height: 15px;
  fill: currentColor;
  margin-left: 1px;
}

.wa-direct-btn {
  background: rgba(37, 211, 102, 0.12);
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.wa-direct-btn:hover {
  background: #25D366;
  color: #111111;
  border-color: #25D366;
}

/* Mobile Responsiveness */
@media (max-width: 575px) {
  .wa-widget-container {
    bottom: 85px;
    right: 18px;
  }
  .wa-popup-window {
    width: calc(100vw - 36px);
    right: 0;
    bottom: 70px;
  }
}
