/* ==========================================================================
NOTIFICATIONS.CSS — колокольчик уведомлений в шапке (см. notifications.js).
========================================================================== */

.notif-widget {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), border-color 0.2s ease, transform 0.15s ease;
}

.notif-bell svg {
  width: 19px;
  height: 19px;
  transform-origin: 50% 15%;
}

.notif-bell:hover {
  border-color: color-mix(in srgb, var(--color-primary) 55%, var(--color-border));
  background: var(--color-primary-light);
}

.notif-bell:hover svg {
  animation: bellSwing 0.7s ease;
}

@keyframes bellSwing {
  20% { transform: rotate(14deg); }
  45% { transform: rotate(-10deg); }
  70% { transform: rotate(5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .notif-bell:hover svg {
    animation: none;
  }
}

.notif-bell:active {
  transform: scale(0.92);
}

.notif-bell__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e14d4d;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  animation: notifBadgePop 0.25s ease;
}

@keyframes notifBadgePop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.notif-dropdown[hidden] {
  display: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 420px;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  z-index: 500;
  overflow: hidden;
  animation: notifDropdownIn 0.18s ease;
}

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

.notif-dropdown__head {
  padding: 14px 16px;
  font-weight: 800;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.notif-dropdown__list {
  overflow-y: auto;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13.5px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--color-bg-alt);
}

.notif-item.is-unread {
  background: var(--color-primary-light);
}

.notif-item__icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.notif-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notif-item__title {
  font-size: 13.5px;
  font-weight: 700;
}

.notif-item__text {
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.notif-item__time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

@media (max-width: 480px) {
  .notif-dropdown {
    right: -60px;
  }
}
