/* ── Bell — sits below the poll button, same right-edge stacking as
   animations -> polls -> notifications ────────────────────────────── */




#notif-wrapper {
  position: fixed;  /* viewport-relative — top is set dynamically in JS to
                        track the countdown widget's real measured
                        position, since it and the countdown don't share
                        the same positioned ancestor */
  right: 14px;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}



#notif-bell-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

#notif-bell-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.notif-bell-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.notif-bell-badge.visible { display: flex; }

/* Tingling animation — plays continuously while any unread notification exists */
@keyframes notifBellRing {
  0%, 100% { transform: rotate(0deg); }
  10%      { transform: rotate(14deg); }
  20%      { transform: rotate(-12deg); }
  30%      { transform: rotate(10deg); }
  40%      { transform: rotate(-8deg); }
  50%      { transform: rotate(4deg); }
  60%      { transform: rotate(0deg); }
}

.notif-bell-ring svg {
  animation: notifBellRing 2.2s ease-in-out infinite;
  transform-origin: top center;
}

body.circuit-panel-open #notif-wrapper {
  display: none;
}




@media (max-width: 480px) {
  #notif-wrapper {
    right: 10px;
  }
  #notif-bell-btn {
    width: 26px;
    height: 26px;
  }
  #notif-bell-btn svg {
    width: 15px;
    height: 15px;
  }
}





/* ── Slide-in panel from the right edge ──────────────────────────────── */

#notif-panel {
  position: fixed;
  top: 70px;
  right: 14px;
  width: min(300px, calc(100vw - 24px));
  max-height: calc(100vh - 140px);
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 6500;
  display: flex;
  flex-direction: column;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
  pointer-events: none;
}


#notif-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}



#notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 10px 0;
  flex-shrink: 0;
}




#notif-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.95rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

#notif-panel-close:hover {
  background: var(--bg-pill-hover);
  color: var(--text-primary);
}

#notif-panel-list {
  overflow-y: auto;
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}



.notif-strip {
  padding: 6px 4px;
}

.notif-strip-message {
  font-size: 0.76rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5);
}

.notif-strip-date {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

body.light-theme .notif-strip-message {
  color: #111122;
  text-shadow: 0 1px 4px rgba(255,255,255,0.9), 0 0 10px rgba(255,255,255,0.6);
}

body.light-theme .notif-strip-date {
  color: rgba(0,0,0,0.6);
  text-shadow: 0 1px 4px rgba(255,255,255,0.9);
}





/* ── Media carousel — one or more images/videos per notification ────────── */
.notif-media-carousel {
  position: relative;
  width: 100%;
  max-height: 60vh;   /* cap so a very tall portrait image can't blow out the panel */
  border-radius: 10px;
  overflow: hidden;
  margin: 6px 0;
  background: rgba(0,0,0,0.15);
}

.notif-media-track {
  display: flex;
  align-items: center;   /* centers slides shorter than the tallest one */
  transition: transform 0.25s ease;
}

.notif-media-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-media-frame {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;   /* shows the WHOLE image/video, letterboxed rather than cropped */
  display: block;
  border: none;
}


.notif-media-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-media-prev { left: 6px; }
.notif-media-next { right: 6px; }

.notif-media-arrow:hover { background: rgba(0,0,0,0.7); }

/* Clear "more than one" indicator, per spec */
.notif-media-counter {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}