/* ============================================================
   GODDY TABI — NOTIFICATIONS / PWA-BANNER ADDITIONS
   New, additive rules only — nothing here overrides an existing
   shared selector (.toast, .sheet, .btn, etc. are untouched).
   Covers: the gentle-nudge action-toast (js/app.js ui.actionToast)
   and small polish for the PWA install/notification sheets
   (js/pwa.js).
   ============================================================ */

/* ── Gentle nudge action-toast ── */
.gt-nudge {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(24px);
  width: min(92vw, 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--navy-deep, #0F1E42);
  color: #fff;
  padding: 14px 14px 14px 16px;
  border-radius: var(--r-lg, 16px);
  box-shadow: var(--shadow-xl, 0 20px 60px rgba(15,30,66,0.18));
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity var(--base, 250ms ease), transform var(--base, 250ms ease);
}
.gt-nudge.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.gt-nudge::before {
  content: '💡';
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.gt-nudge__msg {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.gt-nudge__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.gt-nudge__action {
  background: var(--gold, #D4A017);
  color: var(--navy-deep, #0F1E42);
  border: none;
  border-radius: var(--r-full, 9999px);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.gt-nudge__action:active { transform: scale(0.96); }
.gt-nudge__dismiss {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 420px) {
  .gt-nudge { width: calc(100vw - 24px); }
}

/* ── PWA install sheet / notification-permission sheet ──────────
   Both reuse the app's shared .sheet / .sheet-backdrop / .sheet__handle
   (css/components.css) for the container itself — everything below is
   just the content that goes inside, styled to match the rest of the
   app's visual language (same navy/gold palette, same card/badge
   shapes) instead of a bespoke one-off look. */

#pwa-install-btn {
  box-shadow: 0 10px 24px rgba(27,45,94,0.28);
}
#pwa-install-btn:not(:disabled):hover {
  background: var(--navy-mid, #243875) !important;
  transform: translateY(-1px);
}
#pwa-install-btn:not(:disabled):active {
  transform: translateY(0);
}
#pwa-icon {
  will-change: transform, opacity;
}

/* Small "real app" shimmer on the install sheet's badge chip */
@keyframes gt-pwa-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,160,23,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(212,160,23,0); }
}
#pwa-sheet .gt-badge-pulse {
  animation: gt-pwa-badge-pulse 2.2s ease infinite;
}

/* ── Hero band ── */
.pwa-hero {
  display: flex;
  align-items: center;
  gap: var(--s4, 16px);
  background: linear-gradient(135deg, var(--navy-deep, #0F1E42) 0%, var(--navy, #1B2D5E) 100%);
  padding: 22px 20px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}
.pwa-hero::before {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(212,160,23,0.10);
}
.pwa-hero__icon-wrap {
  width: 64px; height: 64px;
  border-radius: var(--r-lg, 16px);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,0.32);
  animation: pwa-icon-in 0.55s cubic-bezier(0.34,1.56,0.64,1) both;
  position: relative;
  z-index: 1;
}
.pwa-hero__icon-wrap--fallback { background: var(--navy-mid, #243875); }
.pwa-hero__icon { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes pwa-icon-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.pwa-hero__text { position: relative; z-index: 1; }
.pwa-hero__name {
  /* Deliberately NOT var(--font-display) — that token is actually
     'Inter' (a UI-text alias, misleadingly named); the real Playfair
     Display serif (already loaded in index.html and used the same way
     for hero text in css/spotlight.css) is what gives this a premium
     feel here, so it's named explicitly to match that convention. */
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.pwa-hero__tag {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 3px;
}
.pwa-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(212,160,23,0.18);
  border: 1px solid rgba(212,160,23,0.32);
  border-radius: var(--r-full, 9999px);
  padding: 3px 10px;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold, #D4A017);
}
.pwa-hero__badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold, #D4A017);
}

/* ── Feature grid ── */
.pwa-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 16px 0;
}
.pwa-feature {
  background: var(--bg, #F8FAFC);
  border-radius: var(--r-lg, 12px);
  padding: 12px 10px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.pwa-feature__icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27,45,94,0.08);
  color: var(--navy, #1B2D5E);
}
.pwa-feature__icon svg { width: 16px; height: 16px; }
.pwa-feature__title { font-size: 12px; font-weight: 700; color: var(--navy-deep, #0F1E42); line-height: 1.3; }
.pwa-feature__sub   { font-size: 10.5px; color: var(--text-muted, #9AA0B8); margin-top: 1px; line-height: 1.35; }

/* ── CTA block (shared by both sheets) ── */
.pwa-cta { padding: 16px 16px 4px; }
.pwa-cta__later { margin-top: 6px; }
.pwa-cta__ico { display: inline-flex; }
.pwa-cta__ico svg { width: 18px; height: 18px; }
.pwa-cta__ico--spin svg { animation: pwa-spin 0.9s linear infinite; }
@keyframes pwa-spin { to { transform: rotate(360deg); } }
.pwa-cta__btn--success { background: var(--green, #16A34A) !important; }

.pwa-safari-hint {
  display: flex;
  background: var(--blue-bg, #EFF6FF);
  border-radius: var(--r-lg, 12px);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.6;
  text-align: center;
}

/* ── Notification-permission hero ── */
.notifperm-hero { padding: 24px 20px 4px; text-align: center; }
.notifperm-hero__ring {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27,45,94,0.09) 0%, rgba(27,45,94,0.02) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notifperm-hero__bell {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy, #1B2D5E);
  animation: pwa-bell-ring 1s ease 0.4s;
}
.notifperm-hero__bell svg { width: 32px; height: 32px; }
@keyframes pwa-bell-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-16deg); }
  40% { transform: rotate(13deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}
.notifperm-hero__title {
  font-size: 21px;
  font-weight: 900;
  color: var(--navy-deep, #0F1E42);
  margin-bottom: 8px;
}
.notifperm-hero__sub {
  font-size: 13.5px;
  color: var(--text-secondary, #5A6485);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* ── Notification bell panel — filter chips + swipe-to-delete ──────
   (js/notifications.js). Kept simple and forgiving on purpose: chips
   only appear once there's enough in the list to be worth sorting,
   and every gesture-only action (swipe) has a visible tap equivalent
   (the ✕ button) since this app's audience can't be assumed to know
   swipe gestures. */
.notif-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 20px 12px;
  margin: 0 -20px 4px;
  scrollbar-width: none;
}
.notif-filters::-webkit-scrollbar { display: none; }

.notif-filter-chip {
  flex-shrink: 0;
  border: 1px solid #E4E8F2;
  background: #fff;
  color: var(--text-secondary, #5A6485);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.notif-filter-chip--active {
  background: var(--navy, #16215A);
  border-color: var(--navy, #16215A);
  color: #fff;
}

.notif-item-row {
  position: relative;
  border-radius: 12px;
  margin-bottom: 6px;
  overflow: hidden;
}
/* Two reveal layers, one per side — swiping either direction is
   supported, so whichever side the item is sliding away from needs
   its own trash-can underneath it. Both start hidden; the active
   direction (see attachSwipe() in js/notifications.js) fades its side
   in via the --swipe-left/--swipe-right modifier on the row. */
.notif-item-row__bg {
  position: absolute;
  inset: 0;
  background: var(--red, #E5484D);
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 19px;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.notif-item-row__bg--left {
  justify-content: flex-start;
  padding-left: 22px;
}
.notif-item-row__bg--right {
  justify-content: flex-end;
  padding-right: 22px;
}
/* Swiping LEFT moves the item away from the right edge, so the RIGHT
   layer is what should be exposed underneath it — and vice versa. */
.notif-item-row--swipe-left .notif-item-row__bg--right,
.notif-item-row--swipe-right .notif-item-row__bg--left {
  opacity: 1;
}
.notif-item {
  position: relative;
  z-index: 1;
  will-change: transform;
}
.notif-item__del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted, #97A1BD);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.notif-item__del:hover,
.notif-item__del:active {
  background: #EEF1F8;
  color: var(--red, #E5484D);
  opacity: 1;
}

/* ── Required setup gate (js/pwa.js maybeShowRequiredGate) ──
   Full-screen — deliberately NOT built on .sheet/.sheet-backdrop
   (those close on backdrop-click and register with GT.nav for
   hardware-back dismissal; step 1 must do neither — see the big
   comment above maybeShowRequiredGate() in pwa.js for why, including
   the "Continue for now" fallback for when the browser genuinely
   can't offer installability at all). z-index sits above everything
   else in the app, including the gentle-nudge toast (9999) and every
   sheet (7001), so nothing can show through it. Slides up from the
   bottom like the app's other sheets ("pwa-gate--in" is added on
   render, and re-added — via a forced reflow in gateShell() — on the
   step 1 → step 2 content swap so the motion replays each time). */
.pwa-gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: var(--bg, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  opacity: 0;
  transform: translateY(24px);
}
.pwa-gate.pwa-gate--in {
  animation: pwa-gate-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes pwa-gate-in {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pwa-gate__inner {
  width: 100%;
  max-width: 380px;
  text-align: center;
  margin: auto;
  position: relative;
}
.pwa-gate__step {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold, #D4A017);
  margin-bottom: 14px;
}
.pwa-gate__title {
  font-family: 'Playfair Display', 'Inter', serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-deep, #0F1E42);
  line-height: 1.25;
}
.pwa-gate__sub {
  font-size: 13.5px;
  color: var(--text-muted, #6B7280);
  margin-top: 10px;
  line-height: 1.5;
}
/* Step 2 only — step 1 has no close button anywhere in its markup
   (see pwa.js). Positioned relative to .pwa-gate__inner rather than
   the full-screen .pwa-gate itself so it sits at the top-right of the
   centered card content, not the physical corner of the viewport. */
.pwa-gate__close {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-alt, #F5F6FA);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
}
.pwa-gate__close svg { width: 16px; height: 16px; }

