/* =====================================================
   Jogi AI — WhatsApp Chat Widget
   ===================================================== */

/* ---------- Launcher Button ---------- */
.wa-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0,0,0,.35);
  border: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
  outline: none;
}
.wa-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(37, 211, 102, 0.6), 0 2px 8px rgba(0,0,0,.35);
}
.wa-launcher:focus-visible {
  outline: 3px solid #25d366;
  outline-offset: 3px;
}
.wa-launcher svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}
.wa-launcher-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(37,211,102,.35);
  animation: waPulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes waPulse {
  0%   { transform: scale(1);   opacity: .7; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Tooltip on hover */
.wa-launcher::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.82);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.wa-launcher:hover::after { opacity: 1; }

/* Notification badge */
.wa-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff4757;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0d1117;
  animation: badgePop .4s ease;
}
@keyframes badgePop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---------- Chat Window ---------- */
.wa-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9998;
  width: 360px;
  max-width: calc(100vw - 40px);
  background: #0d1117;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 520px;
  transform: translateY(20px) scale(.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
}
.wa-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* Header */
.wa-header {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.wa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.3);
}
.wa-header-info { flex: 1; min-width: 0; }
.wa-header-name {
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  line-height: 1.2;
}
.wa-header-status {
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.wa-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: statusBlink 2s ease-in-out infinite;
}
@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.wa-close-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background .2s;
  flex-shrink: 0;
}
.wa-close-btn:hover { background: rgba(255,255,255,.28); }

/* Messages area */
.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #161b22;
  /* WhatsApp-style subtle pattern */
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E");
}
.wa-messages::-webkit-scrollbar { width: 4px; }
.wa-messages::-webkit-scrollbar-track { background: transparent; }
.wa-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Message bubbles */
.wa-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msgSlideIn .22s ease;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wa-msg.bot { align-self: flex-start; }
.wa-msg.user { align-self: flex-end; }

.wa-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .85rem;
  line-height: 1.55;
  word-break: break-word;
}
.wa-msg.bot .wa-bubble {
  background: #1c2128;
  color: #e6edf3;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,.07);
}
.wa-msg.user .wa-bubble {
  background: #005c4b;
  color: #e9ffe5;
  border-bottom-right-radius: 4px;
}
.wa-bubble time {
  display: block;
  font-size: .65rem;
  color: rgba(255,255,255,.35);
  margin-top: 4px;
  text-align: right;
}

/* Typing indicator */
.wa-typing .wa-bubble {
  padding: 12px 16px;
}
.wa-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}
.wa-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.wa-dots span:nth-child(2) { animation-delay: .18s; }
.wa-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); background: rgba(255,255,255,.7); }
}

/* Quick reply buttons */
.wa-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  animation: msgSlideIn .3s ease;
}
.wa-qr-btn {
  background: transparent;
  border: 1.5px solid #25d366;
  color: #25d366;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, transform .15s;
  font-family: inherit;
}
.wa-qr-btn:hover {
  background: #25d366;
  color: #0d1117;
  transform: translateY(-1px);
}
.wa-qr-btn:active { transform: scale(.96); }
.wa-qr-btn.selected {
  background: #25d366;
  color: #0d1117;
  pointer-events: none;
}

/* Text input area */
.wa-input-area {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: #1c2128;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.wa-text-input {
  flex: 1;
  background: #0d1117;
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 22px;
  padding: 10px 16px;
  color: #e6edf3;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.wa-text-input::placeholder { color: rgba(255,255,255,.3); }
.wa-text-input:focus { border-color: #25d366; }
.wa-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}
.wa-send-btn:hover { background: #1ebe5a; transform: scale(1.07); }
.wa-send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* Open WhatsApp CTA */
.wa-open-cta {
  margin: 8px 14px 4px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: calc(100% - 28px);
  font-family: inherit;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37,211,102,.3);
  animation: msgSlideIn .3s ease;
}
.wa-open-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37,211,102,.45);
}
.wa-open-cta svg { width: 20px; height: 20px; fill: #fff; }

/* Privacy note */
.wa-privacy {
  text-align: center;
  font-size: .65rem;
  color: rgba(255,255,255,.25);
  padding: 6px 14px 10px;
  flex-shrink: 0;
}

/* ---------- Homepage "chat teaser" section ---------- */
.wa-teaser-section {
  background: linear-gradient(135deg, #051a14 0%, #0d1117 60%, #071a2e 100%);
  border-top: 1px solid rgba(37,211,102,.12);
  border-bottom: 1px solid rgba(37,211,102,.12);
  padding: 72px 0;
}
.wa-teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 768px) {
  .wa-teaser-grid { grid-template-columns: 1fr; gap: 36px; }
}
.wa-teaser-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(37,211,102,.12);
  border: 1px solid rgba(37,211,102,.25);
  color: #25d366;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: .04em;
}
.wa-teaser-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #25d366;
  animation: waPulse 2s ease-out infinite;
}
.wa-teaser-grid h2 { margin-bottom: 14px; }
.wa-teaser-grid p { margin-bottom: 24px; }
.wa-teaser-points {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wa-teaser-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  color: #9da7b0;
  line-height: 1.5;
}
.wa-teaser-points li .check-mark {
  color: #25d366;
  font-weight: 700;
  flex-shrink: 0;
}
.wa-teaser-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #0d1117;
  font-weight: 700;
  font-size: .95rem;
  padding: 15px 32px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
  text-decoration: none;
}
.wa-teaser-start-btn:hover {
  background: #1ebe5a;
  transform: translateY(-2px);
  box-shadow: 0 7px 28px rgba(37,211,102,.5);
}
.wa-teaser-start-btn svg { width: 20px; height: 20px; fill: #0d1117; }
.wa-no-form-note {
  font-size: .75rem;
  color: rgba(255,255,255,.3);
  margin-top: 10px;
}

/* Chat preview on the right */
.wa-preview-phone {
  background: #1c2128;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.wa-preview-header {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wa-preview-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.wa-preview-name { font-weight: 700; font-size: .85rem; color: #fff; }
.wa-preview-status { font-size: .68rem; color: rgba(255,255,255,.7); }
.wa-preview-messages {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #161b22;
}
.wa-preview-bubble {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: .78rem;
  line-height: 1.5;
  max-width: 82%;
}
.wa-preview-bubble.bot {
  background: #1c2128;
  color: #e6edf3;
  border-bottom-left-radius: 3px;
  border: 1px solid rgba(255,255,255,.07);
  align-self: flex-start;
}
.wa-preview-bubble.user {
  background: #005c4b;
  color: #e9ffe5;
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}
.wa-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px 8px;
}
.wa-preview-chip {
  background: transparent;
  border: 1.5px solid #25d366;
  color: #25d366;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: .7rem;
  font-weight: 600;
}

/* ---------- Contact page WhatsApp panel ---------- */
.wa-contact-panel {
  background: #1c2128;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.wa-contact-panel-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.35);
}
.wa-contact-panel-icon svg { width: 34px; height: 34px; fill: #fff; }
.wa-contact-panel h3 { margin-bottom: 4px; }
.wa-contact-panel p { font-size: .88rem; max-width: 300px; }
.wa-contact-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #0d1117;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 30px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .2s;
  box-shadow: 0 4px 18px rgba(37,211,102,.3);
  width: 100%;
  justify-content: center;
  text-decoration: none;
}
.wa-contact-start-btn:hover { background: #1ebe5a; transform: translateY(-2px); }
.wa-contact-start-btn svg { width: 20px; height: 20px; fill: #0d1117; }
.wa-contact-feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.wa-contact-feature-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .82rem;
  color: #9da7b0;
}
.wa-contact-feature-list .check-mark { color: #25d366; font-weight: 700; }

/* ---------- Mobile responsiveness ---------- */
@media (max-width: 480px) {
  .wa-window { right: 12px; bottom: 88px; width: calc(100vw - 24px); max-height: 75vh; }
  .wa-launcher { bottom: 18px; right: 18px; }
  .wa-contact-panel { padding: 24px 18px; }
}
