/* ==========================================================================
   IRONITT v2 — call surfaces
   --------------------------------------------------------------------------
   The incoming-call window (#notif-call-modal, js/island.js _showCallModal)
   and the small badge that stays on screen during a call or a screen share
   (#notif-badge, _showBadge). Both float, so both carry a shadow; neither
   glows or pulses. The window is about one decision, so its two buttons
   say what they do.
   ========================================================================== */

/* ---- Incoming call window ---------------------------------------------- */
/* Out of the render tree while idle (iOS samples even transparent fixed
   layers for the status bar); island.js adds --open, then --visible. */
#notif-call-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
#notif-call-modal.notif-call-modal--open { display: flex; }
#notif-call-modal.notif-call-modal--visible { opacity: 1; pointer-events: auto; }

/* No blur: a darker scrim separates without repainting the page each frame. */
.notif-call-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--scrim) 100%, #000 20%);
}

.notif-call-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: var(--space-md);
  width: min(340px, 100%);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.98);
  transition: transform 220ms var(--island-ease);
}
#notif-call-modal.notif-call-modal--visible .notif-call-card { transform: none; }

.notif-call-rings { display: grid; place-items: center; }
.notif-call-avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  color: var(--accent-color);
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

.notif-call-info { display: grid; justify-items: center; gap: 2px; text-align: center; }
.notif-call-name {
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}
.notif-call-label { color: var(--text-muted); font-size: var(--font-size-sm); }

.notif-call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  width: 100%;
  margin-top: var(--space-sm);
}
.notif-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  height: 46px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: filter 150ms ease, transform 120ms ease;
}
.notif-call-btn:active { transform: scale(0.97); }
.notif-call-btn:hover { filter: brightness(1.08); }
.notif-call-btn--decline { background: var(--color-danger); color: var(--text-on-danger); }
.notif-call-btn--accept { background: var(--accent-color); color: var(--accent-text); }

/* ---- In-call / screen-share badge -------------------------------------- */
#notif-badge {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: var(--z-tooltip);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-island);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: transform 220ms var(--island-ease), opacity 180ms ease;
}
#notif-badge.notif-badge--visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#notif-badge:empty { display: none; }

.notif-badge__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-round);
  font-size: 12px;
}
.notif-badge__icon--call { background: var(--accent-light); color: var(--accent-color); }
.notif-badge__icon--warning { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning); }

.notif-badge__text { display: flex; align-items: baseline; gap: var(--space-sm); }
.notif-badge__title { color: var(--text-primary); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }
.notif-badge__timer { color: var(--accent-color); font-size: var(--font-size-sm); font-variant-numeric: tabular-nums; }

.notif-badge__actions { display: flex; gap: 6px; margin-left: var(--space-xs); transition: opacity 150ms ease; }
.notif-badge--hide-actions .notif-badge__actions { opacity: 0; pointer-events: none; }
.notif-badge__btn {
  display: grid;
  place-items: center;
  height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-danger);
  color: var(--text-on-danger);
  font-size: 12px;
  cursor: pointer;
  transition: filter 150ms ease;
}
.notif-badge__btn:hover { filter: brightness(1.08); }
.notif-badge__btn--decline { width: 30px; }
.notif-badge__btn--stop { padding: 0 var(--space-md); font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold); }

/* Phones: above the floating dock, never over its tabs. */
@media (max-width: 768px) {
  #notif-badge { bottom: calc(var(--mobile-nav-h, 64px) + env(safe-area-inset-bottom, 0px) + 28px); }
  html.kb-open #notif-badge { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #notif-call-modal, .notif-call-card, #notif-badge { transition: opacity 120ms ease; }
}
