/* ============================================================
   SA Teambuilding — self-hosted widgets
   Replaces: Elfsight WhatsApp Chat, Contact tab, Popup/Intro Video
   No dependencies. No subscription. Colours match app.css.
   ============================================================ */

:root {
  --sa-green: #4DA528;
  --sa-green-dark: #3d8420;
  --sa-orange: #FF970D;
  --sa-wa: #25D366;
  --sa-ink: #12261a;
  --sa-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

/* ---------- shared floating rail ---------- */
.sa-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

/* ---------- vertical "Contact us" tab ---------- */
.sa-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 12px;
  background: var(--sa-green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  writing-mode: vertical-rl;
  border-radius: 10px 0 0 10px;
  box-shadow: var(--sa-shadow);
  transition: background .2s ease, padding-right .2s ease;
}

.sa-tab:hover,
.sa-tab:focus-visible {
  background: var(--sa-green-dark);
  color: #fff;
  padding-right: 18px;
}

.sa-tab svg {
  width: 20px;
  height: 20px;
  transform: rotate(90deg);
  flex: none;
}

/* ---------- WhatsApp bubble ---------- */
.sa-wa {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9991;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--sa-wa);
  display: grid;
  place-items: center;
  box-shadow: var(--sa-shadow);
  text-decoration: none;
  transition: transform .18s ease;
}

.sa-wa:hover,
.sa-wa:focus-visible { transform: scale(1.08); }

.sa-wa svg { width: 32px; height: 32px; fill: #fff; }

/* unread-style dot — purely decorative, hidden from screen readers */
.sa-wa::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e8453c;
  border: 2px solid #fff;
}

.sa-wa-label {
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  white-space: nowrap;
  background: #fff;
  color: var(--sa-ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--sa-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.sa-wa:hover .sa-wa-label,
.sa-wa:focus-visible .sa-wa-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---------- modal ---------- */
.sa-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 20, 10, .78);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.sa-modal[data-open="true"] { opacity: 1; visibility: visible; }

.sa-modal__panel {
  position: relative;
  width: min(880px, 100%);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  transform: translateY(18px) scale(.98);
  transition: transform .25s ease;
}

.sa-modal[data-open="true"] .sa-modal__panel {
  transform: translateY(0) scale(1);
}

.sa-modal__video {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: block;
  border: 0;
  background: #000;
}

.sa-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s ease;
}

.sa-modal__close:hover { background: var(--sa-green); }

/* ---------- responsive ---------- */
@media (max-width: 767px) {
  .sa-tab { padding: 16px 9px; font-size: 13px; }
  .sa-wa { width: 54px; height: 54px; right: 16px; bottom: 16px; }
  .sa-wa svg { width: 28px; height: 28px; }
  .sa-wa-label { display: none; }
}

/* ---------- accessibility ---------- */
.sa-tab:focus-visible,
.sa-wa:focus-visible,
.sa-modal__close:focus-visible {
  outline: 3px solid var(--sa-orange);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .sa-tab, .sa-wa, .sa-wa-label,
  .sa-modal, .sa-modal__panel { transition: none; }
}
