/* ============================================
   SYSTÈME DE NOTIFICATIONS - VERSION SIMPLE
   Basé sur le CSS original qui fonctionnait
   ============================================ */

/* Conteneur de notification dans la navbar */
.notification-container {
  position: relative;
  display: inline-block;
}

/* Icône de notification */
.notification-icon {
  position: relative;
  cursor: pointer;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  line-height: 1;
  height: 100%;
}

.notification-icon:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Badge de notification - VERSION BADASS */
.notification-badge {
  position: absolute !important;
  top: 8px !important;
  right: 12px !important;
  background: linear-gradient(135deg, #ff4444, #cc0000) !important;
  color: white !important;
  border-radius: 20px !important;
  padding: 2px 7px !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  min-width: 22px !important;
  width: auto !important;
  height: 16px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #ffffff !important;
  font-family: Arial, sans-serif !important;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.8),
              0 0 20px rgba(255, 68, 68, 0.6),
              0 0 30px rgba(255, 68, 68, 0.4);
  animation: badgePulse 1.5s ease-in-out infinite, badgeBlink 2s linear infinite;
  z-index: 10 !important;
  line-height: 1 !important;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.8),
                0 0 20px rgba(255, 68, 68, 0.6),
                0 0 30px rgba(255, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 68, 68, 1),
                0 0 30px rgba(255, 68, 68, 0.8),
                0 0 45px rgba(255, 68, 68, 0.6);
  }
}

@keyframes badgeBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes badgeShake {
  0%, 100% { transform: translateX(0) scale(1); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-3px) scale(1.15); }
  20%, 40%, 60%, 80% { transform: translateX(3px) scale(1.15); }
}

.message-badge {
  position: absolute !important;
  top: 8px !important;
  right: 5px !important;
  background: linear-gradient(135deg, #ff4444, #cc0000) !important;
  color: white !important;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  min-width: 20px !important;
  width: 20px !important;
  height: 20px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #ffffff !important;
  font-family: Arial, sans-serif !important;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.8),
              0 0 20px rgba(255, 68, 68, 0.6),
              0 0 30px rgba(255, 68, 68, 0.4);
  animation: badgePulse 1.5s ease-in-out infinite, badgeBlink 2s linear infinite !important;
  z-index: 10 !important;
  line-height: 1 !important;
}

.notification-badge.new-notification {
  animation: badgeShake 0.6s ease-in-out, badgePulse 1.5s ease-in-out infinite, badgeBlink 2s linear infinite;
}

/* Menu déroulant */
.notification-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  min-width: 400px;
  max-width: 500px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.notification-dropdown.active {
  display: block !important;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* En-tête */
.notification-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  font-weight: bold;
  color: #333;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Item de notification */
.notification-item {
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.2s ease;
  background-color: #e3f2fd;
}

/* NOTIFICATION LUE - MODE JOUR */
.notification-item.read {
  background-color: #ffffff !important;
}

.notification-item.read .notification-text {
  color: #333 !important;
}

.notification-item.read .notification-pseudo {
  color: #667eea !important;
}

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

.notification-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

/* Avatar */
.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notification-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  flex-shrink: 0;
}

/* Contenu */
.notification-content {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-text {
  color: #333;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.notification-pseudo {
  font-weight: bold;
  color: #667eea;
}

.notification-time {
  color: #999;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Actions */
.notification-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.notification-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.notification-btn-accept {
  background-color: #4CAF50;
  color: white;
}

.notification-btn-accept:hover {
  background-color: #43a047;
}

.notification-btn-reject {
  background-color: #f44336;
  color: white;
}

.notification-btn-reject:hover {
  background-color: #d32f2f;
}

/* NOUVEAUX BOUTONS LU */
.notification-mark-read-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  flex-shrink: 0;
  margin-left: 8px;
  transition: all 0.2s ease;
}

.notification-mark-read-btn:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.notification-mark-all-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
  transition: all 0.2s ease;
}

.notification-mark-all-btn:hover {
  background: linear-gradient(135deg, #38a169, #2f855a);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

/* Message quand il n'y a pas de notifications - VISIBLE */
.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* MODE NUIT */
[data-theme="dark"] .notification-dropdown,
html[data-theme="dark"] .notification-dropdown {
  background-color: #1a1a1a !important;
  border: 1px solid #333 !important;
}

[data-theme="dark"] .notification-header,
html[data-theme="dark"] .notification-header {
  background-color: #252525 !important;
  color: #ffffff !important;
  border-bottom: 1px solid #333 !important;
}

[data-theme="dark"] .notification-item,
html[data-theme="dark"] .notification-item {
  background-color: #2a2a3e !important;
  border-bottom: 1px solid #333 !important;
}

[data-theme="dark"] .notification-item.read,
html[data-theme="dark"] .notification-item.read {
  background-color: #16161f !important;
}

[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .notification-item:hover {
  background-color: #343447 !important;
}

[data-theme="dark"] .notification-text,
html[data-theme="dark"] .notification-text {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .notification-item.read .notification-text,
html[data-theme="dark"] .notification-item.read .notification-text {
  color: #999 !important;
}

[data-theme="dark"] .notification-pseudo,
html[data-theme="dark"] .notification-pseudo {
  color: #8ab4f8 !important;
}

[data-theme="dark"] .notification-time,
html[data-theme="dark"] .notification-time {
  color: #999 !important;
}

/* Responsive */
@media (max-width: 768px) {
  .notification-dropdown {
    min-width: 280px;
    right: -20px;
  }
  
  .notification-badge {
    top: 8px;
    right: 12px;
  }
}
