/* =================================== */
/* 1. STYLES GLOBAUX & RESET           */
/* =================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Police définie une seule fois pour tout le site */
  font-family: 'Poppins', sans-serif;
  /* Suppression du "tap highlight" bleu par défaut sur mobile pour gérer nos propres styles */
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
  color: inherit; /* Garde la couleur de l'élément parent ou du bouton */
}

/* Utilitaires de police (gardés pour compatibilité HTML) */
.poppins-regular { font-weight: 400; font-style: normal; }
.poppins-semibold { font-weight: 600; font-style: normal; }
.poppins-bold { font-weight: 700; font-style: normal; }
.poppins-extrabold { font-weight: 800; font-style: normal; }

/* =================================== */
/* 2. ÉLÉMENTS PARTAGÉS (DÉ-DUPLIQUÉS) */
/* =================================== */

/* --- A. Navigation du bas (Mobile) --- */
/* Unifiée pour toutes les pages */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #fff;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50; /* Z-index élevé pour passer au dessus du contenu */
}

.bottom-nav .nav-item {
  color: #333;
  font-size: 22px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.1s;
}

/* État actif (clic/toucher) au lieu de hover pour l'animation */
.bottom-nav .nav-item:active {
  color: #3B82F6;
  transform: scale(0.9); /* Effet de pression */
}
/* On garde le changement de couleur au hover pour desktop, mais sans animation de mouvement */
.bottom-nav .nav-item:hover {
  color: #3B82F6;
}

/* Trucage icône maison vide */
.fa-house-outline {
    color: transparent !important;
    -webkit-text-stroke: 1.5px #333;
}
.nav-item:active .fa-house-outline,
.nav-item:hover .fa-house-outline {
    -webkit-text-stroke: 1.5px #3B82F6;
}

/* --- B. Inputs & Formulaires --- */
/* Regroupe Login, Inscription, Reset Password, Chat Input */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.3s;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  border-color: #5b9df9;
  outline: none;
}

/* --- C. Boutons Globaux --- */
/* Style de base pour tous les boutons principaux */
button, 
.btn, 
.view-btn {
  cursor: pointer;
  border: none;
  transition: background-color 0.2s, transform 0.1s ease-out; /* Animation rapide pour le clic */
  font-family: 'Poppins', sans-serif;
}

/* Effet "Pressé" Global (Le coeur de votre demande) */
button:active, 
.btn:active, 
.view-btn:active,
.back-arrow:active,
.home_link img:active {
  transform: scale(0.96); /* Rétrécissement réaliste */
  opacity: 0.9;
}

/* Classes utilitaires de couleurs */
.bg-blue, 
body.employer-login .login_form button, 
body.inscription-employer form button, 
.btn.blue {
  background-color: #3b82f6;
  color: #fff;
}
/* ... styles active ... */

/* AJOUT DE LA CLASSE .view ICI */
.bg-green, 
.btn.green, 
.view, /* <--- AJOUTÉ : Pour le bouton "Voir le profil" */
.view-btn, 
.reset-container button {
  background-color: #10b981;
  color: #fff;
}

.bg-green:active, 
.btn.green:active, 
.view:active, /* <--- AJOUTÉ : Pour l'effet au clic */
.view-btn:active, 
.reset-container button:active {
  background-color: #059669; 
}

/* --- D. Footer simple (Login/Inscription) --- */
.simple-footer {
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 20px 0;
    color: #555;
    background: #f0f0f0;
}

/* --- E. Header avec flèche retour --- */
.common-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}
.back-arrow {
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    transition: opacity 0.2s, transform 0.1s;
}


/* =================================== */
/* 3. PAGES SPÉCIFIQUES                */
/* =================================== */

/* --- Page: Login (login-employeur.php) --- */
body.employer-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  background: #f8f8f8;
}

body.employer-login main {
  flex: 1; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

body.employer-login .title-container h1 {
  font-size: 28px;
  color: #3B82F6;
  font-weight: 600;
  text-align: center;
}

body.employer-login .title-container {
  display: flex;            /* Active l'alignement horizontal */
  align-items: center;      /* Centre verticalement la flèche par rapport au texte */
  justify-content: center;  /* Centre le tout au milieu de la page */
  gap: 15px;                /* Espace entre la flèche et le titre */
  margin-bottom: 30px;
  width: 100%;
}

/* On s'assure que la flèche a une taille correcte */
body.employer-login .title-container img {
  width: 30px;              /* Taille fixe pour éviter qu'elle soit énorme */
  height: auto;
  display: block;
}

/* --- Modifications pour aérer la page (Login Employeur) --- */

/* 1. Augmenter l'espace sous le sous-titre */
body.employer-login .subtitle {
  font-size: 15px;
  color: #666;
  margin-bottom: 45px; /* Augmenté de 30px à 45px pour pousser le formulaire vers le bas */
  text-align: center;
  max-width: 450px;
  padding: 0 20px;
  line-height: 1.5; /* Meilleure lisibilité */
}

/* 2. Agrandir les champs de saisie (Inputs) */
body.employer-login .login_form input[type="email"],
body.employer-login .login_form input[type="password"] {
  width: 100%;
  padding: 16px 20px;  /* Augmenté : champs plus hauts (plus proches du mock-up) */
  margin-bottom: 30px; /* Augmenté : plus d'espace entre les champs */
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;     /* Texte un peu plus grand */
  transition: border-color 0.3s;
  background: #fdfdfd; /* Fond très légèrement différent pour le relief */
}

/* 3. Agrandir le bouton "Se connecter" */
body.employer-login .login_form button {
  width: 100%;
  padding: 16px;       /* Bouton plus haut */
  border: none;
  border-radius: 8px;
  background-color: #3b82f6;
  color: #fff;
  font-size: 18px;     /* Texte plus gros */
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
  margin-top: 15px;    /* Espace au-dessus du bouton */
}

/* 4. Ajuster le conteneur blanc */
body.employer-login .login_form {
  background: #fff;
  padding: 45px 35px;  /* Plus d'espace intérieur */
  border-radius: 20px; /* Coins un peu plus arrondis */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); /* Ombre plus douce */
  width: 90%;
  max-width: 400px;
  margin-bottom: 25px;
}

body.employer-login .sign_in_link {
  color: #5b9df9;
  font-weight: 600;
  text-decoration: none;
}
body.employer-login .sign_in_link:active {
  color: #2563eb;
  text-decoration: underline;
}

/* CORRECTION FOOTER (Login ET Inscription) */
body.employer-login .footer,
body.inscription-employer .footer {
    width: 100%;
    background-color: #e0e0e0; /* Gris */
    color: #666;               /* Texte gris foncé */
    text-align: center;
    padding: 30px 20px;
    margin-top: auto;          /* Pousse le footer tout en bas */
    font-size: 0.9rem;
}

/* --- Page: Accueil (Accueilemployeur.html) --- */
body.accueil-employer {
  background: #fff;
  color: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  padding-bottom: 70px; /* Espace pour la nav */
}

body.accueil-employer main {
  flex: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.accueil-employer .logo {
  color: #3b82f6;
  font-size: 2rem;
  font-weight: 700;
  margin: 40px 0;
}

body.accueil-employer .btn {
  display: block;
  width: 90%;
  max-width: 360px;
  margin: 10px auto;
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 600; 
  font-size: 18px;
  text-decoration: none;
}

body.accueil-employer .profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: 90%;
  max-width: 360px;
  margin: 10px auto;
  transition: transform 0.1s;
}
body.accueil-employer .profile-card:active {
    transform: scale(0.98);
    background-color: #f9f9f9;
}

body.accueil-employer .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e5e7eb;
}

body.accueil-employer .info {
  flex: 1;
  text-align: left;
  margin-left: 12px;
}

body.accueil-employer .view {
  /* Hérite des styles boutons globaux, juste taille spécifique */
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
}


/* --- Page: Inscription (Inscription_employeur.php) --- */
body.inscription-employer {
    display: flex;
    flex-direction: column; 
    align-items: center;   
    min-height: 100vh;
    background: #f8f8f8;
    padding: 20px 0;
}

/* --- Mise à jour pour Inscription_employeur.php --- */

body.inscription-employer .container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

body.inscription-employer .header {
    display: flex;
    align-items: center;      /* Centre verticalement */
    justify-content: center;  /* Centre horizontalement */
    gap: 15px;                /* Espace entre la flèche et le texte */
    width: 100%;
    max-width: 630px;         /* Pour s'aligner avec le formulaire */
}

body.inscription-employer .header h1 {
    font-size: 28px;
    color: #3B82F6;
    font-weight: 600;
    text-align: center;
    margin: 0;                /* IMPORTANT : retire les marges par défaut */
    line-height: 1.2;
}

body.inscription-employer .back-arrow img {
    width: 24px;              /* Même taille que sur le login */
    height: auto;
    display: block;
    cursor: pointer;
}

body.inscription-employer form {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 630px;
    width: 90%;
    margin-bottom: 25px;
}

body.inscription-employer form button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    /* Couleur gérée par .bg-blue global */
}

body.inscription-employer .profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #eee;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    color: #bbb;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.1s;
}
body.inscription-employer .profile-photo:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* --- Page: Messagerie (Messagerie.php) --- */
body.messagerie-page {
  background: white;
  color: #111;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.messagerie-page header {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

body.messagerie-page header h1 {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
}

body.messagerie-page main {
  flex: 1;
  padding: 16px;
  padding-bottom: 120px;
}

body.messagerie-page .message {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
  transition: background 0.1s;
}
/* Feedback tactile sur la liste des messages */
body.messagerie-page .message:active {
    background-color: #f5f5f5;
}

body.messagerie-page .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e5e7eb;
  margin-right: 12px;
}

body.messagerie-page .content { flex: 1; }
body.messagerie-page .content .header { 
    display: flex; 
    justify-content: space-between; 
    border: none; 
    padding: 0; 
}

body.messagerie-page .name { font-weight: 600; }
body.messagerie-page .dot { color: #ef4444; margin: 0 6px; }
body.messagerie-page .date { color: #555; font-size: 0.85rem; }
body.messagerie-page .content p { color: #777; margin: 4px 0 0 0; font-size: 0.9rem; }

/* Bouton flottant nouveau message */
body.messagerie-page .new-message {
  position: fixed;
  bottom: 80px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #555;
  transition: transform 0.1s;
}
body.messagerie-page .new-message:active {
    transform: scale(0.95);
}

body.messagerie-page .circle {
  background: #3b82f6;
  color: white;
  font-size: 1.8rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}


/* --- Pages: Recherche & Favoris --- */
body.recherche-profil-page,
body.favoris-employer {
  background: #f9f9f9;
  color: #111;
  padding-bottom: 80px;
}

.top-bar {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-bar h1 {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
  color: #3B82F6;
}

.search-section { padding: 16px; background: #fff; }
.search-box {
  display: flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.search-box input { margin: 0; padding: 0; border: none; background: transparent; }

.filter-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 5px; /* Pour scrollbar */
}

.filter-buttons button {
  padding: 8px 12px;
  background: #e5e7eb;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.filter-buttons button:active {
    background: #d1d5db;
    transform: scale(0.95);
}

.profiles-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.profile-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.profile-left { display: flex; align-items: center; gap: 12px; }
.profile-photo {
  width: 56px; height: 56px; border-radius: 50%;
  background: #e5e7eb; flex-shrink: 0;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.profile-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0;
}
.view-btn {
  font-size: 0.8rem; padding: 6px 10px; text-decoration: none; font-weight: 500; border-radius: 6px;
}


/* --- Page: Profil Employeur (profil_employeur_employeur.php) --- */
body.profil-employer {
  background: #f9f9f9;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px;
}

body.profil-employer .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

body.profil-employer .header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #3B82F6;
  margin: 0;
  flex: 1;
  text-align: center;
}

body.profil-employer .logout-btn {
    color: #ef4444;
    font-size: 1.2rem;
    width: 80px; 
    text-align: right;
    text-decoration: none;
    transition: transform 0.1s;
}
body.profil-employer .logout-btn:active { transform: scale(0.9); opacity: 0.8; }

body.profil-employer .container { width: 95%; max-width: 600px; margin: 20px auto; }
body.profil-employer .profile {
  background: #fff; border-radius: 15px; padding: 25px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05); text-align: center;
}

body.profil-employer .photo {
  width: 100px; height: 100px; border-radius: 15px;
  background: #f3f3f3; margin: 0 auto 15px; overflow: hidden;
  border: 1px solid #eee; display: flex; align-items: center; justify-content: center;
}
body.profil-employer .photo img { width: 100%; height: 100%; object-fit: cover; }

body.profil-employer .info {
  text-align: left; margin-top: 25px; padding-top: 15px; border-top: 1px solid #f0f0f0;
}
body.profil-employer .info p { margin-bottom: 15px; line-height: 1.5; color: #555; }
body.profil-employer .info strong { display: block; color: #333; margin-bottom: 4px; }

body.profil-employer .btn-green {
    /* Style spécifique mais similaire aux autres */
    display: block; width: 100%; background-color: #10b981;
    color: white; text-align: center; padding: 12px;
    border-radius: 8px; margin-top: 25px; text-decoration: none;
    font-weight: 500; transition: background 0.2s, transform 0.1s;
}
body.profil-employer .btn-green:active {
    background-color: #059669;
    transform: scale(0.96);
}


/* --- Page: Conversation (Chat) --- */
body.chat-page {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    background-color: #ffffff; overflow: hidden;
}

body.chat-page .top-header {
    background: #fff; padding: 10px 15px; display: flex;
    align-items: center; gap: 15px; box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    z-index: 10; border-bottom: 1px solid #eee;
}
body.chat-page .top-header .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

body.chat-page .messages-container {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px; background-color: #fff;
}

body.chat-page .date-divider {
    align-self: center; color: #888; font-size: 0.75rem;
    margin: 15px 0; background: #f9f9f9; padding: 4px 10px; border-radius: 10px;
}

body.chat-page .msg {
    max-width: 75%; padding: 10px 16px; border-radius: 18px;
    font-size: 0.95rem; position: relative; word-wrap: break-word;
    display: flex; flex-direction: column; user-select: none;
}
body.chat-page .mine { align-self: flex-end; background-color: #3B82F6; color: white; border-bottom-right-radius: 4px; }
body.chat-page .theirs { align-self: flex-start; background-color: #f1f0f0; color: #333; border-bottom-left-radius: 4px; }

body.chat-page .msg-info { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: 0.65rem; opacity: 0.8; }
body.chat-page .ticks.read { color: #a5d8ff; }
body.chat-page .ticks.sent { color: #e0e0e0; }

body.chat-page .send-bar {
    background: #fff; padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 10px;
    border-top: 1px solid #eee; z-index: 20;
}
body.chat-page .send-bar input { margin: 0; border-radius: 25px; background: #f9f9f9; }
body.chat-page .send-bar button {
    background: #3B82F6; color: white; padding: 10px;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
body.chat-page .send-bar button:active { background: #2563eb; transform: scale(0.9); }


/* --- Pages: Reset Password & Confirmation --- */
body.password-reset {
    background: #f8f8f8; display: flex; flex-direction: column;
    align-items: center; justify-content: center; min-height: 100vh;
}
.reset-container, .msg-box {
    background: white; padding: 40px; border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 400px; width: 90%; text-align: center; margin: auto;
}
.reset-container h1 { color: #3B82F6; margin-bottom: 10px; font-size: 1.5rem; }
.reset-container button {
    width: 100%; padding: 12px; font-size: 16px; border-radius: 8px;
    /* Couleur gérée par .bg-green global */
}
.reset-container .back-link {
    display: block; margin-top: 20px; text-decoration: none;
    color: #3B82F6; font-size: 14px; font-weight: 500;
}
.reset-container .back-link:active { opacity: 0.7; }

/* Message box specific */
.msg-box h1 { color: #10b981; font-size: 22px; }
.msg-box .btn { display: inline-block; padding: 10px 20px; border-radius: 8px; }

/* =================================== */
/* STYLES DU MENU CONTEXTUEL (CHAT)    */
/* =================================== */

/* 1. État par défaut : Caché sous l'écran */
#context-menu {
    position: fixed;
    bottom: -100%; /* On le pousse complètement en dehors de l'écran vers le bas */
    left: 0;
    width: 100%;
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.15);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animation fluide de remontée */
    z-index: 1000; /* Au-dessus de tout */
    display: flex;
    flex-direction: column;
    padding-bottom: 20px; /* Espace pour la barre home des iPhones */
    overflow: hidden;
}

/* 2. État actif : Remonte à l'écran (ajouté par le JS au clic long) */
#context-menu.active {
    bottom: 0;
}

/* 3. Style des boutons dans le menu */
.menu-item {
    padding: 16px 20px;
    font-size: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre icône et texte */
    cursor: pointer;
    background: white;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

/* Feedback visuel quand on appuie sur une option */
.menu-item:active {
    background-color: #f0f0f0;
}

/* Couleur spécifique pour le bouton supprimer */
#btn-delete {
    color: #ef4444; /* Rouge */
}
#btn-delete i {
    color: #ef4444;
}

/* Bouton annuler (centré et gras) */
#btn-cancel {
    justify-content: center;
    font-weight: 600;
    color: #555;
    border-top: 5px solid #f8f8f8; /* Séparation visuelle */
    margin-top: 5px;
    border-bottom: none;
}

/* 4. L'Overlay (fond noir transparent) */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4); /* Assombrit l'arrière-plan */
    z-index: 900; /* Juste en dessous du menu */
    display: none; /* Caché par défaut */
    opacity: 0;
    transition: opacity 0.3s;
}

/* Quand le menu est actif, on affiche l'overlay via JS (style inline display:block) */
/* On peut ajouter une classe .active pour gérer l'opacité si on veut une animation */
#context-menu.active ~ .overlay {
    display: block; /* Géré par le JS, mais on s'assure du z-index ici */
}

/* ================================================= */
/* NO SCROLL & FULLSCREEN : LOGIN EMPLOYEUR          */
/* ================================================= */

html {
    overscroll-behavior: none;
}

body.employer-login {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    
    /* GESTION DES ZONES DE SÉCURITÉ */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f8f8f8;
}

body.employer-login main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

body.employer-login .footer {
    flex-shrink: 0;
    width: 100%;
}

/* ================================================= */
/* RESPONSIVE : ADAPTATION PETITS ÉCRANS (Hauteur)   */
/* ================================================= */

/* Si l'écran fait moins de 800px de haut (ex: iPhone standard, petits Android) */
@media (max-height: 800px) {
    
    /* 1. On réduit l'espace sous le sous-titre */
    body.employer-login .subtitle {
        margin-bottom: 20px; /* Réduit de 45px à 20px */
    }

    /* 2. On réduit le formulaire blanc */
    body.employer-login .login_form {
        padding: 25px 20px; /* Plus compact */
        margin-bottom: 15px;
    }

    /* 3. On réduit la taille des champs */
    body.employer-login .login_form input[type="email"],
    body.employer-login .login_form input[type="password"] {
        padding: 12px 15px; 
        margin-bottom: 15px; /* Espace entre les champs réduit */
    }

    /* 4. On réduit le bouton */
    body.employer-login .login_form button {
        padding: 12px;
        margin-top: 10px;
    }
}

/* SÉCURITÉ ANTI-COUPURE */
/* Si jamais ça dépasse quand même, on autorise le scroll UNIQUEMENT sur le formulaire, pas toute la page */
body.employer-login main {
    justify-content: center; /* Reste centré si ça rentre */
    overflow-y: auto;        /* Scroll autorisé si ça dépasse */
    -webkit-overflow-scrolling: touch; /* Scroll fluide sur iOS */
    padding-top: 20px;       /* Marge de sécurité en haut */
}

/* =================================== */
/* 4. SÉCURITÉ MESSAGERIE (NOUVEAU)    */
/* =================================== */

/* Badge pour utilisateur bloqué */
.blocked-badge {
    color: #ef4444;
    font-size: 0.65rem;
    border: 1px solid #ef4444;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    font-weight: 700;
    vertical-align: middle;
}

/* Style pour conversation bloquée (grisée) */
.conversation-blocked {
    opacity: 0.6;
    background-color: #fcfcfc;
}

/* Texte censuré par le filtre */
.censored-text {
    color: #ef4444;
    font-style: italic;
    font-size: 0.85rem;
}

/* Indicateur de message sécurisé (cadenas) */
.secure-icon {
    font-size: 0.7rem;
    color: #10b981; /* Vert */
    margin-right: 4px;
}

/* ================================================= */
/* 5. STYLES MESSAGERIE (Venant de Messagerie.php)   */
/* ================================================= */
.message-link { text-decoration: none; color: inherit; display: block; }
.message:hover { background-color: #f9f9f9; }
.msg-unread { color: #111; font-weight: 700; }
.msg-read { color: #777; font-weight: 400; }
.red-dot {
    height: 10px; width: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
}

/* ====================================================== */
/* 6. STYLES RECHERCHE (Venant de Recherche_profil.php)   */
/* ====================================================== */
.top-bar { display:flex; align-items:center; gap:12px; padding:14px; background:#fff; border-bottom:1px solid #eee; }
.top-bar h1 { margin:0; font-size:1.1rem; }
.search-section { padding:14px; background:#fff; border-bottom:1px solid #eee; }
.search-box { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.search-box input[type="text"] { flex:1; padding:10px 12px; border-radius:8px; border:1px solid #ddd; }

.filters-row { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
.filters-row select, .filters-row input[type="text"] { padding:8px; border-radius:8px; border:1px solid #ddd; }
.filters-row .flex-1 { flex:1; min-width:160px; }

/* Styles spécifiques profil card recherche */
.profile-left { display:flex; gap:12px; align-items:center; }
.profile-photo-search { width:64px; height:64px; border-radius:50%; overflow:hidden; background:#f3f3f3; flex-shrink:0; }
.profile-photo-search img { width:100%; height:100%; object-fit:cover; display:block; }
.view-btn { background:#3B82F6; color:#fff; padding:8px 12px; border-radius:8px; text-decoration:none; }

/* Dropdown checkbox component (Version Recherche) */
.dropdown-checkbox { position: relative; display: inline-block; width:100%; max-width:420px; }
.dropdown-checkbox .toggle { display:flex; align-items:center; justify-content:space-between; padding:8px 10px; border:1px solid #ddd; border-radius:8px; background:#fff; cursor:pointer; }
.dropdown-checkbox .toggle .label { color:#333; font-size:0.95rem; }
.dropdown-checkbox .panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; background:#fff; border:1px solid #ddd; border-radius:8px; box-shadow:0 6px 18px rgba(0,0,0,0.08); padding:8px; max-height:260px; overflow:auto; display:none; }
.dropdown-checkbox.open .panel { display:block; }
.dropdown-checkbox .option { display:flex; align-items:center; gap:8px; padding:6px 4px; }
.dropdown-checkbox .option input[type="checkbox"] { width:16px; height:16px; }
.dropdown-checkbox .small-input { width:100%; padding:8px; border-radius:6px; border:1px solid #ddd; margin-top:6px; }
.dropdown-placeholder { color:#666; font-size:0.9rem; margin-top:4px; }

@media (max-width:720px) {
  .filters-row { flex-direction:column; align-items:stretch; }
  /* Note : .profile-card est déjà géré dans le css global, on ajuste juste les flex */
  .profile-card { flex-direction:column; align-items:flex-start; gap:10px; } 
  .profile-bottom { align-self:stretch; display:flex; justify-content:flex-end; width:100%; }
}

/* =================================== */
/* STYLES : PAGE FAVORIS (Nettoyage)   */
/* =================================== */

/* Image de profil dans la carte favoris */
.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* État vide (Aucun favori) */
.empty-state {
    text-align: center;
    margin-top: 50px;
    color: #666;
}
.empty-state i {
    font-size: 40px;
    margin-bottom: 10px;
    color: #ccc;
}
.empty-state a {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 600;
}

/* Icône active dans la barre de navigation */
.nav-item .active-icon {
    color: #3B82F6;
}

/* =================================== */
/* STYLES : HEADER CHAT (Conversation) */
/* =================================== */

.header-back-link {
    color: #3B82F6;
    font-size: 1.2rem;
    text-decoration: none;
    margin-right: 10px;
}

.header-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 1;
    color: inherit;
}

.header-profile-name {
    margin: 0;
    font-size: 1.1rem;
}

.header-options-container {
    position: relative;
}

.header-options-btn {
    color: #666;
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
}

.header-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    width: 150px;
    overflow: hidden;
    z-index: 100;
}

.header-dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.header-dropdown-item.warning { color: #f59e0b; }
.header-dropdown-item.danger { color: #ef4444; border-bottom: none; }

/* =================================== */
/* STYLES : MESSAGERIE DYNAMIQUE (JS)  */
/* =================================== */

/* Gestion des états (Chargement / Vide) */
.state-container {
    text-align: center;
    margin-top: 50px;
    color: #999;
}
.empty-state-msg {
    color: #666;
}
.empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    color: #ccc;
}
.empty-link {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 600;
}

/* Liste des conversations (Généré par JS) */
.msg-avatar-container {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden; /* Pour couper l'image en rond */
    margin-right: 12px;
    flex-shrink: 0;   /* Empêche l'image de s'écraser */
    background: #e5e7eb;
}

.msg-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.msg-content-wrapper {
    flex: 1;
    min-width: 0; /* INDISPENSABLE pour que l'ellipse (...) fonctionne en Flexbox */
}

.msg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.msg-name-text {
    font-weight: 600;
    color: #333;
}

.msg-date-text {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    margin-left: 6px;
}

.msg-preview-text {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;       /* Une seule ligne */
    overflow: hidden;          /* Cache ce qui dépasse */
    text-overflow: ellipsis;   /* Ajoute les ... */
}

/* =================================== */
/* STYLES : PROFILS & MODIFICATION     */
/* =================================== */

/* --- Images de profil --- */
.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.company-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Pas de border-radius 50% pour les logos d'entreprise, souvent carrés */
    border-radius: 8px; 
}

/* Image miniature dans le formulaire de modification */
.form-preview-container {
    text-align: center; 
    margin-bottom: 20px;
}
.form-preview-img {
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    object-fit: cover;
}
.form-helper-text {
    font-size: 0.8rem; 
    color: #666;
    margin-top: 5px;
}
.cv-success-text {
    font-size: 0.8rem; 
    color: #27ae60; 
    margin-bottom: 5px;
}

/* --- Messages d'alerte (Succès / Erreur) --- */
.alert-msg {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.alert-success {
    color: green;
    background: #d4edda;
}
.alert-error {
    color: red;
    background: #f8d7da;
}

/* --- Section CV (Aperçu) --- */
.cv-section-container {
    display: flex; 
    flex-direction: column; 
    gap: 10px;
    margin-top: 20px;
}
.cv-label {
    display: block; 
    text-align: center; 
    margin-bottom: 5px;
    font-weight: 600;
}
.cv-preview-box {
    border: 1px solid #ddd; 
    border-radius: 8px; 
    overflow: hidden; 
    height: 300px;
    background: #f9f9f9;
}
.cv-fallback-content {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    color: #666;
}
.cv-icon {
    font-size: 40px; 
    margin-bottom: 10px;
}

/* --- Header spécifiques --- */
.header-back-link {
    white-space: nowrap; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    text-decoration: none;
    color: inherit;
}
.fav-star-icon {
    cursor: pointer;
    font-size: 1.5rem;
    transition: color 0.2s, transform 0.1s;
}
.fav-star-icon:active {
    transform: scale(1.2);
}

/* --- Divers --- */
.cancel-link {
    display: block; 
    text-align: center; 
    margin-top: 15px; 
    color: #666; 
    text-decoration: none;
}
.cancel-link:hover {
    text-decoration: underline;
}

/* ================================================= */
/* CORRECTIF TAILLE PHOTO DE PROFIL (Urgent)         */
/* ================================================= */

/* On force la taille du conteneur ".photo" à l'intérieur de la section ".profile" */
.profile .photo {
    width: 120px;        /* Largeur fixe obligatoire */
    height: 120px;       /* Hauteur fixe obligatoire */
    margin: 0 auto 20px; /* Centré horizontalement + marge en bas */
    border-radius: 50%;  /* Rond parfait */
    overflow: hidden;    /* Coupe tout ce qui dépasse du rond */
    background-color: #f3f3f3; /* Gris clair si l'image charge mal */
    flex-shrink: 0;      /* Empêche le conteneur de s'écraser */
    display: flex;       /* Centre l'image à l'intérieur */
    align-items: center;
    justify-content: center;
}

/* Cas spécifique pour les logos d'entreprise (coins arrondis, pas rond complet) */
.profile .photo.company-logo {
    border-radius: 15px; 
}

/* On s'assure que l'image à l'intérieur suit le conteneur */
.profile .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit le rond sans déformer la photo */
}