/* ==========================================================================
   1. VARIABLES ET CONFIGURATION DE BASE
   ========================================================================== */
:root {
  --navbar-height: 120px;
}
body {
  padding-top: var(--navbar-height);
  opacity: 0;
  transition: opacity 0.6s ease-in, background-color 0.3s ease, color 0.3s ease;
}
body.fade-in {
  opacity: 1;
}

/* ==========================================================================
   2. THÈME CLAIR (par défaut)
   ========================================================================== */
body {
  background-color: #f8f9fa;
  background-image: url('https://ahqh-issoire.fr/images/fond_clair.jpg');
  background-size: cover; /* Cela permet de couvrir toute la zone */
  background-position: center; /* Centre l'image */
  background-repeat: no-repeat; /* Empêche la répétition de l'image */
  background-attachment: fixed; /* Fixe l'image pour qu'elle ne défile pas avec le contenu */
  color: #212529; /* Texte noir */
}
.card {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: #dee2e6;
}
.table {
  color: #212529; /* Texte des tableaux noir */
}
.card-header {
  background-color: #f8f9fa;
}

/* ==========================================================================
   3. THÈME SOMBRE (surcharge les styles par défaut)
   ========================================================================== */
body.dark-mode {
  background-color: #121212;
  background-image: url('https://ahqh-issoire.fr/images/fond_dark.jpg');
  background-size: cover; /* Cela permet de couvrir toute la zone */
  background-position: center; /* Centre l'image */
  background-repeat: no-repeat; /* Empêche la répétition de l'image */
  background-attachment: fixed; /* Fixe l'image pour qu'elle ne défile pas avec le contenu */
  color: #e0e0e0; /* Texte blanc */
}
body.dark-mode .card,
body.dark-mode .modal-content {
  background-color: rgba(30, 30, 30, 0.85);
  border-color: #333;
}
body.dark-mode .card-header,
body.dark-mode thead.table-light {
    background-color: #242526 !important;
    border-color: #393a3b !important;
}
body.dark-mode .table,
body.dark-mode .card {
    color: #e0e0e0; /* CORRECTION : Texte des tableaux BLANC */
}
body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}
body.dark-mode .form-control {
  background-color: #2c2c2c;
  border-color: #555;
  color: #e0e0e0;
}
body.dark-mode .form-control::placeholder { color: #888; }
body.dark-mode .text-muted { color: #adb5bd !important; }
body.dark-mode .navbar,
body.dark-mode .footer { background-color: #000; }


/* ==========================================================================
   4. COMPOSANTS GLOBAUX (Navbar, Footer, Cartes...)
   ========================================================================== */

/* --- 4.1. Navbar --- */
.navbar {
  min-height: var(--navbar-height);
  padding: 10px 0;
}

.navbar-brand img {
  height: calc(var(--navbar-height) - 20px);
  object-fit: contain;
}

.navbar-nav .nav-link {
  color: white;
  transition: background-color 0.3s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
}
.dropdown-toggle.no-caret::after {
    display: none;
}
/* --- 4.2. Médaillon de Profil (Avatar) --- */
.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  /*border: 3px solid #fff;*/
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  transition: transform 0.2s;
  position: relative; /* Nécessaire pour le pseudo-élément */
}
.profile-avatar:hover {
  transform: scale(1.05);
}
.profile-avatar-lg {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
}
.profile-avatar-xl {
  width: 100px;
  height: 100px;
  font-size: 2.5rem;
}

/* --- 4.3. Footer --- */
.footer {
  padding: 1rem;
  margin-top: auto;
}
.footer a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer a:hover {
  color: #ffc107;
  text-decoration: underline;
}

/* --- 4.4. Cartes (Cards) --- */
.card-img-top {
  cursor: pointer;
}
.dashboard-card {
  height: 100%;
}

/* --- 4.5. Tableaux --- */
.table {
    /* Style de base pour tous les tableaux en mode clair */
    color: #212529; /* Texte noir par défaut */
}

body.dark-mode .table {
    color: #e0e0e0; /* Texte blanc par défaut pour les tableaux en mode sombre */
    border-color: #444; /* Bordures plus sombres */
}

body.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
    color: #fff;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode thead.table-light {
    background-color: #343a40 !important;
    border-color: #454d55 !important;
}

/* ==========================================================================
   5. STYLES SPÉCIFIQUES AUX PAGES
   ========================================================================== */
   
/* --- 5.1. Pages de Connexion / Inscription --- */
.center-container {
  min-height: calc(100vh - var(--navbar-height) - 100px); /* Ajustez 100px à la hauteur de votre footer */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}
.login-card {
  width: 100%;
  max-width: 450px;
  animation: fadeSlideIn 0.6s ease-out forwards;
}
@keyframes fadeSlideIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- 5.3. Admin --- */
@media (min-width: 768px) {
  .dropdown-menu-actions {
    min-width: 260px;
  }
}
.dropdown-menu-actions .dropdown-item {
  white-space: nowrap;
}

/* ================================================== */
/*         STYLES POUR LA PAGE D'ATTENTE (UX)         */
/* ================================================== */

/* --- Mode Clair (par défaut) --- */

/* On définit notre classe personnalisée avec une couleur jaune vive. */
.bg-action-required {
    background-color: #ffc107; /* Jaune standard de Bootstrap (warning) */
    color: #000 !important; /* On s'assure que le texte est noir et lisible */
}

/* On peut aussi styliser le badge pour qu'il soit cohérent */
.badge.bg-action-required {
    background-color: #ffc107 !important;
    color: #000 !important;
}


/* --- Mode Sombre --- */
/* On cible le moment où le thème sombre est actif sur le BODY. */
/* Le sélecteur "body.dark-mode .bg-action-required" signifie :
   "un élément .bg-action-required qui est un descendant de body.dark-mode" */
body.dark-mode .bg-action-required {
    /* On choisit un jaune un peu plus "doré" ou "orangé", 
       qui a un meilleur rendu sur fond sombre que le jaune vif. */
    background-color: #e5a500 !important; 
    color: #000 !important; /* Le texte reste noir pour un contraste maximal. */
}

/* On fait de même pour le badge. */
body.dark-mode .badge.bg-action-required {
    background-color: #e5a500 !important;
    color: #000 !important;
}

/* Améliorations UX pour la page des mentions légales */

.legal-card h3.section-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.legal-card .key-label {
    font-weight: 500;
    color: #6c757d; /* Gris standard pour le mode clair */
}

/* ========================================================== */
/*               STYLES SPÉCIFIQUES AU MODE SOMBRE              */
/* ========================================================== */

/* Si vous utilisez une classe .dark-mode sur le body, décommentez ceci */

body.dark-mode .legal-card {
    background-color: #212529; 
    border: 1px solid #495057;   
}
body.dark-mode .legal-card .key-label {
    color: #adb5bd; 
}
body.dark-mode .legal-card h3.section-title {
    color: #e9ecef;
}
body.dark-mode .legal-card hr {
    border-top-color: #495057;
}
body.dark-mode .legal-card blockquote {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Améliorations UX pour la page de Politique de Confidentialité */

.privacy-card h3.section-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.privacy-section-card {
    border-color: #dee2e6;
}

.privacy-section-card .list-group-item {
    background-color: transparent; /* Pour que la couleur de fond de la carte soit visible */
    padding-left: 0;
    padding-right: 0;
    border-color: #dee2e6;
}
.privacy-section-card .list-group-item:last-child {
    border-bottom: 0;
}

/* ========================================================== */
/*               STYLES SPÉCIFIQUES AU MODE SOMBRE              */
/* ========================================================== */
/* Si vous utilisez une classe .dark-mode sur le body, décommentez ceci */

body.dark-mode .privacy-card {
    background-color: #212529;
    border: 1px solid #495057;
}
body.dark-mode .privacy-card hr {
    border-top-color: #495057;
}
body.dark-mode .privacy-section-card {
    background-color: #2c3034;
    border-color: #495057;
}
body.dark-mode .privacy-section-card .list-group-item {
    border-color: #495057;
}
body.dark-mode .badge.text-bg-light {
    background-color: #495057 !important;
    color: #f8f9fa !important;
}

/* Style de base pour TOUS les avatars de profil */
.profile-avatar {
  border-radius: 50%;
  object-fit: cover;
  /* La bordure utilise la variable --ring-color.
     Par défaut, la couleur sera transparente. */
  border: 3px solid var(--ring-color, transparent); 
}

/* On définit la couleur de la variable pour chaque classe "ring-" */
.ring-admin       { --ring-color: #FFD700; } /* Or */
.ring-service     { --ring-color: #6c757d; } /* Gris */
.ring-artisan     { --ring-color: #dc3545; } /* Rouge */
.ring-particulier { --ring-color: #0d6efd; } /* Bleu */

/* Tailles spécifiques */
.profile-avatar-xl {
    width: 150px;
    height: 150px;
    font-size: 4rem;
    border-width: 4px;
}

/* --- GESTION DES AVATARS ET DU RING --- 
.profile-avatar { border: 3px solid var(--ring-color, transparent); }
.profile-avatar.mobile-avatar { border-width: 2px; }
.ring-admin { --ring-color: #dc3545; }
.ring-service { --ring-color: #6c757d; }
.ring-artisan { --ring-color: #fd7e14; }
.ring-particulier { --ring-color: #0d6efd; }
*/

/* EMOJIS */
/*.emoji-picker-container {
    position: absolute;
    z-index: 1060; /* Au-dessus de la plupart des éléments Bootstrap 
    display: none;
  /* width: 100%;  S'assurer qu'il a assez de place en largeur */
   /* max-width: 320px;  Limite la largeur sur grand écran */
   /* --emoji-size: 1.5rem;
    --emoji-per-row: 8; 
} */

/* Amélioration pour l'input-group avec le bouton emoji */
.input-group .emoji-btn {
    border-top-right-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
}
/* 💫 Animation CSS */
@keyframes emojiPop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}