/* ====================================================================
   Оверлей уведомлений и историй (Glassmorphic Notification Modal)
   ==================================================================== */

#notifi-overlay,
#notifi-overlay * {
  box-sizing: border-box;
}

/* ---- Полноэкранный фон (Backdrop) ---- */
#notifi-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw;
  height: 100vh;
  margin: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 15, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1), 
              background-color 0.32s cubic-bezier(0.4, 0, 0.2, 1), 
              backdrop-filter 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 24px;
  overflow-y: auto;
}

#notifi-overlay.active {
  opacity: 1;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* ---- Карточка уведомления (Notification Box) ---- */
.notifi-box {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(18, 20, 29, 0.72);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.36s ease;
  margin: auto;
}

#notifi-overlay.active .notifi-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ---- Кнопка закрытия ---- */
.notifi-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.notifi-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(79, 234, 159, 0.4);
  color: #4fea9f;
  transform: scale(1.08) rotate(90deg);
}

/* ---- Медиа-контейнер (Изображение / Видео) ---- */
.notifi-media {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notifi-media img,
.notifi-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  animation: notifiMediaIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes notifiMediaIn {
  from { opacity: 0; transform: scale(1.05); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Прогресс-бар историй ---- */
.notifi-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  gap: 6px;
}

.notifi-progress__item {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.notifi-progress__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  transform-origin: left center;
}

.notifi-progress__fill.filled {
  width: 100%;
  transition: none;
}

/* ---- Основное содержимое ---- */
.notifi-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 30px 30px;
  text-align: center;
}

.notifi-title {
  font-size: 25px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  animation: notifiTextIn 0.4s ease;
}

/* Анимированный градиент заглавия */
.notifi-title.notifi-title--animated {
  background-size: 200% auto;
  background-image: linear-gradient(90deg, #4fea9f, #38bdf8, #c084fc, #ffd15f, #4fea9f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: notifiTextIn 0.4s ease, notifiGradientShift 4s linear infinite;
}

@keyframes notifiGradientShift {
  to { background-position: 200% center; }
}

.notifi-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: #aeb6d2;
  font-weight: 600;
  margin-bottom: 22px;
  animation: notifiTextIn 0.5s ease;
  word-break: break-word;
}

@keyframes notifiTextIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Кнопки действий ---- */
.notifi-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.notifi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 13.5px;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}

.notifi-btn:hover {
  transform: translateY(-2px);
}

.notifi-btn--primary {
  color: #08150f;
  background: linear-gradient(135deg, #4fea9f 0%, #22b877 100%);
  box-shadow: 0 6px 20px rgba(79, 234, 159, 0.35);
}

.notifi-btn--primary:hover {
  color: #08150f;
  box-shadow: 0 8px 25px rgba(79, 234, 159, 0.5);
}

.notifi-btn--ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.notifi-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(79, 234, 159, 0.35);
  color: #4fea9f;
}

/* ---- Точки пагинации (Dots) ---- */
.notifi-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.notifi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.notifi-dot:hover {
  background: rgba(255, 255, 255, 0.4);
}

.notifi-dot.active {
  background: #4fea9f;
  transform: scale(1.35);
  box-shadow: 0 0 10px rgba(79, 234, 159, 0.6);
}

/* ---- Стрелки навигации ---- */
.notifi-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  height: 48px;
  width: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: all 0.2s ease;
}

.notifi-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(79, 234, 159, 0.4);
  color: #4fea9f;
  transform: scale(1.08);
}

.notifi-nav--prev { left: 12px; }
.notifi-nav--next { right: 12px; }

/* ---- Мобильная адаптивность ---- */
@media (max-width: 640px) {
  #notifi-overlay {
    padding: 12px;
  }
  
  .notifi-box {
    border-radius: 18px;
  }

  .notifi-body { 
    padding: 20px 18px 24px; 
  }
  
  .notifi-title { 
    font-size: 20px; 
  }
  
  .notifi-nav { 
    width: 40px; 
    height: 40px; 
    font-size: 18px; 
  }
  
  .notifi-media { 
    max-height: 36vh; 
  }
}