@import url("ROOT.css");
/* --------------------------------------------------------------- */
/* ----------------- Login.html et Register.html ----------------- */
/* --------------------------------------------------------------- */
.user-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-dark);
  padding: 20px;
}
.register-container,
.login-container {
  background-color: var(--surface);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 400px; /* Rend la boîte responsive sur mobile */
  text-align: center;
  /* Légère ombre ambiante pour détacher la boîte de connexion du fond */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.register-container h1,
.login-container h1 {
  color: var(--text-main);
  margin-bottom: 25px;
  font-size: 1.8rem;
  letter-spacing: 1px;
}
.register-form,
.login-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.register-form label,
.login-form label {
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}
/* Champs de saisie */
.register-form input,
.login-form input,
.register-form select {
  padding: 12px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--bg-dark); /* Effet d'enfoncement par rapport à la carte */
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* Effet quand on clique sur un champ */
.register-form input:focus,
.login-form input:focus,
.register-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* Halo bleu léger */
}
/* Bouton Principal (Se connecter / S'inscrire) */
.register-form button,
.login-form button {
  padding: 12px;
  margin-top: 10px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}
.register-form button:hover,
.login-form button:hover {
  background-color: #2563EB; /* Bleu un peu plus foncé au survol */
}
/* Bouton Retour */
.back-btn {
  display: block;
  text-align: center;
  padding: 12px;
  margin-top: 15px;
  margin-bottom: 35px;
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.back-btn:hover,
.navbar .btn {
	color: var(--text-main);
	font-weight: 500;
}
.navbar .btn:hover,
.navbar .btn:focus {
	color: #FFFFFF; /* Improved contrast for hover/focus */
	text-decoration: underline;
}
/* Accessibility: Visible focus indicators on interactive elements */
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
	border-color: var(--primary);
}
/* Lien pour passer de Login à Register */
.form-helper {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-main);
}
.form-helper .register-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.form-helper .register-link:hover {
  color: #60A5FA; /* Bleu plus clair */
  text-decoration: underline;
}
/* --------------------------------------------------------------- */
/* --------------------------- SIDEBAR --------------------------- */
/* --------------------------------------------------------------- */
#sidebar-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: var(--radius);
  cursor: pointer;
  z-index: 1000;
  transition: 0.2s;
}
#sidebar-toggle:hover {
  background: var(--surface-hover);
  color: var(--primary);
}
.sidebar {
  width: 260px;
  background-color: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, margin 0.3s ease;
  z-index: 999;
}
.sidebar.hide {
  transform: translateX(-100%);
  position: absolute;
}
.sidebar h2 {
  color: var(--text-main);
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 1px;
}
.sidebar nav {
  overflow-y: auto;
  flex: 1;
  padding: 0 15px;
}
/* Catégories (Menus déroulants) */
.category {
  margin-bottom: 5px;
}
.category-title {
  cursor: pointer;
  padding: 12px 15px;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.category-title:hover {
  background-color: var(--surface-hover);
}
.category-title a {
  color: var(--text-main);
  text-decoration: none;
}
.category-items {
  display: none; /* Géré par ton JS actuel */
  flex-direction: column;
  margin-top: 5px;
  margin-left: 10px;
  border-left: 1px solid var(--border);
}
.category-items a {
  display: block;
  padding: 10px 15px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.category-items a:hover {
  background-color: var(--surface-hover);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  margin-left: -1px;
}
/* Footer utilisateur */
.sidebar-footer {
  margin-top: 20px;
  padding: 20px 15px 0 15px;
  border-top: 1px solid var(--border);
}
.user-name {
  color: var(--text-main);
  font-weight: 500;
  text-align: center;
  margin-bottom: 10px;
}
.btn-footer {
  display: block;
  text-align: center;
  padding: 10px;
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.2s;
  margin-bottom: 8px;
}
.btn-footer:hover {
  background-color: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--primary);
}
#admin-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}
/* --------------------------------------------------------------- */
/* ----------------------- CONTENU PRINCIPAL --------------------- */
/* --------------------------------------------------------------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 30px;
  transition: margin-left 0.3s ease;
  color: var(--text-main);
}
/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
}
.main-header {
  font-size: 1.8rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 0.25rem;
}
#logo-tlife-header {
  width: 45px;
  height: 45px;
  border-radius: 5px; /* Rendu plus propre pour le logo */
  object-fit: cover;
}
.main-title {
  font-size: 1.2rem;
  color: var(--text-muted);
}
.time-display {
  font-size: 1.2rem;
  font-weight: bold;
}
/* --------------------------------------------------------------- */
/* ----------------- DISPOSITION EN 3 COLONNES ------------------- */
/* --------------------------------------------------------------- */
.dashboard-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 colonnes de largeur égale */
  gap: 25px; /* Espace entre les colonnes */
  align-items: start; /* Empêche les colonnes de s'étirer en hauteur inutilement */
}
.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Espace vertical entre les boîtes d'une même colonne */
}
/* --------------------------------------------------------------- */
/* ----------------------  BOÎTES ET CARTES ---------------------- */
/* --------------------------------------------------------------- */
.main-grid {
  margin-top: 10px;
}
.main-grid-title {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 15px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}
.main-grid-title.warning {
  border-left: 4px solid var(--warning);
}
.main-grid-title.danger {
  border-left: 4px solid var(--danger);
}
/* Grille plus large pour accueillir des cartes horizontales */
.main-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 5px;
}
/* --------------------------------------------------------------- */
/* ----------------- CARTES "INDIVIDUS RECHERCHÉS" --------------- */
/* --------------------------------------------------------------- */
/* --- Design Compact --- */
.civilian-card.compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger); /* Liseré rouge sur le côté */
  border-radius: var(--radius);
  padding: 12px;
  gap: 15px;
  transition: transform 0.2s, background-color 0.2s;
}
.civilian-card.compact:hover {
  transform: translateX(5px); /* Petit glissement vers la droite au survol */
  background-color: var(--surface-hover);
}
/* --- Partie Gauche (Image + Badge) --- */
.card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 70px;
}
.profile-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 8px; /* Ou 50% pour un cercle parfait */
  object-fit: cover;
  border: 1px solid var(--border);
}
.status-badge {
  background-color: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}
/* Petite animation si l'individu est dangereux */
.danger-pulse {
  animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
/* --- Partie Droite (Infos) --- */
.card-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
/* Grille interne pour les infos (2 colonnes) */
.card-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.card-details-grid p {
  margin: 0;
  white-space: nowrap;
  /* overflow: hidden;
  text-overflow: ellipsis; /* Coupe le texte trop long avec "..." */
}
.card-info {
  color: var(--text-main);
  font-weight: 500;
}
/* --------------------------------------------------------------- */
/* --------------------------- TABLEAUX -------------------------- */
/* --------------------------------------------------------------- */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius);
    overflow: hidden;
}
.modern-table th, .modern-table td {
    padding: 3px;
    text-align: left;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.2s;
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
/* -- Status Saisies -- */
.statut-detruit {
	color: #e74c3c;
	font-weight: bold;
}
.statut-en-convoi {
	color: #3498db;
	font-weight: bold;
}
.statut-poste {
	color: #2ecc71;
	font-weight: bold;
}
.statut-voler {
	color: #f39c12;
	font-weight: bold;
}
/* --------------------------------------------------------------- */
/* ------------------------- RESPONSIVE -------------------------- */
/* --------------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    height: 100%;
  }
  .main-content {
    padding: 20px;
    padding-top: 60px; /* Espace pour le bouton burger */
  }
}
/* Sur les écrans moyens (ex: petit PC portable ou tablette) -> 2 colonnes */
@media (max-width: 1200px) {
  .dashboard-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Sur les petits écrans (mobiles) -> 1 seule colonne */
@media (max-width: 800px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}
/* Mobile petites tailles (iPhone SE, ~375px) */
@media (max-width: 375px) {
  .sidebar {
    width: 220px;
  }
  .main-content {
    padding: 15px;
    padding-top: 50px;
  }
  .main-header {
    font-size: 1.4rem;
  }
  .card {
    padding: 15px;
  }
  .login-container,
  .register-container {
    padding: 25px;
  }
}
/* Grands écrans (1920px+) - éviter whitespace excessif */
@media (min-width: 1921px) {
  .main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px;
  }
  .dashboard-columns {
    max-width: 1400px;
    margin: 0 auto;
  }
}
/* Tablette iPad (768px) - optimisations supplémentaires */
@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  .main-content {
    padding: 25px;
    padding-top: 55px;
  }
  .dashboard-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .card {
    padding: 20px;
  }
}