/* ===========================================
   Notifiche Unificate - Dropdown Navbar
   =========================================== */

/* Container dropdown */
.notifications-dropdown {
  min-width: 340px;
  max-width: 400px;
  max-height: 450px;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 8px;
}

/* Header dropdown */
.notifications-dropdown .dropdown-header {
  background: linear-gradient(135deg, #0B5E70 0%, #0d7a94 100%);
  color: white;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 8px 8px 0 0;
}

.notifications-dropdown .dropdown-header .btn-link {
  color: white !important;
  opacity: 0.8;
}

.notifications-dropdown .dropdown-header .btn-link:hover {
  opacity: 1;
}

/* Singola notifica */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

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

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

/* Icona notifica */
.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f0f0f0;
}

/* Colori icona per tipo */
.notification-icon.scadenza { background: #fff3cd; }
.notification-icon.email { background: #cce5ff; }
.notification-icon.fattura_scaduta { background: #f8d7da; }
.notification-icon.fattura_da_incassare { background: #d4edda; }
.notification-icon.achievement { background: #fff3cd; }
.notification-icon.config_warning { background: #f8d7da; }

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

.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-subtitle {
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-time {
  font-size: 0.7rem;
  color: #999;
  margin-top: 3px;
}

/* Priorità urgente */
.notification-item.priority-2 {
  background-color: #fff5f5;
  border-left: 3px solid #dc3545;
}

.notification-item.priority-2:hover {
  background-color: #ffe5e5;
}

/* Priorità importante */
.notification-item.priority-1 {
  border-left: 3px solid #ffc107;
}

/* Stato vuoto */
.notifications-empty {
  text-align: center;
  padding: 30px 20px;
  color: #999;
}

.notifications-empty i {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* Animazione refresh */
.notifications-refresh-spin {
  animation: spin 1s linear infinite;
}

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

/* Badge pulsante (animazione attenzione) */
@keyframes badge-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

#notifications-badge.has-urgent {
  animation: badge-pulse 1.5s ease-in-out infinite;
  background-color: #dc3545 !important;
}

/* Responsive */
@media (max-width: 576px) {
  .notifications-dropdown {
    min-width: 280px;
    max-width: calc(100vw - 20px);
    right: 10px !important;
    left: auto !important;
  }
}
