/* ═══════════════════════════════════════════════════════════
   notifications.css — shared styles for notification bell
   and modal. Used by ratings.html and viewer.html.
   ═══════════════════════════════════════════════════════════ */

/* Контейнер не перехватывает клики; сами toast — с pointer-events: auto */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 32px));
}

/* ── Bell button ─────────────────────────────────────────── */
#bell-btn {
  position: relative; background: none; border: none; cursor: pointer;
  padding: 4px 6px; border-radius: 8px; color: #777;
  font-size: 1.05rem; line-height: 1; transition: color .15s;
  flex-shrink: 0;
}
#bell-btn:hover { color: #e0e0e0; }
#bell-badge {
  position: absolute; top: -2px; right: -3px;
  background: #e53935; color: #fff; font-size: .6rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; pointer-events: none;
  box-shadow: 0 0 0 2px #09090f;
}

/* ── Modal backdrop ──────────────────────────────────────── */
#modal-notifications {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1030; padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
#modal-notifications.open { opacity: 1; pointer-events: all; }

/* ── Notification box ────────────────────────────────────── */
.notif-box {
  background: rgba(15,15,26,.97);
  border: 1px solid rgba(124,92,191,.22);
  border-radius: 20px;
  width: 100%; max-width: 420px;
  max-height: 86vh; display: flex; flex-direction: column;
  transform: scale(.9) translateY(12px); opacity: 0;
  transition: transform .28s cubic-bezier(.34,1.3,.64,1), opacity .2s;
  box-shadow: 0 24px 64px rgba(0,0,0,.75);
}
#modal-notifications.open .notif-box {
  transform: scale(1) translateY(0); opacity: 1;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.notif-list,
#notif-list {
  flex: 1;
  min-height: 0;
  max-height: min(60vh, 400px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.notif-list::-webkit-scrollbar,
#notif-list::-webkit-scrollbar {
  width: 6px;
}
.notif-list::-webkit-scrollbar-track,
#notif-list::-webkit-scrollbar-track {
  background: transparent;
}
.notif-list::-webkit-scrollbar-thumb,
#notif-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.notif-list::-webkit-scrollbar-thumb:hover,
#notif-list::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ── Notification item ───────────────────────────────────── */
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  flex-shrink: 0;
  padding: 11px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.02);
  position: relative; overflow: hidden;
  transition: background .13s,
              transform .28s cubic-bezier(.4,0,.2,1),
              opacity .28s ease,
              max-height .3s ease,
              margin-bottom .3s ease,
              padding .3s ease;
  will-change: transform;
}
.notif-item:hover { background: rgba(255,255,255,.05); }
.notif-item.unread {
  background: rgba(124,92,191,.10);
  border-color: rgba(124,92,191,.25);
}
.notif-item.unread:hover { background: rgba(124,92,191,.16); }
.notif-item.notif-item--arena-cta {
  cursor: pointer;
  border-color: rgba(212,175,55,.22);
}
.notif-item.notif-item--arena-cta:hover {
  border-color: rgba(212,175,55,.4);
  background: rgba(212,175,55,.06);
}

/* Slide-out then collapse animation */
.notif-item.removing {
  transform: translateX(-110%) !important;
  opacity: 0; pointer-events: none;
}
.notif-item.collapsing {
  max-height: 0 !important; margin-bottom: 0 !important;
  padding-top: 0 !important; padding-bottom: 0 !important;
  border-width: 0; overflow: hidden;
}

/* ── Item internals ──────────────────────────────────────── */
.notif-icon    { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title   { font-size: .82rem; font-weight: 700; color: #e0e0e0; margin-bottom: 2px; }
.notif-msg     { font-size: .76rem; color: #888; line-height: 1.45; }
.notif-time    { font-size: .68rem; color: #555; margin-top: 3px; }
.notif-empty   {
  flex-shrink: 0;
  text-align: center; padding: 32px 0; color: #555; font-size: .85rem;
}

/* Delete button — visible on hover */
.notif-delete-btn {
  position: absolute; top: 7px; right: 8px;
  background: none; border: none; color: #444;
  font-size: .8rem; cursor: pointer;
  padding: 3px 6px; border-radius: 6px; line-height: 1;
  opacity: 0; transition: opacity .15s, color .15s;
}
.notif-item:hover .notif-delete-btn { opacity: 1; }
.notif-delete-btn:hover { color: #ef5350; }

/* ── Controls ────────────────────────────────────────────── */
.notif-read-all {
  background: transparent; border: 1px solid rgba(255,255,255,.12);
  color: #888; font-size: .78rem; font-weight: 600;
  border-radius: 8px; padding: 6px 14px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.notif-read-all:hover { border-color: rgba(255,255,255,.28); color: #ccc; }
.notif-close {
  background: none; border: none; color: #555; font-size: 1.3rem;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
  line-height: 1; transition: color .15s;
}
.notif-close:hover { color: #e0e0e0; }

/* ── Toast stack (arena win / shared) ────────────────────── */
#toast-container .toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 12px; font-size: .86rem; font-weight: 600;
  color: #f4f4f5; box-shadow: 0 12px 40px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.08);
  animation: notif-toast-in .25s cubic-bezier(.34,1.56,.64,1) both;
}
#toast-container .toast.success {
  background: rgba(27,94,32,.94);
  border-color: rgba(76,175,80,.35);
}
#toast-container .toast.arena-win-toast { cursor: pointer; }
#toast-container .toast.arena-win-toast:hover { filter: brightness(1.06); }
@keyframes notif-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
