/* ============================
   Fichier CSS pour index.php
   Commenté pour meilleure maintenabilité
   ============================ */

html {
  min-width: 1366px;
}
 
/* === RESET GLOBAL / TYPO === */
body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background-color: #f8f9fa;
  margin: 0;
  padding: 2rem 0;
  color: #212529;
  display: flex;
  justify-content: center;
  max-width: 100%; /* Garder tout centré et fluide */
  overflow-x: hidden; /* Évite le débordement horizontal */
}

/* === STRUCTURE PRINCIPALE === */
.page-wrapper {
  display: flex;
  max-width: 1400px;  /* max confortable */
  min-width: 1366px;  /* minimum ciblé */
  width: 100%;
  margin: 0 auto;
  gap: 0.7rem;
}

.main-content {
  min-width: 1170px;  /* contenu minimum pour garder 1366px total (180 de menu + 16 de gap) */
  max-width: 1204px;  /* Espace réservé pour le contenu - limite max possible, ajustable */
  flex-grow: 1; /* Permet de prendre tout l'espace restant */
}

.surligne{

  background-color: darkred;
  color: whitesmoke;
}

/* === TITRES === */
h1, h2 {
  color: #003366;
  text-align: left;
}

h3 {
  color: #003366;
  margin-bottom: 0 !important;
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

h3 + * {
  margin-top: 0.5rem;
  padding-top: 0;
}

h3 + .tableau {
  margin-top: 0.5rem; /* réduit l’espace entre h3 et tableau */
}

h4 {
  margin: 1.5rem auto;
  padding: 0.5rem 1.2rem;
  background-color: rgba(42, 125, 225, 0.85);
  color: #fff;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h5 {
  font-size: 1rem;
  font-weight: bold;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

/* === SEPARATEURS === */
.full-width {
  border: 0;
  border-bottom: 2px solid black;
  width: 100%;
  margin-top: 5px;
  margin-bottom: 1px;
}

/* === LISTES === */
ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 0.3em;
}

ul li {
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  
  background-color: #f0f4f8;
  border-radius: 3px;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* border-left: 3px solid #2a7de1; */

ul li b a {
  color: #2a7de1;
  text-decoration: none;
}

ul li b a:hover {
  text-decoration: underline;
}

/* === RECHERCHE === */
#searchGlossary {
  width: 100%;
  padding: 0.6rem;
  margin: 1em 0;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* === TABLEAUX === */

.tableau {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.tableau th {
  background-color: #004080;
  color: #fff;
  font-size: 0.85rem;           /* un peu plus petit */
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  text-align: center;
  padding: 0.5rem 0.7rem;       /* padding réduit */
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tableau td {
  text-align: center;
  padding: 0.4rem 0.6rem;       /* padding réduit */
  border: 1px solid #ccc;
  font-size: 0.85rem;           /* un peu plus petit que avant */
}

.tableau tr:hover td {
  background-color: #d1d8e3;
  color: #003366;
}

/* Classe pour les sous-tableaux des Range IP */
.range-ip-table {
    width: 100%;
    table-layout: fixed; /* Fixe la largeur des cellules */
}

.range-ip-table td {
    text-align: center; 
    border: none; /* Suppression des bordures */
    padding: 0; /* Espacement à gauche et à droite */
}

.range-ip-table td:nth-child(1) {
    width: 36%; /* Première adresse*/
}

.range-ip-table td:nth-child(2) {
    width: 4%; /* Le tiret au centre*/
    
}

.range-ip-table td:nth-child(3) {
    width: 60%; /* Dernière adresse*/
   
}


/* === BLOC STYLE TERMINAL === */
pre {
  background-color: #000000;     /* noir total */
  color: #00ff00;                /* vert fluo */
  padding: 1rem;                 /* plus d’espace pour respirer */
  border-radius: 0;              /* style "terminal" simple, pas arrondi */
  overflow-x: auto;              /* scroll horizontal si trop long */
  display: block;
  margin-bottom: 0;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;        /* permet retour à la ligne naturel */
  text-align: left;             /* alignement à gauche */
  box-shadow: none;             /* pas d’ombre */
  border: none;               /* border: none;   pas de bordure */
}

code {
  font-family: 'Courier New', Courier, monospace;
  background-color: transparent; /* transparent, pour que le fond de pre reste */
  color: inherit;                /* hérite du vert fluo de pre */
  padding: 0;                   /* pas de padding ici */
  border-radius: 0;
  white-space: pre-wrap;        /* même comportement que pre */
  text-align: left;
  border: none;  
}

/* === LIENS === */
.lien {
  color: #003366;
  text-decoration: none;
  font-weight: bold;
}

.lien:hover {
  text-decoration: none;
  color: #2a7de1;
}

/* === MENU === */

/* Menu à gauche */
#menu {
  width: 180px; /* Largeur actuelle */
  background-color: #004080; /* Bleu sombre */
  padding: 1rem 1.5rem;
  color: white;
  flex-shrink: 0;
  height: auto;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative; /* Pour éviter des problèmes de positionnement */
  z-index: 10;
  margin-left: auto; /* Cette ligne aligne le menu à gauche */
}

#menu a {
  display: block;  
  color: white;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.3rem;
  border-radius: 6px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#menu a:hover {
  background-color: #2a7de1;
  text-decoration: none;
  transform: scale(1.05);
}

#menu a:active {
  transform: scale(0.98);
}

/* === HEADER BAR === */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1em;
  background: #f4f4f4;
  border-bottom: 1px solid #ccc;
}

.header-bar h1 {
  margin: 0;
  font-size: 1.8em;
}

/* === BOUTONS === */
.admin-button {
  background: #007BFF;
  color: white;
  padding: 0.5em 1em;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.3s;
}

.admin-button:hover {
  background: #0056b3;
}

button,
.icon-button,
.admin-link-button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
}

button:hover,
.icon-button:hover,
.admin-link-button:hover {
  opacity: 0.9;
}

/* === MESSAGES === */
.message {
  margin-top: 1rem;
  padding: 0.7rem;
  border-radius: 4px;
}

.success {
  background-color: #e6ffed;
  border: 1px solid #34c759;
  color: #1e4620;
}

.error {
  background-color: #ffe6e6;
  border: 1px solid #ff3b30;
  color: #611a1a;
}

/* === LOGOUT === */
.logout {
  text-align: right;
  margin-top: 2rem;
}

.logout a {
  color: #2a7de1;
  text-decoration: none;
}

.logout a:hover {
  text-decoration: underline;
}

/* === BOUTON FLOTTANT RETOUR EN HAUT === */

#backToTop {
    display: none;
    position: fixed;
    left: max(0px, calc((100vw - 1400px) / 2));
    bottom: 1.5rem;
    width: 180px;
    padding: 0.7rem 0.4rem;
    background-color: #2a7de1;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 9999;
}

#backToTop:hover {
    background-color: #0056b3;
}