/* ═══════════════════════════════════════════════════════════════════════════
   Notification Bell, Dropdown & Toast Styles
   ═══════════════════════════════════════════════════════════════════════════ */

.notif-container {
  position: relative;
}

/* Bell button */
#notif-bell {
  position: relative;
}

#notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* Dropdown */
#notif-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-primary, #1a1d24);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.4));
  z-index: 1050;
  margin-top: 0.5rem;
}

#notif-dropdown.show {
  display: block;
}

/* Dropdown header */
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  font-weight: 600;
  font-size: 0.95rem;
}

#notif-mark-all {
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

#notif-mark-all:hover {
  background: rgba(102, 126, 234, 0.15);
}

/* Notification items */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
  transition: background 0.15s;
}

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

.notif-item-exit {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notif-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.notif-unread {
  background: rgba(102, 126, 234, 0.08);
}

.notif-icon {
  flex-shrink: 0;
  width: 28px;
  padding-top: 2px;
  font-size: 1.1rem;
}

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

.notif-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.notif-message {
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted, #6b7280);
  margin-top: 0.25rem;
}

.notif-read-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.15s;
  align-self: center;
}

.notif-read-btn:hover {
  background: rgba(102, 126, 234, 0.2);
}

.notif-read .notif-title {
  font-weight: 400;
  color: var(--text-muted, #9ca3af);
}

/* Empty state */
#notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.85rem;
}

/* ── Toast notifications ──────────────────────────────────── */

.notif-toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.notif-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-primary, #1a1d24);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-left: 4px solid #667eea;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.4));
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: notif-slide-in 0.3s ease;
}

.notif-toast-exit {
  animation: notif-slide-out 0.3s ease forwards;
}

.notif-toast-icon {
  font-size: 1.1rem;
  padding-top: 2px;
}

.notif-toast-body {
  flex: 1;
}

.notif-toast-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.notif-toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary, #9ca3af);
}

.notif-toast-close {
  background: none;
  border: none;
  color: var(--text-muted, #6b7280);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
}

.notif-toast-close:hover {
  color: var(--text-primary, #f8f9fa);
}

@keyframes notif-slide-in {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes notif-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ── Light theme ──────────────────────────────────────────── */

[data-theme="light"] #notif-dropdown {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.125);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .notif-unread {
  background: rgba(102, 126, 234, 0.06);
}

[data-theme="light"] .notif-item:hover {
  background: rgba(102, 126, 234, 0.04);
}

[data-theme="light"] .notif-toast {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.125);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
  #notif-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
  }
}
