/* Notification dropdown - LoveForm theme */
:root {
  /* Overlay-inspired glass (no pure white) */
  --notif-surface: rgba(10, 15, 20, 0.82);
  --notif-border: rgba(255, 255, 255, 0.12);
  --notif-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --notif-text: #e9f4f2;
  --notif-muted: #9eb3b6;
  --notif-hover: rgba(40, 154, 150, 0.14);
  --notif-accent: #289a96; /* LoveForm teal */
  --notif-badge: linear-gradient(135deg, #289a96, #43c4c1);
  --notif-card: rgba(8, 12, 18, 0.76); /* darker glass for cards */
}

.notification-dropdown {
  position: relative;
}

.notification-dropdown .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.notification-dropdown .nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--notif-badge);
  color: white;
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(255, 107, 107, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  /* Prevent flash on page load - hide until data confirms badge should show */
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* Enable transition after page loads */
body.page-loaded .notification-badge {
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Show badge when it has the show class */
.notification-badge.show {
  opacity: 1;
  visibility: visible;
}

.notification-dropdown-menu {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 220px !important;
  max-width: 240px !important;
  width: max-content !important;
  background: var(--notif-surface) !important;
  border: 1px solid var(--notif-border) !important;
  border-radius: 12px;
  box-shadow: var(--notif-shadow) !important;
  padding: 8px;
  backdrop-filter: blur(10px);
  color: var(--notif-text) !important;
  z-index: 12000;
}

.notification-dropdown-menu.show {
  display: block !important;
}

/* Scrollable notification list container */
.notification-list-container {
  max-height: 400px;
  overflow-y: auto;
  /* Hide scrollbar while maintaining scroll functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.notification-list-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.notification-dropdown-menu .dropdown-header {
  padding: 2px 4px 6px 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--notif-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.notification-dismiss-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-left: auto;
  opacity: 0.6;
  width: 22px;
  height: 22px;
}

.notification-dismiss-btn:hover {
  opacity: 1;
  color: rgba(255, 255, 255, 0.5);
}

.notification-dismiss-btn:active {
  transform: scale(0.95);
}

.notification-dropdown-menu .dropdown-header::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--notif-accent);
  box-shadow: 0 0 0 4px rgba(40, 154, 150, 0.15);
}

.notification-dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--notif-text) !important;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--notif-border) !important;
  background: var(--notif-card) !important; /* force dark glass, no white */
  width: calc(100% - 12px); /* widen card nearly full width */
  margin: 0 auto 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Notification content takes remaining space */
.notification-dropdown-menu .notification-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Action arrow indicator for actionable notifications */
.notification-action-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--notif-muted);
  flex-shrink: 0;
  margin-left: 8px;
  transition: color 0.2s ease, transform 0.2s ease;
  opacity: 0.6;
}

.notification-dropdown-menu .dropdown-item:hover .notification-action-arrow {
  color: var(--notif-accent);
  transform: translateX(2px);
  opacity: 1;
}

.notification-dropdown-menu .dropdown-item:hover {
  background: var(--notif-hover);
  border-color: rgba(40, 154, 150, 0.25);
}

/* Notification subject (title) - truncate to 1 line */
.notification-subject {
  display: block;
  margin-bottom: 3px;
  color: #f4fbfa;
  font-size: 13px;
  font-weight: 700;
  /* Single line truncation for titles */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legacy support */
.notification-content strong {
  display: block;
  margin-bottom: 3px;
  color: #f4fbfa;
  font-size: 13px;
  font-weight: 700;
}

/* Notification body wrapper */
.notification-body-wrapper {
  position: relative;
}

/* Notification body - collapsed by default (2 lines max) */
.notification-body {
  margin: 0;
  font-size: 12px;
  color: var(--notif-muted);
  line-height: 1.4;
  /* Use -webkit-line-clamp for 2-line truncation */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.4em * 2); /* 2 lines at 1.4 line-height */
}

/* Expanded state - show full text */
.notification-body.expanded {
  display: block;
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}

/* Legacy .notification-content p selector for backward compatibility */
.notification-content p {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: var(--notif-muted);
  line-height: 1.4;
}

/* Expand/collapse button for long notifications */
.notification-expand-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 4px 0 6px 0;
  font-size: 11px;
  color: var(--notif-accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease;
  display: block;
}

.notification-expand-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.notification-content small {
  display: block;
  font-size: 10px;
  color: var(--notif-accent);
  font-weight: 600;
}

/* Notification time styling */
.notification-time {
  display: block;
  font-size: 10px;
  color: var(--notif-accent);
  font-weight: 600;
}

/* Divider links (Rewards, Legal, FAQ, Logout) */
.notification-dropdown-menu .dropdown-divider {
  margin: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ensure bell icon size and alignment */
.notification-dropdown .ai-nav-bell-icon {
  width: 28px !important;
  height: 28px !important;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* General dropdown helpers (moved from inline styles) */
.navbar .dropdown-menu.profile-dropdown-menu {
  display: none;
}

.navbar .dropdown-menu.profile-dropdown-menu.show {
  display: block !important;
  z-index: 12000;
}

.dropdown-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 11999;
  pointer-events: none;
}

/* BUG-180 FIX: Show backdrop with LoveForm-style 25% opacity when .show class is added */
.dropdown-backdrop.show {
  background: rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

/* BUG-179 FIX: K12 hero search backdrop must be BELOW hero-nav (z-index: 1000)
   so search bar X buttons remain clickable. The generic .dropdown-backdrop uses
   z-index: 11999 for notification dropdowns, but K12 needs z-index: 999. */
#locationDropdownBackdrop {
  z-index: 999;
}

#navbarDropdown.dropdown-toggle {
  cursor: pointer;
  border-radius: 8px;
}

#navbarDropdown.dropdown-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(40, 154, 150, .25);
}

/* Hamburger menu notification dot (LoveForm-style) */
.hamburger-notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, #43c4c1, #289a96);
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 6px rgba(40, 154, 150, 0.5);
  pointer-events: none;
  animation: hamburger-dot-pulse 2s ease-in-out infinite;
}

@keyframes hamburger-dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.9;
  }
}
