/*
  Styles principaux pour Feed Builder
  - Mise en page minimaliste, moderne
  - Grille 3 colonnes, vignettes carrées (les images couvrent la cellule)
  - Support d'un ratio 4:5 par recadrage visuel
*/

:root {
  /* Thème clair, proche Instagram */
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb; /* bleu moderne */
  --accent-2: #ef4444; /* rouge pour états */
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-strong: rgba(0, 0, 0, 0.2);
  --overlay: rgba(255, 255, 255, 0.95);
  --overlay-backdrop: rgba(0, 0, 0, 0.5);
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --panel: #1a1a1a;
  --text: #e5e5e5;
  --muted: #a3a3a3;
  --border: #2a2a2a;
  --accent: #3b82f6;
  --accent-2: #f87171;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-strong: rgba(0, 0, 0, 0.5);
  --overlay: rgba(26, 26, 26, 0.95);
  --overlay-backdrop: rgba(0, 0, 0, 0.7);
}

* { 
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Transitions fluides pour le changement de thème */
.header,
.container,
.footer,
.grid-item,
.lightbox,
.story-viewer,
#desktop-sticky-toolbar,
#mobile-toolbar,
.user-bar,
.logout-btn {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.header { 
  padding: 32px 20px 12px; 
  text-align: center; 
  position: relative;
}

/* Barre utilisateur en haut à droite */
.user-bar {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.user-name {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.logout-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Dark mode toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.theme-toggle-btn {
  appearance: none;
  width: 50px;
  height: 26px;
  background: var(--border);
  border: none;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0;
}

.theme-toggle-btn:hover {
  background: var(--muted);
}

.theme-toggle-btn::before {
  content: '☀️';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 4px var(--shadow);
}

[data-theme="dark"] .theme-toggle-btn::before {
  content: '🌙';
  transform: translateX(24px);
}

[data-theme="dark"] .theme-toggle-btn {
  background: var(--accent);
}

/* Contenu du header centré */
.header-content {
  max-width: 800px;
  margin: 0 auto;
}

.title { margin: 0; font-size: 28px; font-weight: 600; }
.subtitle { margin: 8px 0 0; color: var(--muted); }

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.controls { display: grid; grid-template-columns: 1fr; gap: 12px; }
.controls-row { display: flex; gap: 12px; align-items: center; }

/* ============================================
   DESKTOP STICKY TOOLBAR (≥768px uniquement)
   ============================================ */

/* Toolbar desktop sticky : masquée par défaut */
#desktop-sticky-toolbar {
  display: none;
}

/* Desktop uniquement : toolbar fixe en haut après scroll */
@media (min-width: 768px) {
  #desktop-sticky-toolbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    padding: 12px 20px;
    gap: 12px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
    -webkit-transform: translateY(-100%);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  }
  
  #desktop-sticky-toolbar[hidden] {
    display: none !important;
  }
  
  #desktop-sticky-toolbar.is-visible {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
  
  #desktop-sticky-toolbar .btn {
    white-space: nowrap;
  }
}

.toggle { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: #d1d5db; background: #fafafa; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.btn.active:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* Dark mode - Inverser les couleurs des boutons au survol */
[data-theme="dark"] .btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
[data-theme="dark"] .btn:active {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .btn.active:hover {
  background: #60a5fa;
  border-color: #60a5fa;
}
[data-theme="dark"] .btn.active:active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.dropzone {
  border: 1.5px dashed #d1d5db;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: #fafafa;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
  cursor: pointer;  /* Indique que c'est cliquable */
}
.dropzone:hover {
  border-color: var(--accent);
  background: #f5f7ff;
  color: var(--text);
  transform: translateY(-1px);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: #eef2ff;
  color: #1e3a8a;
}
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dark mode - Inverser les couleurs de la dropzone */
[data-theme="dark"] .dropzone {
  background: #1a1a1a;
  border-color: #404040;
}
[data-theme="dark"] .dropzone:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
[data-theme="dark"] .dropzone.dragover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; /* maintient l'élément accessible */
}

/* Grille 3 colonnes responsive */
.grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* Cellule 3:4, image couvre la cellule */
.grid-item {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4; /* Ratio moderne et précis */
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
  /* Optimisation : pas de transition par défaut pour éviter les lags */
  transition: none;
}

/* Transitions uniquement en mode sélection */
.selectable .grid-item {
  transition: transform 0.2s ease, outline 0.2s ease;
}

.grid-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* couvre la cellule comme Instagram */
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateZ(0);  /* Force GPU rendering */
  backface-visibility: hidden;  /* Optimisation anti-aliasing */
}

/* SortableJS feedback classes - Style "joli" restauré */
.is-drag-chosen { 
  outline: 2px solid var(--accent); 
  outline-offset: 2px; 
  transform: scale(1.02);
  z-index: 1000;
  will-change: transform;  /* Optimisation GPU pour le scale */
}

/* Optimisation mobile : effets réduits sur petits écrans */
@media (max-width: 768px) {
  .is-drag-chosen {
    transform: scale(1.01);  /* Scale réduit sur mobile */
    outline-width: 1px;  /* Outline plus fin */
  }
  
  .is-drag-ghost {
    box-shadow: 0 2px 8px rgba(0,0,0,.12);  /* Shadow encore plus légère */
    opacity: 0.9;  /* Plus opaque = moins de calculs de blend */
  }
}

/* Ghost/clone pendant le drag (SortableJS) - Ratio 3:4 verrouillé */
.sortable-fallback,        /* clone porté par le curseur quand forceFallback = true */
.is-drag-ghost {           /* classe ghostClass sur l'élément "placeholder" */
  aspect-ratio: 3 / 4;
  width: var(--drag-w, 220px);
  height: calc(var(--drag-w, 220px) * 4 / 3);
  /* joli feedback optionnel */
  box-shadow: 0 4px 12px rgba(0,0,0,.15);  /* Shadow allégée pour mobile */
  transform: translateZ(0);
  opacity: 0.85;  /* Légèrement moins transparent pour meilleure visibilité */
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid var(--border);
  will-change: transform, opacity;  /* Optimisation GPU */
  pointer-events: none;  /* Évite les interactions inutiles */
}

/* Assurer que le ghost garde le même style que les cellules */
.sortable-fallback img,
.is-drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translateZ(0);  /* Force GPU rendering pour les images */
  backface-visibility: hidden;  /* Optimisation anti-aliasing */
}

/* Legacy drag handles and state (pour compatibilité) */
.grid-item[data-dragging="true"] { opacity: 0.85; outline: 2px dashed var(--accent); outline-offset: -2px; }
.grid-item.placeholder { border: 1.5px dashed var(--accent); background: #eef2ff; }
.grid-item.hover-target { 
  outline: 3px solid #10b981; 
  outline-offset: -3px; 
  box-shadow: 0 0 0 1px white, 0 0 0 4px #10b981;
  animation: pulse-green 1.5s ease-in-out;
}
@keyframes pulse-green {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Indicateur de carrousel (icône pile) */
.carousel-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(17,24,39,0.72);
  color: white;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}

/* Sélection */
.selectable .grid-item { cursor: pointer; }
.grid-item.selected { 
  outline: 3px solid var(--accent); 
  outline-offset: -3px; 
  box-shadow: 0 0 0 1px white, 0 0 0 4px var(--accent);
  transform: scale(0.98);
  transition: all 0.2s ease;
}

/* Rubber band selection */
.rubber-band {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.1);
  pointer-events: none;
  z-index: 10;
}

/* Footer */
.footer { text-align: center; color: var(--muted); padding: 18px 20px 36px; }

/* Footer mobile : plus de marge */
@media (max-width: 768px) {
  .footer {
    padding: 18px 30px 36px;  /* Plus de marge sur les côtés */
  }
}

/* Main Footer */
.main-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 40px 20px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.footer-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-section p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section li {
  margin-bottom: 8px;
}

.footer-section a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.social-links a:hover {
  transform: scale(1.2);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.footer-bottom p {
  margin: 4px 0;
}

/* Grille toujours en 3 colonnes sur tous les écrans */

/* Lightbox viewer */
.lightbox { 
  position: fixed; 
  inset: 0; 
  display: none; 
  z-index: 1000;
}
.lightbox[aria-hidden="false"] { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.lightbox-backdrop { 
  position: absolute; 
  inset: 0; 
  background: rgba(0,0,0,0.8); 
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.lightbox-content { 
  position: relative; 
  width: 100%; 
  height: 100%; 
  display: flex; 
  flex-direction: column;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
}

/* Barre d'actions flottante */
.lightbox-toolbar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1001;
  flex-wrap: nowrap;  /* Une seule ligne par défaut (Desktop + iPad) */
  justify-content: center;
  align-items: center;
  max-width: calc(100vw - 40px);
}

.lightbox-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;  /* Empêche les boutons de rétrécir */
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
}
.lightbox-btn:hover { 
  background: var(--accent); 
  color: white; 
  border-color: var(--accent);
  transform: translateY(-1px);
}
.lightbox-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dark mode - boutons lightbox restent clairs */
[data-theme="dark"] .lightbox-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  border-color: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .lightbox-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}


/* Zone d'image */
.lightbox-image-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 60px 80px;
  min-height: 0;
  overflow: hidden;
}

.lightbox-image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: 85%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1002;
  opacity: 90%;
}
.lightbox-nav:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-50%) scale(1.1);
}
.lightbox-nav.prev { left: 5px; }
.lightbox-nav.next { right: 5px; }

/* Miniatures */
.lightbox-thumbs {
  display: flex;
  gap: 8px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  max-height: 100px;
  flex-shrink: 0;
  overscroll-behavior: contain;  /* Empêche le scroll de se propager */
  -webkit-overflow-scrolling: touch;  /* Scroll fluide sur iOS */
}
.lightbox-thumbs.hidden { display: none; }

.lightbox-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  transform-origin: center;
}

.lightbox-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.lightbox-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.lightbox-thumb.placeholder {
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.1);
  overflow: visible;
  animation: lightbox-placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes lightbox-placeholder-pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.02);
  }
}

.lightbox-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
  transform: scale(1.02);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lightbox-thumb:hover img {
  transform: scale(1.1);
}

/* Drag and drop des miniatures avec SortableJS */
.lightbox-thumb {
  cursor: grab;
}

.lightbox-thumb:active {
  cursor: grabbing;
}

.lightbox-thumb.placeholder {
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.1);
  overflow: visible;
  animation: lightbox-placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes lightbox-placeholder-pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.02);
  }
}


/* Responsive Tablette */
@media (max-width: 1024px) {
  .lightbox-image-container {
    padding: 100px 40px 80px;
  }
}

/* Responsive Mobile - iPhone uniquement */
@media (max-width: 480px) {
  .lightbox-toolbar {
    top: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    flex-wrap: wrap;  /* 2 lignes sur iPhone */
    padding: 8px;
    gap: 6px;
    max-width: none;
  }
  .lightbox-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* iPad et tablettes - garde une ligne */
@media (min-width: 481px) and (max-width: 768px) {
  .lightbox-toolbar {
    top: 10px;
    padding: 8px 12px;
    gap: 5px;
  }
  .lightbox-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .lightbox-image-container {
    padding: 120px 10px 60px;
  }
  .lightbox-thumbs {
    padding: 8px;
    max-height: 80px;
  }
  .lightbox-thumb {
    width: 48px;
    height: 48px;
  }
  .lightbox-thumb.placeholder {
    width: 48px;
    height: 48px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .lightbox-toolbar {
    top: 40px;
    left: 20px;
    right: 20px;
    padding: 6px;
    gap: 4px;
  }
  .lightbox-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .lightbox-image-container {
    padding: 110px 5px 50px;
  }
}

/* Blocage du scroll */
body.lightbox-open {
  overflow: hidden;
  position: fixed;  /* Empêche le scroll sur mobile */
  width: 100%;
  left: 0;
  right: 0;
  /* top est défini dynamiquement en JS pour conserver la position */
}

/* ============================================
   HIGHLIGHTS (Stories à la une)
   ============================================ */
.highlights-container {
  margin-top: 20px;
  padding: 0 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.highlights-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Masquer la scrollbar tout en gardant le scroll fonctionnel */
.highlights-scroll::-webkit-scrollbar {
  height: 4px;
}
.highlights-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.highlights-scroll::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}
.highlights-scroll::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Bulle de story */
.hl-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer; /* Changé de grab à pointer car pas de drag & drop */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 2px;
  outline: none; /* Supprimer le cadre noir par défaut */
}

.hl-item:focus {
  outline: none; /* Supprimer le cadre noir au focus */
}

.hl-item.add-story {
  cursor: pointer; /* Le bouton "+" garde le curseur pointer */
}

.hl-item:hover {
  transform: scale(1.05);
  z-index: 1;
}

.hl-item:active {
  transform: scale(0.95);
}

.hl-bubble {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--accent);
  padding: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hl-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.hl-bubble-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--bg);
  transition: all 0.3s ease;
}

.hl-bubble-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.hl-item:hover .hl-bubble-inner img {
  transform: scale(1.1);
}

/* Bulle "+" pour créer une nouvelle story */
.hl-bubble.add-story {
  background: transparent;
  border: 2px dashed #d1d5db;
  padding: 0;
}
.hl-bubble.add-story .hl-bubble-inner {
  border: none;
  font-size: 32px;
  color: var(--muted);
  font-weight: 300;
}

.hl-item.add-story:hover .hl-bubble {
  border-color: var(--accent);
}
.hl-item.add-story:hover .hl-bubble-inner {
  color: var(--accent);
}

.hl-title {
  font-size: 12px;
  color: var(--text);
  max-width: 72px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drag & drop de bulles */
.hl-item[data-dragging="true"] {
  opacity: 0.3;
  transform: scale(0.9);
  z-index: 1000;
  transition: all 0.2s ease;
}

.hl-item.placeholder {
  width: 72px;
  height: 72px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  animation: highlight-placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes highlight-placeholder-pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ============================================
   STORY VIEWER
   ============================================ */
.story-viewer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}
.story-viewer[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.story-content {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow: hidden;
}

/* Barre d'actions story */
.story-toolbar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 2001;
  flex-wrap: nowrap;  /* Desktop et Tablette : toujours sur une ligne */
  justify-content: center;
  max-width: calc(100vw - 40px);
}

.story-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.story-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.story-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dark mode - boutons story restent clairs */
[data-theme="dark"] .story-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #111827;
  border-color: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .story-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Zone d'image story - format vertical non croppé */
.story-image-container {
  position: relative;
  flex: 1;  /* Prend tout l'espace disponible entre toolbar et thumbs */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 40px 20px;  /* Padding pour la toolbar absolute en haut */
  min-height: 0;  /* Important pour flex */
  overflow: hidden;
}

.story-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-image-wrapper img {
  max-width: 90%;       /* Garantit 5% d'espace de chaque côté */
  max-height: 90%;      /* S'adapte à la hauteur du conteneur flex */
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Navigation story */
.story-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 2002;
}
.story-nav:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-50%) scale(1.1);
}
.story-nav.prev { left: 20px; }
.story-nav.next { right: 20px; }

/* Miniatures story */
.story-thumbs {
  display: flex;
  gap: 8px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  height: 100px;  /* Hauteur fixe pour que flex calcule correctement l'espace */
  flex-shrink: 0;  /* Ne rétrécit jamais */
}
.story-thumbs.hidden { display: none; }

/* Drag & drop des thumbnails dans le viewer */
.story-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  transform-origin: center;
}

.story-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.story-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.story-thumb.placeholder {
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.1);
  overflow: visible;
  animation: placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes placeholder-pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.02);
  }
}

.story-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
  transform: scale(1.02);
}

.story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-thumb:hover img {
  transform: scale(1.1);
}

/* Drag and drop des miniatures de story avec SortableJS */
.story-thumb {
  cursor: grab;
}

.story-thumb:active {
  cursor: grabbing;
}

.story-thumb.placeholder {
  border: 2px dashed var(--accent);
  background: rgba(37, 99, 235, 0.1);
  overflow: visible;
  animation: placeholder-pulse 1.5s ease-in-out infinite;
}

@keyframes placeholder-pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Placeholder visuel pour le viewer vide */
.story-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  text-align: center;
  padding: 40px;
  border-radius: 12px;
  max-width: 400px;
  margin: auto;
  cursor: pointer;
  transition: all 0.2s ease;
}
.story-empty-placeholder:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 1);
  transform: scale(1.02);
}
.story-empty-placeholder svg {
  width: 64px;
  height: 64px;
  opacity: 0.5;
}

/* Responsive Tablette */
@media (max-width: 1024px) {
  .story-image-container {
    padding: 90px 30px 15px;  /* Padding ajusté pour tablette */
  }
  .story-image-wrapper img {
    max-width: 88%;      /* Tablette : padding un peu plus grand */
    max-height: 88%;     /* S'adapte au conteneur flex */
  }
  .hl-bubble {
    width: 64px;
    height: 64px;
  }
  .hl-title {
    font-size: 11px;
    max-width: 64px;
  }
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .header {
    padding: 24px 10px 12px;
  }
  
  .user-bar {
    top: 16px;
    right: 10px;
    flex-direction: column-reverse;  /* Nom en dessous du bouton */
    align-items: flex-end;  /* Aligné à droite */
    gap: 6px;
  }
  
  .theme-toggle {
    top: 16px;
    left: 10px;
  }
  
  .user-name {
    font-size: 11px;
  }
  
  .logout-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  
  .highlights-container {
    padding: 0 10px;
  }
  
  .story-toolbar {
    top: 12px;  /* Padding entre le haut de la page et la toolbar */
    left: 10px;
    right: 10px;
    transform: none;
    /* Tablette : garde nowrap (une ligne) */
    padding: 8px;
    gap: 6px;
    max-width: none;
  }
  .story-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .story-image-container {
    padding: 60px 10px 5px;  /* Réduit l'espace entre toolbar et image */
  }
  .story-image-wrapper img {
    max-width: 85%;      /* Mobile : un peu moins d'espace mais toujours du padding */
    max-height: 85%;     /* S'adapte au conteneur flex */
  }
  .story-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
    opacity: 90%;
  }
  .story-nav.prev { left: 5px; }
  .story-nav.next { right: 5px; }
  .story-thumbs {
    padding: 8px;
    height: 80px;  /* Hauteur fixe sur mobile */
    margin-bottom: 45px;  /* Espace entre les thumbs et le bord bas */
  }
  .story-thumb {
    width: 64px;
    height: 64px;
  }
  .hl-bubble {
    width: 60px;
    height: 60px;
  }
  .hl-title {
    font-size: 10px;
    max-width: 60px;
  }
}

/* Très petits écrans (téléphones) */
@media (max-width: 480px) {
  .story-toolbar {
    top: 45px;
    left: 30px;
    right: 30px;
    padding: 6px;
    gap: 8px;
    flex-wrap: wrap;
    max-height: 80px;
  }
  .story-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .story-image-container {
    padding: 60px 5px 5px;
  }
  .story-image-wrapper img {
    max-width: 82%;      /* Petits téléphones : encore plus de padding visible */
    max-height: 82%;     /* S'adapte au conteneur flex */
  }
  .hl-bubble {
    width: 56px;
    height: 56px;
  }
  .header-content {
    margin-top: 20px;  /* Espace en haut sur iPhone */
  }
}

/* Blocage du scroll quand le story viewer est ouvert */
body.story-viewer-open {
  overflow: hidden;
}

/* Modal de sélection de story */
.story-selector-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.story-selector-modal.active {
  display: flex;
}

.story-selector-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.story-selector-content {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: calc(100vw - 40px);
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 3001;
}

.story-selector-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.story-selector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-selector-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.story-selector-item:hover {
  background: #f9fafb;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.story-selector-item-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-selector-item-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-selector-item-info {
  flex: 1;
}
.story-selector-item-title {
  font-weight: 500;
  color: var(--text);
}
.story-selector-item-count {
  font-size: 12px;
  color: var(--muted);
}

.story-selector-new {
  border: 2px dashed var(--border);
  background: #fafafa;
}
.story-selector-new:hover {
  border-color: var(--accent);
  background: #eef2ff;
}
.story-selector-new .story-selector-item-bubble {
  background: transparent;
  font-size: 24px;
}

@media (max-width: 768px) {
  .story-selector-content {
    max-height: 60vh;
    padding: 16px;
  }
  .story-selector-title {
    font-size: 16px;
  }
}

/* ============================================
   MOBILE TOOLBAR (≤767px uniquement)
   ============================================ */

/* Témoin invisible pour déclencher l'affichage de la toolbar */
#mobile-toolbar-trigger {
  height: 0;
  width: 100%;
  pointer-events: none;
  visibility: hidden;
}

/* Sur mobile, le témoin a une hauteur pour créer un espace de déclenchement */
@media (max-width: 767px) {
  #mobile-toolbar-trigger {
    height: 0px;  /* Ajustez cette valeur pour contrôler quand la toolbar apparaît */
  }
}

/* Desktop: masquer complètement la toolbar mobile */
@media (min-width: 768px) {
  #mobile-toolbar { 
    display: none !important; 
  }
  #mobile-toolbar-trigger {
    display: none !important;
  }
}

/* Mobile: toolbar fixe en bas, apparaît après scroll */
@media (max-width: 767px) {
  .mobile-toolbar[hidden] { 
    display: none; 
  }
  
  .mobile-toolbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    gap: 8px;
    justify-content: space-around;
    align-items: center;
    padding: 10px calc(12px + env(safe-area-inset-right))
            calc(10px + env(safe-area-inset-bottom))
            calc(12px + env(safe-area-inset-left));
    background: var(--bg);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px var(--shadow);
    transform: translateY(100%);
    transition: transform 0.25s ease;
  }
  
  .mobile-toolbar.is-visible {
    transform: translateY(0);
  }
  
  .mobile-toolbar .btn {
    flex: 1;
    padding: 10px 6px;
    font-size: 12px;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .mobile-toolbar .btn.is-active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  
  /* Dark mode - utiliser les mêmes styles que la toolbar desktop */
  [data-theme="dark"] .mobile-toolbar .btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
  }
  
  [data-theme="dark"] .mobile-toolbar .btn:active {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border);
  }
  
  [data-theme="dark"] .mobile-toolbar .btn.is-active:hover {
    background: #60a5fa;
    border-color: #60a5fa;
  }
  
  [data-theme="dark"] .mobile-toolbar .btn.is-active:active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  
  /* Éviter que la toolbar masque la fin du feed */
  main,
  .page-content,
  #feed-grid {
    padding-bottom: 96px;
  }
}

/* ============================================
   MODAL CONSENTEMENT RGPD
   ============================================ */
.gdpr-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.gdpr-modal[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.gdpr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.gdpr-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.gdpr-modal-content h2 {
  margin: 0 0 16px;
  font-size: 24px;
  color: var(--text);
}

.gdpr-modal-content p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.gdpr-consent-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 24px 0;
}

.gdpr-consent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.gdpr-consent-item:hover {
  background: var(--border);
}

.gdpr-consent-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.gdpr-consent-item span {
  color: var(--text);
  line-height: 1.5;
}

.gdpr-privacy-link {
  margin: 20px 0;
  text-align: center;
}

.gdpr-privacy-link a {
  color: var(--accent);
  text-decoration: underline;
}

.gdpr-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.gdpr-modal-actions .btn {
  flex: 1;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 600;
  padding: 12px 24px;
  font-size: 16px;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
  font-size: 16px;
  padding: 12px 24px;
}

.btn-secondary:hover {
  background: var(--border);
}

/* ============================================
   MODAL PARAMÈTRES COMPTE
   ============================================ */
.account-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.account-modal[aria-hidden="true"] {
  display: none;
}

.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.account-modal-content {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.account-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}

.account-modal-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
}

.account-modal-close {
  appearance: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.account-modal-close:hover {
  color: var(--text);
}

.account-settings-content {
  padding: 0;
}

.account-actions-top {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.account-settings-section {
  padding: 32px;
  border-bottom: 1px solid var(--border);
}

.account-settings-section:last-child {
  border-bottom: none;
}

.account-settings-section h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}

.account-settings-section > p {
  margin: 0 0 24px;
  color: var(--muted);
}

/* ============================================
   ACCORDÉON DES PARAMÈTRES
   ============================================ */
.settings-accordion {
  display: flex;
  flex-direction: column;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

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

.accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: var(--panel);
}

.accordion-header:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.accordion-header span:first-child {
  flex: 1;
}

.accordion-icon {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.3s ease;
  margin-left: 12px;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(0deg);
}

.accordion-header[aria-expanded="false"] .accordion-icon {
  transform: rotate(-90deg);
}

.accordion-content {
  display: none;
  padding: 0 32px 24px 32px;
  animation: slideDown 0.3s ease;
}

.accordion-content[style*="display: block"] {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
  }
}

/* Formulaire modification compte */
.account-edit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.account-edit-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-edit-form .form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.account-edit-form .form-input {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  width: 100%;
}

.account-edit-form .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Wrapper pour les champs de mot de passe avec bouton œil */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-input {
  padding-right: 45px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  color: var(--muted);
  transition: color 0.2s ease;
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.toggle-password:hover {
  color: var(--text);
}

.toggle-password:active {
  transform: translateY(-50%) scale(0.95);
}

.form-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* ============================================
   CONSENTEMENTS RGPD DANS PARAMÈTRES
   ============================================ */
.consent-settings {
  margin-top: 16px;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.consent-item:hover {
  background: var(--panel);
}

.consent-item input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.consent-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.consent-item span {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.consent-error {
  color: #ef4444;
  font-size: 14px;
  margin-top: 8px;
  margin-left: 32px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

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

.account-actions {
  margin: 24px 0;
  padding: 20px;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.account-actions .btn {
  width: 100%;
  margin-bottom: 8px;
}

.account-action-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.btn-danger {
  background: var(--accent-2);
  color: white;
  border-color: var(--accent-2);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-icon {
  appearance: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--muted);
  transition: color 0.2s ease;
}

.btn-icon:hover {
  color: var(--text);
}

/* Mobile */
@media (max-width: 767px) {
  .gdpr-modal-content,
  .account-modal-content {
    padding: 24px;
    width: 95%;
  }
  
  .account-modal-header {
    padding: 20px 24px;
  }
  
  .account-settings-section {
    padding: 24px;
  }
}



