/* ══════════════════════════════════════════════════════════════════
   GELATOMAPS — NOTIFICATIONS CSS v1.0
   Campana de notificaciones en el header + dropdown panel.

   Scope: .notif-bell (icono + badge) y .notif-dropdown (panel).
   Consistente con streaks.css en estilo y variables.

   Autor: Dpto 06 UX & Diseno — GelatoMaps
   Fecha: 05 Abr 2026
   ══════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   BELL ICON (wrapper)
   ────────────────────────────────────────────────────────────── */

.notif-bell {
  display: none;                    /* JS lo muestra cuando hay usuario autenticado */
  position: relative;
  cursor: pointer;
  user-select: none;
  min-height: 36px;
  min-width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: var(--sp-xs, 6px);
  transition: background var(--transition, .2s ease), transform .15s ease;
}

.notif-bell:hover {
  background: rgba(0,0,0,.06);
  transform: scale(1.08);
}

.notif-bell:focus-visible {
  outline: 2px solid var(--color-primary, #e85d75);
  outline-offset: 2px;
}

/* Bell SVG icon */
.notif-bell-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--color-text, #333);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ──────────────────────────────────────────────────────────────
   BADGE (counter)
   ────────────────────────────────────────────────────────────── */

.notif-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: var(--color-primary, #e85d75);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-body, system-ui);
  line-height: 17px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid var(--color-bg-header, #fff);
  pointer-events: none;
  transform: scale(0);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}

.notif-badge.has-notif {
  transform: scale(1);
}

/* ──────────────────────────────────────────────────────────────
   BELL RING ANIMATION (when new notification arrives)
   ────────────────────────────────────────────────────────────── */

@keyframes bellRing {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(14deg); }
  30%  { transform: rotate(-14deg); }
  45%  { transform: rotate(8deg); }
  60%  { transform: rotate(-8deg); }
  75%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

.notif-bell.ringing .notif-bell-icon {
  animation: bellRing .6s ease-in-out;
}

/* ──────────────────────────────────────────────────────────────
   DROPDOWN PANEL
   ────────────────────────────────────────────────────────────── */

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: -40px;
  width: 340px;
  max-height: 420px;
  background: var(--color-white, #fff);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 8px 30px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
  z-index: 9999;
  overflow: hidden;
  font-family: var(--font-body, system-ui);
}

.notif-dropdown.open {
  display: flex;
  flex-direction: column;
  animation: notifSlideIn .2s ease-out;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header del dropdown ── */

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.notif-dropdown-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text, #333);
}

.notif-mark-all {
  font-size: 12px;
  color: var(--color-primary, #e85d75);
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  transition: background .15s;
}

.notif-mark-all:hover {
  background: rgba(232,93,117,.08);
}

/* ── Lista de notificaciones ── */

.notif-list {
  overflow-y: auto;
  max-height: 340px;
  -webkit-overflow-scrolling: touch;
}

.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 4px; }

/* ── Item individual ── */

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .12s;
  border-bottom: 1px solid rgba(0,0,0,.04);
  position: relative;
}

.notif-item:hover {
  background: rgba(0,0,0,.025);
}

.notif-item.unread {
  background: rgba(232,93,117,.04);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary, #e85d75);
}

.notif-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(232,93,117,.1);
}

.notif-item-body {
  flex: 1;
  min-width: 0;
}

.notif-item-text {
  font-size: 13px;
  color: var(--color-text, #333);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: 11px;
  color: var(--color-text-muted, #999);
  margin-top: 3px;
}

/* ── Estado vacio ── */

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted, #999);
  font-size: 13px;
}

.notif-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: .5;
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE — movil
   ────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .notif-dropdown {
    width: calc(100vw - 24px);
    right: -60px;
    max-height: 360px;
  }
}
