/* WhatsApp FAB and Modal Styles - External CSS File */

/* WhatsApp FAB - Positioned on the RIGHT side */
#waFab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  /* Safe area for notched devices */
  bottom: max(24px, env(safe-area-inset-bottom) + 24px);
}

#waFab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

#waFab:active {
  transform: scale(0.95);
}

#waFab svg {
  width: 32px;
  height: 32px;
  fill: white;
}

/* Modal Overlay */
#waOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#waModal {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #waModal {
  background: #1a1a1a;
  color: #ffffff;
}

/* Modal Header */
#waHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

[data-theme="dark"] #waHead {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

#waHeadL {
  display: flex;
  align-items: center;
  gap: 12px;
}

#waBadge {
  width: 40px;
  height: 40px;
}

#waBadge svg {
  width: 100%;
  height: 100%;
  fill: #25D366;
}

#waTitle {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

[data-theme="dark"] #waTitle {
  color: #ffffff;
}

#waClose {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

#waClose:hover {
  background: #f3f4f6;
  color: #111827;
}

[data-theme="dark"] #waClose {
  color: #9ca3af;
}

[data-theme="dark"] #waClose:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Modal Body */
#waBody {
  padding: 20px;
}

#waGrid {
  display: grid;
  gap: 24px;
}

#waQrCard {
  text-align: center;
}

#waQrWrap {
  background: white;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  border: 1px solid #e5e7eb;
}

[data-theme="dark"] #waQrWrap {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

#waQr {
  display: block;
}

#waQrCap {
  margin-top: 12px;
  font-weight: 600;
  color: #111827;
}

[data-theme="dark"] #waQrCap {
  color: #ffffff;
}

#waQrHint {
  margin-top: 8px;
  font-size: 14px;
  color: #6b7280;
}

[data-theme="dark"] #waQrHint {
  color: #9ca3af;
}

#waHint {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 20px;
}

[data-theme="dark"] #waHint {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

#waMeta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

[data-theme="dark"] .waRow {
  background: rgba(255, 255, 255, 0.05);
}

.waKey {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

[data-theme="dark"] .waKey {
  color: #9ca3af;
}

.waVal {
  font-size: 14px;
  color: #111827;
  font-weight: 500;
  word-break: break-all;
}

[data-theme="dark"] .waVal {
  color: #ffffff;
}

.waMiniBtn {
  padding: 6px 12px;
  background: #25D366;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.waMiniBtn:hover {
  background: #20ba5a;
}

/* Toast Notification */
#waToast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #waToast {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 640px) {
  #waFab {
    bottom: max(20px, env(safe-area-inset-bottom) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
  }

  #waFab svg {
    width: 28px;
    height: 28px;
  }

  #waModal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }

  #waOverlay {
    align-items: flex-end;
    padding: 0;
  }

  #waToast {
    bottom: 80px;
  }
}
