/* ========================================
   SYSTÈME DE NOTIFICATIONS TOAST
   Thème sombre discret - NvsDevs
   ======================================== */

/* Conteneur des notifications */
.notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse; /* Les nouvelles apparaissent en bas */
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: auto;
}

/* Notification - Style discret et moderne */
.notification {
  background: rgba(26, 36, 37, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 8px;
  border: 1px solid rgba(240, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(240, 255, 255, 0.05);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: auto;
  opacity: 0;
  transform: translateY(15px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  cursor: default;
  position: relative;
  overflow: hidden;
}

/* Animation d'entrée */
.notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Icône de la notification */
.notification-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Message */
.notification-message {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  color: #f0ffff;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Bouton de fermeture */
.notification-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: rgba(240, 255, 255, 0.5);
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.notification-close:hover {
  background: rgba(240, 255, 255, 0.1);
  color: rgba(240, 255, 255, 0.9);
}

.notification-close:active {
  background: rgba(240, 255, 255, 0.15);
}

/* ========================================
   TYPES DE NOTIFICATIONS
   ======================================== */

/* Success */
.notification-success {
  border-left: 3px solid #22c55e;
}

.notification-success .notification-icon {
  color: #22c55e;
}

.notification-success::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.08) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* Error */
.notification-error {
  border-left: 3px solid #ef4444;
}

.notification-error .notification-icon {
  color: #ef4444;
}

.notification-error::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(239, 68, 68, 0.08) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* Warning */
.notification-warning {
  border-left: 3px solid #e8b377;
}

.notification-warning .notification-icon {
  color: #e8b377;
}

.notification-warning::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(232, 179, 119, 0.08) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* Info */
.notification-info {
  border-left: 3px solid #e8b377;
}

.notification-info .notification-icon {
  color: #e8b377;
}

.notification-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 100%
  );
  pointer-events: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .notification-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }

  .notification {
    padding: 10px 12px;
    font-size: 12px;
  }

  .notification-message {
    font-size: 12px;
  }

  .notification-icon {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }

  .notification-close {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .notification-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .notification {
    padding: 9px 11px;
    border-radius: 7px;
  }
}

/* ========================================
   ANIMATIONS AVANCÉES
   ======================================== */

/* Animation de progression (barre de temps) */
.notification::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.15;
  width: 100%;
  animation: progress linear forwards;
  transform-origin: left;
}

/* Animation différente selon le type */
.notification-success::after {
  background: #22c55e;
}

.notification-error::after {
  background: #ef4444;
}

.notification-warning::after {
  background: #e8b377;
}

.notification-info::after {
  background: #e8b377;
}

@keyframes progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Désactiver la barre de progression pour certaines durées */
.notification[data-duration="0"]::after {
  display: none;
}

/* Effet de slide out */
.notification:not(.show) {
  opacity: 0;
  transform: translateY(15px) scale(0.96);
}

/* Accessibilité */
.notification:focus-within {
  outline: 2px solid #e8b377;
  outline-offset: 2px;
}

/* Réduire les animations pour les utilisateurs qui les préfèrent réduites */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity 0.2s ease;
    transform: none !important;
  }

  .notification::after {
    animation: none;
  }
}

/* Effet hover désactivé pour éviter les interactions inutiles */
/* .notification:hover { ... } */

/* ========================================
   BANNIÈRE DE CONSENTEMENT COOKIES RGPD
   ======================================== */

/* Bannière principale */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 36, 37, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f0ffff;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(232, 179, 119, 0.3);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-banner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.cookie-banner-icon {
  width: 48px;
  height: 48px;
  background: #e8b377;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a2425;
  min-width: 48px;
}

.cookie-banner-text .cookie-banner-heading {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #f0ffff;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 14px;
  color: rgba(240, 255, 255, 0.85);
  line-height: 1.5;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-width: 120px;
}

.cookie-btn-accept {
  background: #e8b377;
  color: #1a2425;
  border-color: #e8b377;
}

.cookie-btn-accept:hover {
  background: #d9a367;
  border-color: #d9a367;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 179, 119, 0.3);
}

.cookie-btn-reject {
  background: transparent;
  color: #f0ffff;
  border-color: rgba(240, 255, 255, 0.3);
}

.cookie-btn-reject:hover {
  background: rgba(240, 255, 255, 0.08);
  border-color: rgba(240, 255, 255, 0.5);
}

.cookie-btn-customize {
  background: transparent;
  color: #e8b377;
  border-color: rgba(232, 179, 119, 0.4);
}

.cookie-btn-customize:hover {
  background: rgba(232, 179, 119, 0.1);
  border-color: #e8b377;
}

/* Modal de gestion des cookies */
.cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cookie-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal {
  background: #1a2425;
  border: 1px solid rgba(240, 255, 255, 0.15);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.cookie-modal-overlay.show .cookie-modal {
  transform: scale(1);
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(240, 255, 255, 0.1);
}

.cookie-modal-header .cookie-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #f0ffff;
}

.cookie-modal-close {
  background: none;
  border: none;
  color: rgba(240, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 24px;
  line-height: 1;
}

.cookie-modal-close:hover {
  color: #f0ffff;
  background: rgba(240, 255, 255, 0.1);
}

.cookie-modal-content {
  padding: 16px 24px 24px;
}

.cookie-description {
  margin-bottom: 24px;
}

.cookie-description p {
  margin: 0;
  font-size: 14px;
  color: rgba(240, 255, 255, 0.7);
  line-height: 1.6;
}

.cookie-categories {
  margin-bottom: 24px;
}

.cookie-category {
  margin-bottom: 16px;
  border: 1px solid rgba(240, 255, 255, 0.1);
  border-radius: 8px;
  padding: 18px;
  background: rgba(240, 255, 255, 0.02);
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.cookie-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-category-info {
  flex: 1;
}

.cookie-category-info .cookie-category-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #f0ffff;
}

.cookie-category-info p {
  margin: 0;
  font-size: 13px;
  color: rgba(240, 255, 255, 0.6);
  line-height: 1.5;
}

.cookie-toggle {
  display: flex;
  align-items: center;
}

.cookie-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.cookie-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none; /* Le label gérera les clics */
}

.cookie-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(240, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 28px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: rgba(240, 255, 255, 0.7);
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

input:checked + .cookie-switch .cookie-slider {
  background-color: #e8b377;
}

input:checked + .cookie-switch .cookie-slider:before {
  transform: translateX(20px);
  background-color: #1a2425;
}

input:disabled + .cookie-switch .cookie-slider {
  background-color: #e8b377;
  opacity: 0.6;
  cursor: not-allowed;
}

input:disabled + .cookie-switch {
  cursor: not-allowed;
}

.cookie-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.cookie-btn-save {
  background: #e8b377;
  color: #1a2425;
  border-color: #e8b377;
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
}

.cookie-btn-save:hover {
  background: #d9a367;
  border-color: #d9a367;
  box-shadow: 0 4px 12px rgba(232, 179, 119, 0.3);
}

.cookie-policy-link {
  color: #e8b377;
  text-decoration: none;
  font-size: 14px;
  text-align: center;
  transition: color 0.3s ease;
}

.cookie-policy-link:hover {
  color: #d9a367;
  text-decoration: underline;
}

/* Responsive pour la bannière cookies */
@media (max-width: 768px) {
  .cookie-banner-container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .cookie-banner-content {
    text-align: center;
    flex-direction: column;
    gap: 12px;
  }

  .cookie-banner-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  .cookie-banner-text .cookie-banner-heading {
    font-size: 16px;
  }

  .cookie-banner-text p {
    font-size: 13px;
  }

  .cookie-banner-actions {
    justify-content: center;
    width: 100%;
  }

  .cookie-btn {
    min-width: 100px;
    font-size: 13px;
    padding: 8px 16px;
  }

  .cookie-modal {
    width: 95%;
    max-height: 90vh;
    margin: 20px;
  }

  .cookie-modal-header {
    padding: 20px 20px 16px;
  }

  .cookie-modal-header .cookie-modal-title {
    font-size: 18px;
  }

  .cookie-modal-content {
    padding: 16px 20px 20px;
  }

  .cookie-category {
    padding: 14px;
  }

  .cookie-category-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .cookie-toggle {
    align-self: flex-end;
  }

  /* Notifications en mobile - remonter pour ne pas chevaucher la bannière cookies */
  .cookie-banner.show ~ .notification-container,
  .cookie-banner.show ~ * .notification-container {
    bottom: calc(
      100px + 16px
    ); /* Hauteur approximative de la bannière + marge */
  }
}

/* ========================================
   BOUTON DE GESTION DES COOKIES (FOOTER)
   ======================================== */

.cookie-settings-btn {
  background: none !important;
  border: none !important;
  color: inherit !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: color 0.3s ease;
  font-size: inherit;
  font-family: inherit;
  padding: 0 !important;
}

.cookie-settings-btn:hover {
  color: #e8b377 !important;
  text-decoration: underline !important;
}
