/* ══════════════════════════════════════════════════════════════
   SHARED NOTIFICATIONS — infrastructure only
   Each template ships its own look by setting the --notif-* vars
   on body (typically in base.css). All positioning, animation,
   RTL, responsive, and stacking behaviour lives here.

   Emitted by /_shared/script/core.js → ShowNotifications(text).
   DOM the script emits:
     <div class="sa1">
       <div class="sa2 sa3">Your message</div>
     </div>
   ══════════════════════════════════════════════════════════════ */

.sa1 {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-start: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}

.sa2 {
  /* template-defined look (with sensible fallbacks) */
  background: var(--notif-bg, #1a1a1a);
  color: var(--notif-text, #fff);
  border: var(--notif-border-width, 0) solid var(--notif-border-color, transparent);
  border-inline-start: var(--notif-accent-bar, 0) solid var(--notif-accent-color, currentColor);
  border-radius: var(--notif-radius, 6px);
  box-shadow: var(--notif-shadow, 0 8px 24px rgba(0, 0, 0, 0.18));
  padding: var(--notif-padding, 12px 18px);
  font-family: var(--notif-font, inherit);
  font-size: var(--notif-font-size, 14px);
  font-weight: var(--notif-font-weight, 600);
  letter-spacing: var(--notif-letter-spacing, 0);
  text-transform: var(--notif-text-transform, none);
  line-height: 1.4;
  max-width: var(--notif-max-width, 360px);
  min-width: 200px;
  pointer-events: auto;
  word-wrap: break-word;
  transform: translateY(24px);
  opacity: 0;
  animation:
    sa-slide-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    sa-fade-out 0.5s cubic-bezier(0.4, 0, 1, 1) 3.3s forwards;
}

/* .sa3 used to carry the animation in the legacy default skin;
   kept here as a no-op passthrough so legacy-only markup still works. */

@keyframes sa-slide-in {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes sa-fade-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Mobile — edge-to-edge, tighter type */
@media (max-width: 640px) {
  .sa1 {
    inset-inline: 12px;
    inset-block-end: 12px;
    max-width: none;
  }
  .sa2 {
    max-width: none;
    min-width: 0;
    width: 100%;
    font-size: 13px;
    padding: var(--notif-padding-mobile, 10px 14px);
  }
}

/* Users who prefer reduced motion: snap in, snap out */
@media (prefers-reduced-motion: reduce) {
  .sa2 {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATIONS DROPDOWN — shared fallback styles
   Templates may override any of these in their own CSS. Classes
   are emitted by /app/functions/template_api.php (fetch_notifications)
   and /app/templates/_shared/script/notifications.js.
   ══════════════════════════════════════════════════════════════ */

/* Empty state (logged-out prompt OR no notifications yet) */
.sn13 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 20px;
  min-height: 240px;
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
  gap: 10px;
}
.sn14 {
  width: 48px;
  height: 48px;
  color: var(--color-999);
  margin-bottom: 4px;
}
.sn15 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-000);
  line-height: 1.35;
}
.sn16 {
  font-size: 13px;
  color: var(--color-555);
  line-height: 1.5;
}

/* Notification row (sn3..sn8) — only minimal fallbacks so rows render
   at all when a template hasn't overridden them in its own base.css. */
.sn3 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--color-000);
  border-bottom: 1px solid var(--color-eee);
  transition: background 0.1s;
}
.sn3:hover { background: var(--color-eee); }
.sn3:last-child { border-bottom: 0; }
.sn4 {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.sn5 { flex: 1; min-width: 0; }
.sn6 { font-size: 13px; line-height: 1.4; color: var(--color-000); }
.sn7 { font-size: 11px; color: var(--color-555); margin-top: 2px; }
.sn8 {
  width: 50px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Unread indicators */
.sn9 { position: relative; }
.sn11 {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  margin-inline-end: 4px;
  flex-shrink: 0;
}
.sn11.sn12,
.sn12 {
  background: #2196f3;
}

/* Loading + end-of-list messages (used by notifications.js) */
.notif-empty,
.sn19 {
  padding: 24px;
  text-align: center;
  color: var(--color-555);
  font-size: 13px;
}
