/* Notification Bell and Dropdown Styles */

/* Notification Bell */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.notification-bell:hover {
  color: rgba(255, 255, 255, 1);
}

.notification-bell.active {
  color: rgba(255, 255, 255, 1);
}

/* Notification Badge */
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #dc3545;
  color: white;
  border-radius: 10px;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Notification Dropdown */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 380px;
  max-height: 500px;
  background-color: white;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.175);
  z-index: 10000;
  display: none;
  overflow: hidden;
}

.notification-dropdown.show {
  display: block;
}

/* Dropdown Header */
.notification-header {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #495057;
}

.notification-header .mark-all-read {
  font-size: 0.75rem;
  color: #0d6efd;
  text-decoration: none;
  cursor: pointer;
}

.notification-header .mark-all-read:hover {
  text-decoration: underline;
}

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

.notification-list::-webkit-scrollbar {
  width: 6px;
}

.notification-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.notification-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Notification Item */
.notification-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e9ecef;
  background-color: #fff;
  cursor: pointer;
  transition: background-color 0.15s;
}

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

.notification-item:hover {
  background-color: #f8f9fa;
}

.notification-item.read {
  opacity: 0.7;
}

.notification-item.read .notification-title {
  font-weight: normal;
}

/* Notification Icon */
.notification-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Notification Content */
.notification-content {
  min-width: 0; /* Allow text truncation */
}

.notification-title {
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
  color: #212529;
}

.notification-message {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #6c757d;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 0.75rem;
  color: #adb5bd;
}

.notification-action {
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Badge in Notification */
.notification-item .badge-sm {
  font-size: 0.65rem;
  padding: 0.2em 0.4em;
}

/* Empty State */
.notification-list .text-center {
  padding: 2rem 1rem;
}

.notification-list .bi-bell-slash {
  opacity: 0.3;
}

/* Dropdown Footer */
.notification-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #e9ecef;
  background-color: #f8f9fa;
  text-align: center;
}

.notification-footer a {
  font-size: 0.8125rem;
  color: #0d6efd;
  text-decoration: none;
}

.notification-footer a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 576px) {
  .notification-dropdown {
    width: 100vw;
    max-width: 100vw;
    right: -1rem;
    left: auto;
    border-radius: 0;
  }
}

/* Ensure notification bell and badge position correctly when not in collapsed navbar */
@media (max-width: 991px) {
  .notification-bell {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .notification-dropdown {
    /* Adjust positioning for mobile when bell is outside collapsed section */
    position: fixed;
    right: 0;
    top: 56px; /* Height of navbar */
    width: 100vw;
    max-width: 380px;
    border-radius: 0;
  }
}

/* Animation */
@keyframes notificationPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.notification-bell.has-new {
  animation: notificationPulse 0.5s ease-in-out;
}

/* Priority Colors */
.notification-item[data-priority="urgent"] {
  border-left: 3px solid #dc3545;
}

.notification-item[data-priority="high"] {
  border-left: 3px solid #fd7e14;
}

.notification-item[data-priority="normal"] {
  border-left: 3px solid #0d6efd;
}

.notification-item[data-priority="low"] {
  border-left: 3px solid #6c757d;
}
