.tinymce-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tinymce-loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.tinymce-container {
  position: relative;
  width: 100%;
}

.dragging {
  opacity: 0.3;
}

/* Bouton fermeture sidebar - caché sur desktop, visible sur mobile via style-mobile.css */
.sidebar-close-btn {
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.drag-preview {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
  display: none;
  font-weight: 600;
  font-size: 14px;
}

.drop-line {
  height: 2px;
  margin: 2px 0;
  background: transparent;
  transition: all 0.3s;
  position: relative;
}

.drop-line.active {
  height: 32px;
  background: rgba(99, 102, 241, 0.1);
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  margin: 4px 0;
}

.drop-line.active::after {
  content: "Déposer ici";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #6366f1;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.drop-line.active::before {
  content: ""; 
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: calc(50% - 45px);
  top: 50%;
  transform: translateY(-50%);
  color: #6366f1;
  font-size: 10px;
  opacity: 0.8;
}

.drag-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-weight: 600;
  font-size: 14px;
  z-index: 10001;
  animation: slideInUp 0.3s ease;
}

.d-none { 
  display: none !important; 
}

.d-block { 
  display: block !important; 
}

.d-flex { 
  display: flex !important; 
}

.opacity-0 { opacity: 0 !important; }

.opacity-100 { opacity: 1 !important; }

.z-999 { z-index: 999 !important; }

.z-1000 { z-index: 1000 !important; }

.z-minus-9999 { z-index: -9999 !important; }

.loader-visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}

.loader-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

#pageLoader.loader-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

.overlay-visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 999 !important;
}

.overlay-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -9999 !important;
}

.transform-none {
  transform: none !important;
}

.no-margin-left {
  margin-left: 0 !important;
}

.sidebar-visible {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-hidden-state {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.password-error-visible {
  display: block !important;
}

.password-error-hidden {
  display: none !important;
}

.shake-animation {
  animation: shake 0.5s !important;
}

.co-owners-title {
  margin-bottom: 12px !important;
  color: var(--text-secondary) !important;
}

.co-owner-item {
  padding: 8px !important;
  background: rgba(42, 42, 62, 0.3) !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
}

.co-owner-permissions {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: 4px !important;
}

.error-text {
  color: var(--accent-danger) !important;
}

:root {
  
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #2a2a3e;
  --bg-glass: rgba(42, 42, 62, 0.4);
  --bg-card: rgba(26, 26, 46, 0.8);
  --bg-modal: rgba(15, 15, 26, 0.95);
  
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  
  
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --gradient-card: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(42, 42, 62, 0.7) 100%);
  
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-accent: #6366f1;
  
  
  --border-color: rgba(148, 163, 184, 0.2);
  --border-glass: rgba(255, 255, 255, 0.1);
  
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  
  --transition-fast: 0.15s ease-out;
  --transition-base: 0.25s ease-out;
  --transition-slow: 0.4s ease-out;
  
  
  --border-primary: rgba(99, 102, 241, 0.15);
  --bg-hover-primary: rgba(99, 102, 241, 0.08);
  --shadow-primary: rgba(99, 102, 241, 0.2);
  --animation-duration: 0.3s;
  --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
  
  
  --sidebar-width: 400px;
  --header-height: 70px;
  
  
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(
    180deg,
    rgba(15, 15, 26, 0.98) 0%,
    rgba(26, 26, 46, 0.95) 50%,
    rgba(15, 15, 26, 0.98) 100%
  );
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-right: 1px solid rgba(99, 102, 241, 0.15);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
  padding: var(--space-lg);
  box-shadow: 
    4px 0 24px rgba(0, 0, 0, 0.3),
    inset -1px 0 0 rgba(255, 255, 255, 0.02);
  
  /* CACHÉE PAR DÉFAUT - Affichée par JS quand authentifié */
  display: none;
  visibility: hidden;
  opacity: 0;
}

/* Sidebar cachée par défaut (redondant mais sécurité) */
html:not(.auth-confirmed):not(.visitor-mode) .sidebar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  transition: none !important;
}

html.auth-confirmed .sidebar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}

html.visitor-mode .sidebar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

html:not(.auth-confirmed):not(.visitor-mode) .container {
  margin-left: 0 !important;
  transition: margin-left 0.3s ease;
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.05), transparent);
  pointer-events: none;
}

.sidebar-header {
  padding: 5px 0;
  margin-bottom: 15px;
  text-align: center;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  height: auto;
  display: block;
}

.sidebar-header::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent);
  opacity: 0.6;
}

.sidebar-logo {
  width: 100%;
  height: auto;
  max-height: none;
  min-height: auto;
  filter: drop-shadow(0 3px 10px rgba(59, 130, 246, 0.25));
  transition: all var(--transition-base);
  margin: 0;
  display: block;
  object-fit: contain;
  transform: scale(1.0);
  padding: 0;
  cursor: pointer;
}

.sidebar-logo:hover {
  filter: drop-shadow(0 5px 15px rgba(59, 130, 246, 0.4));
  transform: scale(1.01);
}

.container {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  height: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.container.no-sidebar {
  margin-left: 0;
}

.dashboard-screen {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  margin-top: -48px;
  padding: 20px;
  padding-top: 69px;
  display: none;
  animation: fadeIn 0.4s ease;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.dashboard-screen.active {
  display: block;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
  margin-top: 10px;
}

/* Responsive: 2 colonnes sur tablette */
@media (max-width: 1100px) {
  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive: 1 colonne sur mobile */
@media (max-width: 600px) {
  .quick-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Les styles .stat-icon, .stat-content, .stat-value, .stat-label 
   sont maintenant dans card.css pour éviter les doublons */

.recent-section,
.suggestions-section,
.popular-section {
  margin-bottom: 50px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.section-title i {
  color: var(--accent-primary);
  font-size: 20px;
}

.section-action-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.section-action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state span {
  font-size: 14px;
  opacity: 0.7;
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.suggestion-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.suggestion-btn {
  padding: 12px 24px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.suggestion-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.popular-lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.list-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.list-info {
  flex: 1;
  min-width: 0;
}

.list-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-count {
  font-size: 12px;
  color: var(--text-muted);
}

.list-views {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-screen::-webkit-scrollbar {
  width: 4px;
}

.dashboard-screen::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-screen::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

.dashboard-screen::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

.empty-icon-container {
  margin-bottom: 24px;
}

.empty-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.empty-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-create-bulk {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.btn-create-bulk:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-login {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.btn-login:hover {
  background: rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* SUPPRIMÉ - Styles .welcome-screen dans welcome.css maintenant */

.welcome-screen.active {
  display: flex;
}

.auth-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  position: relative;
  z-index: 10;
}

.btn-auth {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  
  pointer-events: auto !important;
  user-select: none;
}

.btn-login {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

.btn-register {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
}

.btn-visitor {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-auth:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-auth:active {
  transform: translateY(0) scale(1);
}

.welcome-content {
  position: relative;
  z-index: 2;
}

.ai-brain-container {
  position: relative;
  z-index: 1;
  pointer-events: none; 
  margin-bottom: 30px;
}

.ai-particles {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.particle {
  pointer-events: none;
}

.welcome-screen * {
  position: relative;
}

.welcome-screen button,
.welcome-screen a {
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}

#openLoginBtn,
#openRegisterBtn,
#continueAsVisitorBtn {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 9999 !important;
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-flex !important;
}

.auth-buttons {
  animation: none !important;
}

#deleteConfirmModal .buttons,
#deleteGroupConfirmModal .buttons {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

#deleteConfirmModal .buttons button,
#deleteGroupConfirmModal .buttons button {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.progress-bar {
  width: 100%;
  max-width: 600px;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: var(--space-xl) 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  transition: width var(--transition-base);
  box-shadow: var(--shadow-glow);
}

.buttons {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
  justify-content: center;
}

.buttons button {
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.buttons button:not(.counter) {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-color);

}

.buttons button:not(.counter):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

#melanger.active:hover {
    background: #191833;
    border-color: #6265ee;
}

.shuffle-indicator {
font-size: 0.9em;
    margin-left: 4px;
    color: white;
    animation: checkPulse 0.3s ease;
    position: absolute;
    right: 4px;
}


#melanger.active .fa-shuffle {
  transform: scale(1.08);
}

.close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--accent-danger);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.close:hover {
  background: #dc2626;
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

#allCardsContent {
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-lg);
}
