/* Styles personnalisés pour REGAFRIK - Design UX professionnel */

/* Palette de couleurs élégante */
:root {
  /* Couleurs principales */
  --primary-blue: #2E5EAA;      /* Bleu primaire - professionnel et institutionnel */
  --primary-dark: #1A365D;      /* Bleu foncé pour le contraste */
  --primary-light: #EBF4FF;     /* Bleu très clair pour les arrière-plans */
  
  /* Couleurs d'accentuation */
  --accent-purple: #8A4FFF;     /* Violet d'accentuation pour les éléments importants */
  --accent-purple-light: #EDE9FF; /* Violet clair pour les arrière-plans secondaires */
  
  /* Couleurs neutres */
  --neutral-white: #FFFFFF;     /* Blanc pur */
  --neutral-lightest: #F8FAFC;  /* Gris ultra-clair pour le fond global */
  --neutral-light: #E2E8F0;     /* Gris clair pour les bordures et séparateurs */
  --neutral-medium: #94A3B8;    /* Gris moyen pour le texte secondaire */
  --neutral-dark: #334155;      /* Gris foncé pour le texte principal */
  
  /* Couleurs fonctionnelles */
  --success: #0D9488;           /* Vert pour les confirmations */
  --warning: #F59E0B;           /* Orange pour les avertissements */
  --error: #DC2626;             /* Rouge pour les erreurs */
  --info: #3B82F6;              /* Bleu pour les informations */
  
  /* Couleurs spécifiques */
  --document-bg: #FFFFFF;       /* Fond blanc pour les documents */
  --document-border: #E2E8F0;   /* Bordure grise claire pour les documents */
  --document-shadow: rgba(0, 0, 0, 0.05); /* Ombre douce */
  
  /* Espace entre les éléments */
  --spacing-xs: 0.25rem;        /* 4px */
  --spacing-sm: 0.5rem;         /* 8px */
  --spacing-md: 1rem;           /* 16px */
  --spacing-lg: 1.5rem;         /* 24px */
  --spacing-xl: 2rem;           /* 32px */
  
  /* Rayons de bordure */
  --radius-sm: 0.25rem;         /* 4px */
  --radius-md: 0.5rem;          /* 8px */
  --radius-lg: 1rem;            /* 16px */
  --radius-circle: 50%;
  
  /* Propriétés de l'interface mobile */
  --mobile-header-height: 60px;
  --mobile-tabbar-height: 60px;
  --mobile-searchbar-height: 60px;
  --mobile-bottom-spacing: 80px;
  
  /* Ombres et élévations */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 48px rgba(0,0,0,0.12);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* Z-Index layers */
  --z-base: 1;
  --z-drawer: 10;
  --z-modal: 20;
  --z-overlay: 30;
  --z-mobile-nav: 100;
}

/* Style global */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--neutral-lightest);
  color: var(--neutral-dark);
  font-family: 'Source Sans Pro', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
}

.main-content {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.2s;
}

a:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

/* Navigation */
.navbar {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--neutral-light);
  background-color: var(--neutral-white) !important;
  box-shadow: 0 2px 4px var(--document-shadow);
}

.navbar-brand {
  color: var(--primary-blue) !important;
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.nav-link {
  color: var(--neutral-dark) !important;
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-md) !important;
  transition: color 0.2s, background-color 0.2s;
  border-radius: var(--radius-md);
}

.nav-link:hover {
  color: var(--primary-blue) !important;
  background-color: var(--primary-light);
}

.nav-link.active {
  color: var(--primary-blue) !important;
  background-color: var(--primary-light);
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
}

.logo-text {
  margin-left: var(--spacing-sm);
  font-weight: 700;
}

/* Conteneurs */
.document-container {
  background-color: var(--document-bg);
  border: 1px solid var(--document-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: 0 4px 6px var(--document-shadow);
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.document-header {
  border-bottom: 2px solid var(--primary-blue);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
}

.document-title {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: var(--primary-dark);
  margin-bottom: 0;
}

/* Élément de validation visuelle */
.stamp {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-xl);
  width: 70px;
  height: 70px;
  border: 2px solid var(--accent-purple);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(12deg);
  font-family: 'Playfair Display', serif;
  color: var(--accent-purple);
  font-weight: bold;
  opacity: 0.8;
  font-size: 12px;
  text-align: center;
}

/* Styles des documents */
.official-document {
  border-left: 4px solid var(--accent-purple);
  padding-left: var(--spacing-lg);
  background-color: var(--accent-purple-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--spacing-md) var(--spacing-lg);
}

/* Formulaires */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--spacing-xl);
  background-color: var(--neutral-white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 16px var(--document-shadow);
}

.form-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  color: var(--primary-dark);
  font-family: 'Playfair Display', 'Georgia', serif;
}

.form-control {
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(46, 94, 170, 0.15);
}

.form-label {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--neutral-dark);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-text {
  font-size: 0.875rem;
  color: var(--neutral-medium);
}

/* Boutons */
.btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background-color: var(--neutral-white);
  border-color: var(--neutral-light);
  color: var(--neutral-dark);
}

.btn-secondary:hover {
  background-color: var(--neutral-light);
  color: var(--primary-dark);
}

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

.btn-accent:hover {
  background-color: #7039e6; /* Violet un peu plus foncé */
  border-color: #7039e6;
  color: white;
}

/* Cards des documents */
.document-card {
  height: 100%;
  transition: all 0.3s ease;
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--neutral-white);
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.document-card .card-header {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  border-bottom: 1px solid rgba(46, 94, 170, 0.2);
}

.document-card .card-footer {
  background-color: var(--neutral-lightest);
  border-top: 1px solid var(--neutral-light);
}

/* Barre de recherche */
.search-container {
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.search-input {
  border-radius: 50px;
  padding: var(--spacing-md) var(--spacing-xl);
  border: 1px solid var(--neutral-light);
  box-shadow: 0 2px 10px var(--document-shadow);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(46, 94, 170, 0.15);
  border-color: var(--primary-blue);
}

.search-icon {
  position: absolute;
  left: var(--spacing-lg);
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-medium);
}

/* Messages d'alerte */
.alert {
  border: none;
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
}

.alert-success {
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-danger {
  background-color: rgba(220, 38, 38, 0.1);
  color: var(--error);
  border-left: 4px solid var(--error);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border-left: 4px solid var(--info);
}

.alert-icon {
  margin-right: var(--spacing-sm);
  font-size: 1.25rem;
}

/* Tableau de bord admin */
.stat-card {
  background-color: var(--neutral-white);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px var(--document-shadow);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  transition: all 0.3s ease;
  border-top: 4px solid var(--primary-blue);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-md);
  color: var(--primary-blue);
}

.stat-card .stat-title {
  font-size: 1rem;
  color: var(--neutral-medium);
  margin-bottom: var(--spacing-xs);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.document-preview {
  max-height: 80vh;
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Pied de page */
footer {
  background-color: var(--primary-dark);
  color: white;
  padding: var(--spacing-xl) 0;
}

footer h5 {
  color: white;
  font-weight: 700;
}

footer p {
  color: rgba(255, 255, 255, 0.8);
}

footer a {
  color: rgba(255, 255, 255, 0.8);
}

footer a:hover {
  color: white;
}

footer .footer-icons {
  font-size: 1.25rem;
  margin-right: var(--spacing-md);
}

/* Animation de chargement */
.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(46, 94, 170, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-blue);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Styles pour la recherche interactive */
.search-results {
  transition: opacity 0.3s ease-in-out;
}

.search-loading {
  transition: all 0.3s ease-in-out;
}

.search-result {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, box-shadow 0.3s ease, transform 0.3s ease;
}

.search-result.show {
  transform: translateY(0);
  opacity: 1;
}

.search-result:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.result-title {
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.result-summary {
  color: var(--neutral-dark);
  margin-bottom: var(--spacing-md);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--spacing-sm);
}

.result-tag {
  background-color: var(--accent-purple-light);
  color: var(--accent-purple);
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  font-weight: 600;
  display: inline-block;
}

/* Style pour les termes de recherche surlignés */
.search-highlight {
  background-color: rgba(245, 158, 11, 0.3);
  padding: 2px 0;
  border-radius: 3px;
  font-weight: bold;
  color: var(--warning);
  border-bottom: 1px solid var(--warning);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Placeholder animation pour le chargement */
@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.search-placeholder {
  height: 15px;
  background-color: var(--neutral-light);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  animation: pulse 1.5s infinite ease-in-out;
}

.placeholder-title {
  width: 70%;
  height: 20px;
}

.placeholder-content {
  width: 100%;
}

/* Utilitaires */
.text-primary { color: var(--primary-blue) !important; }
.text-accent { color: var(--accent-purple) !important; }
.bg-primary-light { background-color: var(--primary-light) !important; }
.bg-accent-light { background-color: var(--accent-purple-light) !important; }

/* Ombres */
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07) !important; }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important; }

/* Animations */
.hover-lift {
  transition: transform 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-5px);
}

/* Visionneuse de documents */
.document-viewer {
  width: 100%;
  height: 75vh;
  border: none;
  display: block;
}

/* Styles pour le résumé IA */
.ai-summary {
  position: relative;
  background-color: var(--accent-purple-light);
  border-left: 4px solid var(--accent-purple);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.ai-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.ai-summary-title {
  display: flex;
  align-items: center;
  color: var(--accent-purple);
  font-weight: 600;
}

.ai-summary-title i {
  margin-right: var(--spacing-sm);
}

.ai-summary-content {
  line-height: 1.6;
  color: var(--neutral-dark);
}

/* Styles pour la zone de drop de fichiers */
.drop-zone {
  border: 2px dashed var(--neutral-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: border-color 0.3s ease;
  background-color: var(--neutral-lightest);
  cursor: pointer;
}

.drop-zone-active {
  border-color: var(--primary-blue);
  background-color: var(--primary-light);
}

.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.file-list {
  max-height: 200px;
  overflow-y: auto;
  text-align: left;
  border: 1px solid var(--neutral-light);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--neutral-light);
}

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

.file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.file-remove {
  cursor: pointer;
  color: var(--error);
}

.file-remove:hover {
  color: #b02a37;
}

/* === OPTIMISATIONS MOBILE === */
/* Styles pour l'expérience mobile native */

/* Variables pour l'interface mobile */
:root {
  --mobile-navbar-height: 60px;
  --mobile-tabbar-height: 60px;
  --mobile-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-safe-area-top: env(safe-area-inset-top, 0px);
  --mobile-swipe-threshold: 50px;
}

/* Styles de base pour les appareils mobiles */
@media (max-width: 767.98px) {
  body {
    padding-top: var(--mobile-navbar-height);
    padding-bottom: var(--mobile-tabbar-height);
    overflow-x: hidden;
    position: relative;
    touch-action: manipulation; /* Améliore la réactivité sur mobile */
    -webkit-tap-highlight-color: transparent; /* Supprime le surlignage au tap */
  }
  
  /* Typographie mobile */
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
  h4 { font-size: 1.2rem; }
  h5 { font-size: 1.1rem; }
  h6 { font-size: 1rem; }
  
  /* Espacement réduit sur mobile */
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    width: 100%;
    max-width: 100%;
  }

  /* Améliorations spécifiques à la recherche mobile */
  .search-container {
    margin-bottom: var(--spacing-lg);
    width: 100%;
  }

  .input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  .search-input {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    height: 60px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .search-button {
    width: 100%;
    height: 50px;
    border-top-left-radius: var(--radius-md) !important;
    border-top-right-radius: var(--radius-md) !important;
    border-bottom-right-radius: var(--radius-md) !important;
    border-bottom-left-radius: var(--radius-md) !important;
    font-size: 1.1rem;
    padding: var(--spacing-md);
  }
  
  /* Navbar mobile fixe en haut */
  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--mobile-navbar-height);
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--neutral-white) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .navbar-brand {
    font-size: 1.2rem;
    padding: 0;
  }
  
  /* Menu hamburger pour mobile */
  .navbar-toggler {
    border: none;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    background-color: transparent;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
  
  /* Barre de navigation inférieure (style app mobile premium) */
  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-tabbar-height);
    background-color: var(--neutral-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: var(--z-mobile-nav);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid var(--neutral-light);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0 var(--spacing-sm);
  }
  
  .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--neutral-medium);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: var(--spacing-xs) 0;
    transition: all 0.2s ease;
    position: relative;
    opacity: 0.7;
  }
  
  .tab-item:hover, .tab-item:focus {
    color: var(--primary-blue);
    text-decoration: none;
    opacity: 1;
  }
  
  .tab-item.active {
    color: var(--primary-blue);
    opacity: 1;
  }
  
  .tab-item.active .tab-icon {
    transform: translateY(-4px);
  }
  
  .tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    transform: translateX(-50%);
  }
  
  .tab-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
  }
  
  /* Bouton d'action central surélevé */
  .tab-action-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: var(--z-mobile-nav);
    border: 3px solid white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .tab-action-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
  
  .tab-action-button i {
    font-size: 1.5rem;
  }
  
  /* Ajustements des cards et containers */
  .card {
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-md);
  }
  
  .document-card {
    margin-bottom: var(--spacing-md);
  }
  
  .document-container {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  
  /* Effet de tap/touch */
  .tap-highlight {
    position: relative;
    overflow: hidden;
  }
  
  .tap-highlight::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    transform: scale(0) translate(-50%, -50%);
    transform-origin: top left;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  }
  
  .tap-highlight:active::after {
    transform: scale(4) translate(-25%, -25%);
    opacity: 1;
    transition: transform 0s, opacity 0.2s ease-out;
  }
  
  /* Animations de transition pour les vues */
  .mobile-view {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  .mobile-view.slide-in {
    transform: translateX(0);
    opacity: 1;
  }
  
  .mobile-view.slide-out {
    transform: translateX(100%);
    opacity: 0;
  }
  
  /* Drawer latéral (menu) */
  .mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    background-color: var(--neutral-white);
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: var(--spacing-lg) var(--spacing-md);
    padding-top: calc(var(--mobile-safe-area-top) + var(--spacing-lg));
  }
  
  .mobile-drawer.open {
    transform: translateX(0);
  }
  
  .drawer-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  }
  
  .drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
  }
  
  .drawer-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--neutral-dark);
    cursor: pointer;
  }
  
  /* Searchbar mobile - version améliorée */
  .mobile-searchbar {
    position: relative;
    margin-bottom: var(--spacing-md);
    background-color: var(--neutral-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  }
  
  .search-input-container {
    position: relative;
  }
  
  .mobile-searchbar .search-input {
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-xl);
    padding-left: 3rem;
    width: 100%;
    border: 2px solid var(--primary-light);
    background-color: var(--neutral-white);
    font-size: 1.1rem;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  
  .mobile-searchbar .search-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(46, 94, 170, 0.15);
  }
  
  .mobile-searchbar .search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-blue);
    font-size: 1.25rem;
  }
  
  .mobile-searchbar .search-submit {
    height: 55px;
    border-radius: var(--radius-md);
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: var(--spacing-sm);
  }
  
  /* Filtres rapides pour la recherche mobile */
  .search-quick-filters {
    overflow-x: auto;
    white-space: nowrap;
    padding: var(--spacing-xs) 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  .search-quick-filters::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  
  .filter-chip {
    padding: var(--spacing-xs) var(--spacing-md);
    margin-right: var(--spacing-xs);
    border-radius: 50px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background-color: var(--neutral-lightest);
    border-color: var(--neutral-light);
  }
  
  .filter-chip i {
    margin-right: 5px;
  }
  
  /* Boutons d'action flottants (FAB) */
  .mobile-fab {
    position: fixed;
    bottom: calc(var(--mobile-tabbar-height) + var(--spacing-md));
    right: var(--spacing-md);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1010;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .mobile-fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }
  
  .mobile-fab i {
    font-size: 1.5rem;
  }
  
  /* Pull-to-refresh animation */
  .pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--neutral-lightest);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
  }
  
  .pull-to-refresh.visible {
    transform: translateY(0);
  }
  
  .pull-indicator {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(46, 94, 170, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
  }
  
  /* Toast notifications mobile */
  .mobile-toast {
    position: fixed;
    bottom: calc(var(--mobile-tabbar-height) + var(--spacing-md));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 1050;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 90%;
    text-align: center;
  }
  
  .mobile-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  
  /* Améliorations pour les dossiers et les documents */
  .folder-card {
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
  }
  
  .document-item {
    position: relative;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--neutral-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: var(--spacing-sm);
    transition: transform 0.2s ease;
  }
  
  .document-item:active {
    transform: scale(0.98);
  }
  
  /* Style d'indicateur de swipe */
  .swipe-indicator {
    width: 45px;
    height: 5px;
    background-color: var(--neutral-light);
    border-radius: 2.5px;
    margin: var(--spacing-sm) auto;
    opacity: 0.8;
  }
  
  /* Animations pour les transitions de page */
  .page-transition {
    animation-duration: 0.3s;
    animation-fill-mode: both;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  @keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0.5; }
    to { transform: translateX(0); opacity: 1; }
  }
  
  @keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0.5; }
  }
  
  @keyframes slideInUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  .fade-in { animation-name: fadeIn; }
  .slide-in-right { animation-name: slideInRight; }
  .slide-out-left { animation-name: slideOutLeft; }
  .slide-in-up { animation-name: slideInUp; }
  
  /* Effet de ripple (Material Design) */
  .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
  }
  
  @keyframes ripple {
    to {
      transform: scale(2);
      opacity: 0;
    }
  }
  
  /* Animations pour les éléments qui apparaissent au défilement */
  .animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  
  .animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Types d'animations */
  .animate-fade-in.animated {
    animation: fadeIn 0.5s forwards;
  }
  
  .animate-slide-up.animated {
    animation: slideInUp 0.5s forwards;
  }
}
