/* Transform'IA Modern Cookie Banner - Design System Aligned */
body {font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin:0;}

/* Bannière principale - Design Transform'IA NON-BLOQUANTE */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(59, 130, 246, 0.1);
  padding: 1rem 1.5rem;
  display: none; /* CACHÉE PAR DÉFAUT - Ne bloque pas le chargement */
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

.cookie-banner .banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 2rem;
}

.cookie-banner p {
  margin: 0;
  color: rgb(55, 65, 81);
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
  flex-grow: 1;
}

.cookie-banner a {
  color: rgb(59, 130, 246);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.cookie-banner a:hover {
  color: rgb(37, 99, 235);
}

/* Boutons modernes Transform'IA */
.cookie-banner .buttons {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-banner .buttons button {
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.cookie-banner .buttons .btn-primary {
  background: linear-gradient(135deg, rgb(59, 130, 246) 0%, rgb(147, 51, 234) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.cookie-banner .buttons .btn-primary:hover {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(124, 58, 237) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.cookie-banner .buttons .btn-secondary {
  background: rgba(107, 114, 128, 0.1);
  color: rgb(75, 85, 99);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.cookie-banner .buttons .btn-secondary:hover {
  background: rgba(107, 114, 128, 0.15);
  border-color: rgba(107, 114, 128, 0.3);
  transform: translateY(-1px);
}

/* États de la bannière */
.cookie-banner.show {
  display: flex !important; /* Force l'affichage malgré display: none par défaut */
  animation: slideInUp 0.3s ease-out;
}

.cookie-banner.hide {
  display: none !important;
}

/* Animation d'entrée douce */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive mobile */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .cookie-banner .banner-content {
    flex-direction: column;
    gap: 1rem;
  }

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

  .cookie-banner .buttons button {
    flex: 1;
    padding: 0.75rem 1rem;
  }
}

/* Panneau de préférences - Design Transform'IA */
.cookie-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 90%;
  max-width: 600px;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: fadeInScale 0.3s ease-out;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.hidden {
  display: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: rgb(31, 41, 55);
}

.panel-header button {
  background: rgba(107, 114, 128, 0.1);
  border: none;
  border-radius: 0.5rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1rem;
  color: rgb(107, 114, 128);
  transition: all 0.2s ease;
}

.panel-header button:hover {
  background: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
  transform: scale(1.05);
}

/* Onglets modernes */
.tabs {
  display: flex;
  margin-bottom: 1.5rem;
  background: rgba(243, 244, 246, 0.7);
  border-radius: 0.75rem;
  padding: 0.25rem;
  gap: 0.25rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  cursor: pointer;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: rgb(107, 114, 128);
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab.active {
  background: linear-gradient(135deg, rgb(59, 130, 246) 0%, rgb(147, 51, 234) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transform: scale(1.02);
}

.tab:hover:not(.active) {
  background: rgba(107, 114, 128, 0.1);
  color: rgb(75, 85, 99);
}

/* Contenu des onglets */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

.tab-content p {
  color: rgb(75, 85, 99);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.tab-content h3 {
  color: rgb(31, 41, 55);
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.125rem;
}

.tab-content ul {
  color: rgb(75, 85, 99);
  line-height: 1.6;
  margin-left: 1rem;
}

.tab-content li {
  margin-bottom: 0.5rem;
}

/* Catégories de cookies */
.cookie-category {
  margin: 1.25rem 0;
  padding: 1rem;
  background: rgba(249, 250, 251, 0.8);
  border-radius: 0.75rem;
  border: 1px solid rgba(229, 231, 235, 0.8);
  transition: all 0.2s ease;
}

.cookie-category:hover {
  background: rgba(243, 244, 246, 0.8);
  border-color: rgba(209, 213, 219, 0.8);
}

.cookie-category label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: rgb(31, 41, 55);
}

.cookie-category p {
  margin: 0.5rem 0 0 3rem;
  font-size: 0.875rem;
  color: rgb(107, 114, 128);
  line-height: 1.5;
}

/* Toggle Switch moderne */
.slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgb(209, 213, 219);
  border-radius: 24px;
  margin-right: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider.disabled {
  background: rgb(156, 163, 175);
  cursor: not-allowed;
  opacity: 0.6;
}

.slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background: linear-gradient(135deg, rgb(34, 197, 94) 0%, rgb(16, 185, 129) 100%);
}

input:checked + .slider::before {
  transform: translateX(20px);
}

input:checked + .slider.disabled {
  background: linear-gradient(135deg, rgb(59, 130, 246) 0%, rgb(147, 51, 234) 100%);
}

/* Boutons d'actions */
.actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(229, 231, 235, 0.8);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.actions button {
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.actions .btn-primary {
  background: linear-gradient(135deg, rgb(59, 130, 246) 0%, rgb(147, 51, 234) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.actions .btn-primary:hover {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(124, 58, 237) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.actions .btn-secondary {
  background: rgba(107, 114, 128, 0.1);
  color: rgb(75, 85, 99);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.actions .btn-secondary:hover {
  background: rgba(107, 114, 128, 0.15);
  border-color: rgba(107, 114, 128, 0.3);
  transform: translateY(-1px);
}

/* Animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive mobile pour le panneau */
@media (max-width: 768px) {
  .cookie-panel {
    width: 95%;
    padding: 1.25rem;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    padding: 1rem;
  }

  .cookie-category p {
    margin-left: 2.5rem;
  }
}