/**
 * Notification System Styles
 * For ValRetailTemplate application
 */

/* Notification Icon and Badge */
/* ensure the anchor that wraps the bell icon is the positioning context */
.navbar .nav-link,
.nav-link {
  /* put the icon & badge into one clickable inline-flex container */
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.nav-link .feather-sm[data-feather="bell"] {
  color: #fff;
  /* icon itself no longer needs to be relative, but keep it in case
     other rules depend on it */
  position: relative;
}

/* Badge now sits inline, immediately to the right of the bell icon */
.notification-count {
  position: relative;          /* keep z-index working */
  display: inline-flex;        /* align contents centrally */
  margin-left: 6px;            /* space between bell & badge */
  background-color: #f62d51;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* slightly slimmer default padding; will expand via .large class when needed */
  padding: 0 4px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  /* ensure it stays on top of other elements */
  z-index: 5;
  /* pill-shape instead of full circle so 2–3 digits fit nicely */
  border-radius: 12px;
}

/* hide badge element when it has no text/number */
.notification-count:empty {
  display: none;
}

/* Extra space for large numbers (e.g., 99+) */
.notification-count.large {
  min-width: 26px;       /* allow 3+ chars without squashing */
  padding: 0 6px;        /* more horizontal breathing room   */
/* Hover/active feedback for bell icon */
.nav-link:hover .feather-sm[data-feather="bell"],
.nav-link:focus .feather-sm[data-feather="bell"] {
  color: #ffcc00; /* highlight bell on hover */
}
.nav-link:hover .notification-count,
.nav-link:focus .notification-count {
  transform: scale(1.05);
}

/* Notification Dropdown */
.notification-dropdown {
  width: 320px;
  max-width: 100%;
  padding: 0;
  border-radius: 4px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  border: none;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

.notification-header {
  padding: 12px 15px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  font-weight: 600;
  color: #3e5569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header .mark-all-read {
  font-size: 12px;
  color: #2962FF;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.notification-header .mark-all-read:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Notification Items */
.notification-item {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.notification-item:hover {
  background-color: #f8f9fa;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-title {
  font-weight: 500;
  color: #3e5569;
  margin-bottom: 3px;
  padding-right: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-meta {
  font-size: 12px;
  color: #6c757d;
  display: flex;
  align-items: center;
}

/* Unread vs Read Styling */
.notification-item.unread {
  background-color: rgba(41, 98, 255, 0.05);
}

.notification-item.unread .notification-title {
  font-weight: 600;
  color: #2962FF;
}

.notification-item.unread:hover {
  background-color: rgba(41, 98, 255, 0.1);
}

/* Empty Notification State */
.empty-notification {
  text-align: center;
  color: #6c757d;
  padding: 20px;
}

/* Notification Actions */
.notification-actions {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.notification-item:hover .notification-actions {
  opacity: 1;
}

.notification-actions button {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.2s ease;
}

.notification-actions .btn-mark-read:hover {
  color: #2962FF;
  background-color: rgba(41, 98, 255, 0.1);
}

.notification-actions .btn-delete:hover {
  color: #f62d51;
  background-color: rgba(246, 45, 81, 0.1);
}

/* Notification Footer */
.notification-footer {
  padding: 10px 15px;
  text-align: center;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.notification-footer a {
  color: #2962FF;
  text-decoration: none;
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/*  Indication Create/Edit pages – raise bell above high-z overlays   */
/*  (those pages inject toast & modal layers up to z-index: 11000).   */
/*  This small override keeps the bell fully clickable.               */
/* ------------------------------------------------------------------ */
/*.navbar .nav-link[data-bs-toggle="dropdown"] {*/
  /* add a bit of space for the badge so it isn't clipped */
  /*padding-right: 0.75rem;
  z-index: 11050 !important;*/   /* higher than toast container (11000) */
  /*pointer-events: auto;*/        /* ensure clicks are accepted          */
/*}*/

.notification-footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 576px) {
  .notification-dropdown {
    width: 280px;
    left: auto !important;
    right: 0 !important;
    position: fixed !important;
    top: 60px !important;
    transform: none !important;
  }
  
  .notification-actions {
    opacity: 1;
  }
  
  .notification-title {
    font-size: 14px;
    padding-right: 50px;
  }
  
  .notification-meta {
    font-size: 11px;
  }
  
  .notification-actions button {
    padding: 3px;
  }
}

/* Animation for new notifications */
@keyframes notification-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.notification-count.has-new {
  animation: notification-pulse 1s ease-in-out;
}
