/* ===========================================
   NOTIFICATION STYLES
   Real-time notification dropdown
   =========================================== */

/* Dropdown Container */
.notification-dropdown {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.notification-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Header */
.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.notification-dropdown-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.mark-all-read-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.mark-all-read-btn:hover {
  background: var(--primary-color-light);
}

/* Notification List */
.notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

/* Notification Item */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.notification-item:hover {
  background: var(--bg-secondary);
}

.notification-item.unread {
  background: color-mix(in srgb, var(--primary-color) 5%, var(--bg-primary));
}

.notification-item.unread:hover {
  background: color-mix(in srgb, var(--primary-color) 10%, var(--bg-primary));
}

/* Notification Icon */
.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Notification Avatar */
.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: -52px;
  border: 2px solid var(--bg-primary);
  position: absolute;
  top: 24px;
  left: 44px;
}

/* Content */
.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

.notification-message strong {
  font-weight: 600;
}

.notification-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Unread Dot */
.notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Loading */
.notification-loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.notification-loading .loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
}

.notification-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.notification-empty p {
  margin: 0;
  font-size: 14px;
}

/* View All Link */
.notification-view-all {
  display: block;
  text-align: center;
  padding: 14px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.notification-view-all:hover {
  background: var(--bg-secondary);
}

/* Toast Notification */
.notification-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1100;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 350px;
}

.notification-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-toast .toast-icon {
  font-size: 20px;
}

.notification-toast .toast-message {
  font-size: 14px;
  color: var(--text-primary);
}

.notification-toast .toast-message strong {
  font-weight: 600;
}

/* Notification Badge (for header icon) */
.notification-badge,
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  animation: badge-bounce 0.3s ease;
}

@keyframes badge-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* =========================================== */
/* RESPONSIVE */
/* =========================================== */

@media (max-width: 480px) {
  .notification-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 80vh;
  }

  .notification-list {
    max-height: calc(80vh - 120px);
  }

  .notification-toast {
    bottom: 80px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* =========================================== */
/* NOTIFICATIONS PAGE STYLES */
/* =========================================== */

.notifications-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
}

.notifications-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

.notifications-page .notification-item {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

/* Filter Tabs */
.notification-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.notification-filter-btn {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.notification-filter-btn:hover {
  background: var(--bg-tertiary);
}

.notification-filter-btn.active {
  background: var(--primary-color);
  color: white;
}

/* Group Headers */
.notification-group {
  margin-bottom: 24px;
}

.notification-group-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 4px;
}
