/* The website's inbox: header bell, slide-in panel, toast and fullscreen
   message (src/map/inbox.js). The admin composer previews with these same
   classes, so what it shows is what a visitor gets. */

:root {
  --ib-glass: rgba(255, 255, 255, 0.74);
  --ib-glass-strong: rgba(255, 255, 255, 0.9);
  /* What text sits on. Glass is for edges and pictures: map pills behind a
     0.74 pane stayed legible enough to read THROUGH the title ("Utah · 5"
     under "Welcome…"), so every text area is a near-solid surface. */
  --ib-surface: rgba(255, 255, 255, 0.97);
  --ib-surface-soft: rgba(250, 252, 253, 0.94);
  --ib-stroke: rgba(255, 255, 255, 0.7);
  --ib-hairline: rgba(14, 37, 49, 0.1);
  --ib-ink: #0E2531;
  --ib-ink-soft: #3E5B6B;
  --ib-ink-faint: #607D8B;
  --ib-accent: #087A8A;          /* darkened brand teal: 5.3:1 on white */
  --ib-accent-ink: #FFFFFF;
  --ib-unread: #E7675D;
  --ib-shadow: 0 24px 60px -12px rgba(8, 26, 38, 0.35), 0 2px 8px rgba(8, 26, 38, 0.12);
  --ib-scrim: rgba(8, 20, 30, 0.38);
  --ib-blur: saturate(180%) blur(22px);
  --ib-radius: 22px;
  --ib-ease: cubic-bezier(0.2, 0.9, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ib-glass: rgba(18, 34, 46, 0.72);
    --ib-glass-strong: rgba(20, 38, 52, 0.92);
    --ib-surface: rgba(16, 31, 43, 0.97);
    --ib-surface-soft: rgba(18, 34, 46, 0.95);
    --ib-stroke: rgba(255, 255, 255, 0.12);
    --ib-hairline: rgba(255, 255, 255, 0.09);
    --ib-ink: #EEF6F9;
    --ib-ink-soft: #B9D2DC;
    --ib-ink-faint: #8EAAB6;
    --ib-accent: #3FC6D6;
    --ib-accent-ink: #062A31;
    --ib-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3);
    --ib-scrim: rgba(0, 0, 0, 0.5);
  }
}

/* ── Bell ─────────────────────────────────────────────────────────────── */
.inbox-bell {
  position: absolute;
  top: 10px;
  right: 64px;            /* the menu button is 40px at 20px from the edge */
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius, 8px);
  background: transparent;
  color: var(--text-light, #E9F5F9);
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.2s, opacity 0.2s;
  animation: ib-fade-in 0.35s var(--ib-ease);
}
.inbox-bell[hidden] { display: none; }
.inbox-bell:hover { background-color: var(--blue-accent, #2D89A8); }
.inbox-bell:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.inbox-bell.has-unread svg { animation: ib-ring 1.2s 0.6s var(--ib-ease) 1; transform-origin: 50% 10%; }
.ib-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ib-unread);
  color: #fff;
  font: 700 11px/18px 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: center;
  box-shadow: 0 0 0 2px var(--blue-bg-dark, #132838);
  pointer-events: none;
}
.ib-badge[hidden] { display: none; }
/* The search field takes the whole header on a phone; the bell steps aside. */
.app-header:has(.search-container.expanded) .inbox-bell { opacity: 0; pointer-events: none; }
@media (max-width: 768px) {
  .inbox-bell { right: 54px; }
}

/* ── Shared ───────────────────────────────────────────────────────────── */
.ib-icon { display: inline-flex; line-height: 0; }
.ib-icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--ib-hairline);
  background: var(--ib-glass-strong);
  color: var(--ib-ink-soft);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.ib-icon-btn:hover { color: var(--ib-ink); transform: scale(1.06); }
.ib-icon-btn:focus-visible, .ib-btn:focus-visible, .ib-link:focus-visible,
.ib-toast-main:focus-visible, .ib-toast-cta:focus-visible { outline: 2px solid var(--ib-accent); outline-offset: 2px; }
.ib-eyebrow, .ib-toast-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ib-accent);
}
.ib-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ib-scrim);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s var(--ib-ease);
}
html.ib-open, html.ib-open body { overflow: hidden; }

/* ── Panel ────────────────────────────────────────────────────────────── */
.ib-layer {
  position: fixed;
  inset: 0;
  z-index: 3200;            /* over the header (1500) and the venue card; under the admin panel (3500) */
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ib-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(420px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: var(--ib-surface-soft);
  backdrop-filter: var(--ib-blur);
  -webkit-backdrop-filter: var(--ib-blur);
  border: 1px solid var(--ib-stroke);
  border-radius: var(--ib-radius);
  box-shadow: var(--ib-shadow);
  color: var(--ib-ink);
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.42s var(--ib-ease);
}
.ib-layer.is-open .ib-panel { transform: none; }
.ib-layer.is-open .ib-backdrop { opacity: 1; }
.ib-layer.is-leaving .ib-panel { transform: translateX(calc(100% + 24px)); }
.ib-layer.is-leaving .ib-backdrop { opacity: 0; }
.ib-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 14px 24px;
  border-bottom: 1px solid var(--ib-hairline);
}
.ib-panel-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ib-ink); }
.ib-panel-sub { margin: 2px 0 0; font-size: 13px; color: var(--ib-ink-faint); }
.ib-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ib-panel-foot { margin: 0; padding: 10px 24px 14px; font-size: 11px; color: var(--ib-ink-faint); border-top: 1px solid var(--ib-hairline); }

.ib-item {
  position: relative;
  border-radius: 16px;
  background: var(--ib-glass-strong);
  border: 1px solid var(--ib-hairline);
  overflow: hidden;
  animation: ib-rise 0.45s var(--ib-ease) both;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.ib-list .ib-item:nth-child(2) { animation-delay: 0.04s; }
.ib-list .ib-item:nth-child(3) { animation-delay: 0.08s; }
.ib-list .ib-item:nth-child(n+4) { animation-delay: 0.12s; }
.ib-item.is-highlight { border-color: var(--ib-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ib-accent) 25%, transparent); }
.ib-item-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ib-hairline); }
.ib-item-video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b1a24; }
.ib-item-body { padding: 14px 16px 16px; }
.ib-inline-link {
  color: var(--ib-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  border-radius: 4px;
}
.ib-inline-link:hover { text-decoration-thickness: 2px; }
.ib-inline-link:focus-visible { outline: 2px solid var(--ib-accent); outline-offset: 1px; }
.ib-item-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ib-ink-faint); }
.ib-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ib-unread); display: none; transition: opacity 0.6s, transform 0.6s, width 0.6s, margin 0.6s; }
.ib-item.is-unread .ib-dot { display: inline-block; }
.ib-item.is-unread.is-seen .ib-dot { opacity: 0; transform: scale(0.4); width: 0; margin-right: -6px; }
.ib-item-title { margin: 6px 0 4px; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--ib-ink); }
.ib-item-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ib-ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.ib-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ib-accent);
  text-decoration: none;
  border-radius: 6px;
}
.ib-link .ib-icon { transition: transform 0.2s var(--ib-ease); }
.ib-link:hover .ib-icon { transform: translateX(3px); }

.ib-empty { text-align: center; padding: 64px 24px; color: var(--ib-ink-faint); }
.ib-empty .ib-icon { opacity: 0.6; }
.ib-empty-title { margin: 14px 0 4px; font-size: 16px; font-weight: 600; color: var(--ib-ink); }
.ib-empty-text { margin: 0; font-size: 14px; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.ib-toast-host {
  position: fixed;
  top: 76px;                 /* under the 60px header */
  right: 16px;
  z-index: 3100;
  width: min(380px, calc(100vw - 32px));
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ib-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 14px;
  border-radius: 20px;
  background: var(--ib-surface-soft);
  backdrop-filter: var(--ib-blur);
  -webkit-backdrop-filter: var(--ib-blur);
  border: 1px solid var(--ib-stroke);
  box-shadow: var(--ib-shadow);
  color: var(--ib-ink);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  transition: opacity 0.35s var(--ib-ease), transform 0.45s var(--ib-ease);
}
.ib-toast.is-in, .ib-toast.is-preview { opacity: 1; transform: none; }
.ib-toast.is-leaving { opacity: 0; transform: translateY(-8px) scale(0.97); }
.ib-toast-image, .ib-toast-glyph {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
}
.ib-toast-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0C9DB0, #1C3F56);
  color: #fff;
}
.ib-toast.has-video::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 30px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  z-index: 1;
  pointer-events: none;
}
.ib-toast-content { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ib-toast-main {
  align-self: stretch;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
}
.ib-toast-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ib-ink); }
.ib-toast-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ib-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ib-toast-close { width: 28px; height: 28px; }
.ib-toast-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  background: var(--ib-accent);
  color: var(--ib-accent-ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.ib-toast-cta .ib-icon svg { width: 14px; height: 14px; }
.ib-toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.ib-toast-progress span { display: block; height: 100%; background: var(--ib-accent); opacity: 0.55; transform-origin: left; }
.ib-toast.is-preview .ib-toast-progress span { transform: scaleX(0.62); }
@media (max-width: 768px) {
  .ib-toast-host { top: 70px; right: 12px; left: 12px; width: auto; }
}

/* ── Fullscreen message ───────────────────────────────────────────────── */
.ib-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 3300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.ib-modal-layer.is-open .ib-backdrop { opacity: 1; }
.ib-modal-layer.is-leaving .ib-backdrop { opacity: 0; }
.ib-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 28px;
  background: var(--ib-glass);
  backdrop-filter: var(--ib-blur);
  -webkit-backdrop-filter: var(--ib-blur);
  border: 1px solid var(--ib-stroke);
  box-shadow: var(--ib-shadow);
  color: var(--ib-ink);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.35s var(--ib-ease), transform 0.5s var(--ib-ease);
}
.ib-modal-layer.is-open .ib-modal, .ib-modal.is-preview { opacity: 1; transform: none; }
.ib-modal-layer.is-leaving .ib-modal { opacity: 0; transform: translateY(16px) scale(0.97); }
.ib-modal-hero { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.ib-modal-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib-modal-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #0b1a24; }
.ib-modal-hero.is-video { aspect-ratio: 16 / 9; }
.ib-modal-hero:not(.is-video)::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, var(--ib-surface), transparent);
  pointer-events: none;
}
.ib-modal-hero.is-art {
  aspect-ratio: 16 / 7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(120% 120% at 15% 10%, #3FC6D6 0%, transparent 55%),
    radial-gradient(90% 120% at 90% 20%, #F7C52E 0%, transparent 50%),
    linear-gradient(135deg, #0C9DB0, #132838);
}
.ib-modal-hero.is-art .ib-icon { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3)); z-index: 1; }
.ib-modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
/* The text area is a near-solid surface; the glass shows at the card's rim
   and around the hero. */
.ib-modal-content { padding: 8px 28px 28px; background: var(--ib-surface); }
.ib-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 14px; }
.ib-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ib-ink) 5%, transparent);
  border: 1px solid var(--ib-hairline);
}
.ib-stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--ib-ink); font-variant-numeric: tabular-nums; }
.ib-stat-label { font-size: 12px; font-weight: 500; color: var(--ib-ink-soft); }
.ib-stat-on .ib-stat-value { color: #2E7D32; }
.ib-stat-later .ib-stat-value { color: var(--ib-accent); }
@media (prefers-color-scheme: dark) {
  .ib-stat-on .ib-stat-value { color: #7BD88A; }
}
.ib-modal-title { margin: 8px 0 10px; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; color: var(--ib-ink); }
.ib-modal-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ib-ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.ib-modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.ib-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: none;
  font: 600 15px/1 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, background-color 0.2s;
}
.ib-btn:active { transform: scale(0.98); }
.ib-btn-primary { background: var(--ib-accent); color: var(--ib-accent-ink); box-shadow: 0 8px 20px -8px var(--ib-accent); }
.ib-btn-primary:hover { filter: brightness(1.08); }
.ib-btn-quiet { background: transparent; color: var(--ib-ink-soft); }
.ib-btn-quiet:hover { background: var(--ib-hairline); color: var(--ib-ink); }
@media (max-width: 520px) {
  .ib-modal-layer { align-items: flex-end; padding: 10px; }
  .ib-modal { border-radius: 26px; }
  .ib-modal-content { padding: 6px 22px 22px; }
  .ib-modal-title { font-size: 23px; }
  .ib-stat { padding: 8px 10px; }
  .ib-stat-value { font-size: 19px; }
}

/* ── Motion ───────────────────────────────────────────────────────────── */
@keyframes ib-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ib-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ib-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-bell, .inbox-bell.has-unread svg, .ib-item { animation: none; }
  .ib-panel, .ib-toast, .ib-modal, .ib-backdrop, .ib-dot, .ib-link .ib-icon { transition: none; }
  .ib-toast-progress { display: none; }
}
