﻿/* ============================================================
   STYLE GLOBAL - Outils Réseaux
   Thème clair unifié pour toutes les pages HTML
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --grid: #d1d5db;
  --accent: #0078d7;
  --warn: #e67e22;
  --ok: #16a34a;
}

/* RESET DE BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: linear-gradient(120deg, var(--bg), #e9eff7);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* CONTENEUR CENTRAL */
.wrap {
  max-width: 1300px;
  margin: auto;
  padding: clamp(20px, 3vw, 40px);
}

/* TITRES */
h1, h2, h3 {
  color: var(--accent);
  font-weight: 700;
}
h1 { font-size: clamp(24px, 4vw, 38px); margin-bottom: 16px; text-align: center; }
h2 { font-size: 1.5rem; margin-bottom: 10px; }
h3 { font-size: 1.2rem; margin-bottom: 8px; }

/* CARTES */
.card {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 16px;
  padding: clamp(18px, 2.5vw, 30px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .05);
  margin-bottom: 24px;
}
.card h2, .card h3 { color: var(--accent); }

/* MISE EN PAGE EN DEUX COLONNES */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 980px) {
  .grid { grid-template-columns: 1.4fr 1fr; } /* colonne gauche élargie */
}

/* FORMULAIRES */
label { font-weight: 600; color: var(--accent); }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grid);
  border-radius: 10px;
  background: #f9fafb;
  color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }

.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .row { grid-template-columns: 1fr 1fr; } }

/* BOUTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.15); }

/* TEXTE ET COULEURS */
.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* ÉTIQUETTES DE TEXTE */
.pill {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: #e0ecff;
  border: 1px solid var(--grid);
  color: #004c91;
  font-weight: 600;
}

/* TABLEAUX */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--grid);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--grid);
  vertical-align: top;
}
thead th {
  background: var(--accent);
  color: #fff;
  text-align: left;
}
tr:nth-child(even) td { background: #f1f5f9; }
tr:hover td { background: #e7f1fb; }

/* CODES INLINE */
code.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f3f4f6;
  border: 1px solid var(--grid);
  padding: .15rem .35rem;
  border-radius: 6px;
  color: #004c91;
}

/* HEADER ET FOOTER GLOBAUX */
header {
  background: var(--accent);
  color: white;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
}
footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: .9rem;
  margin-top: 40px;
}

/* ==== Barre de navigation globale ==== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: auto;
  padding: 0.6rem 1rem;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease;
}
.nav-links a:hover {
  color: #d1e9ff;
}
@media (max-width: 700px) {
  .nav-container {flex-direction: column;align-items:flex-start;}
  .nav-links {flex-wrap: wrap;gap: .6rem;}
}
/* ==== Barre de navigation globale ==== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: auto;
  padding: 0.6rem 1rem;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease;
}
.nav-links a:hover {
  color: #d1e9ff;
}
@media (max-width: 700px) {
  .nav-container {flex-direction: column;align-items:flex-start;}
  .nav-links {flex-wrap: wrap;gap: .6rem;}
}
/* ==== FIL D’ARIANE ==== */
.breadcrumb {
  background: #e5f1ff;
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--grid);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb span {
  color: var(--muted);
}
/* --- Ajustement du haut pour petits écrans --- */
body {
  scroll-padding-top: 80px; /* évite que le haut soit caché sous la nav */
}

/* --- Réduction de la hauteur visuelle de la barre --- */
.nav-container {
  padding: 0.4rem 1rem; /* au lieu de 0.6rem */
}

/* --- Réduction du texte dans la barre pour petits écrans --- */
@media (max-width: 768px) {
  .nav-links a {
    font-size: 0.9rem;
  }
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

/* --- Amélioration du rendu des cartes sur mobile --- */
.card {
  padding: 1rem;
}
/* --- Correction du décalage lié à la barre de navigation fixe --- */
html {
  scroll-padding-top: 100px; /* espace de sécurité pour les ancres */
}

body {
  padding-top: 80px; /* compense la hauteur de la nav-bar */
}

/* Ajustement responsive */
@media (max-width: 700px) {
  body {
    padding-top: 100px; /* nav plus haute sur mobile */
  }
}

/* ==== BARRE DE NAVIGATION UNIFIÉE ==== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: 100%;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: auto;
  padding: 0.5rem 1rem;
  flex-wrap: nowrap; /* empêche le retour à la ligne */
  overflow-x: auto;  /* ajoute un léger défilement horizontal si trop d’éléments */
}

.nav-logo {
  font-weight: 700;
  font-size: 1.2rem;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
  align-items: center;
}

.nav-links li {
  white-space: nowrap; /* empêche la coupure du texte */
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color .2s ease, background .2s ease;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.1);
  color: #d1e9ff;
}

.nav-links a.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Pour très petits écrans : permet le défilement horizontal */
@media (max-width: 750px) {
  .nav-container {
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .nav-links {
    flex-wrap: nowrap;
  }
}

/* ==== BARRE DE NAVIGATION AMÉLIORÉE AVEC SOUS-MENUS ==== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  width: 100%;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: auto;
  padding: 0.5rem 1rem;
  flex-wrap: wrap; /* ⚙️ On autorise le retour à la ligne */
  overflow-x: visible; /* ✅ Plus de barre de défilement */
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  white-space: nowrap;
}

/* Liens principaux */
.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.15);
}

/* === Sous-menus === */
.dropdown-menu {
  display: none;
  position: absolute;
  background: #0078d4;
  top: 100%;
  left: 0;
  min-width: 200px;
  border-radius: 6px;
  list-style: none;
  padding: 0.4rem 0;
  margin: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 999;
}

.dropdown-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: #fff;
}

.dropdown-menu li a:hover {
  background: rgba(255,255,255,0.15);
}

.dropdown:hover .dropdown-menu {
  display: block;
}

/* === Responsive === */
@media (max-width: 900px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .nav-links {
    flex-wrap: wrap;
  }
  .dropdown-menu {
    position: static;
    box-shadow: none;
  }
}

/* === Sous-menu Linux en cascade === */
.dropdown-sub {
  position: relative;
}

.dropdown-sub .sub {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: #0078d4;
  min-width: 240px;
  border-radius: 6px;
  padding: .4rem 0;
  z-index: 999;
}

.dropdown-sub:hover .sub {
  display: block;
}

.dropdown-sub .sub a {
  color: #fff;
  display: block;
  padding: .4rem .8rem;
  text-decoration: none;
}

.dropdown-sub .sub a:hover {
  background: rgba(255,255,255,0.15);
}
/* === Sous-menu Linux: cascade + recherche === */
.dropdown-sub { position: relative; }
.dropdown-sub > .sub { display:none; position:absolute; top:0; left:100%; min-width:260px; background:#0078d4; border-radius:8px; padding:.4rem 0; z-index:1000; }
.dropdown-sub:hover > .sub { display:block; }
.dropdown-sub .sub a { color:#fff; display:block; padding:.45rem .8rem; text-decoration:none; }
.dropdown-sub .sub a:hover { background:rgba(255,255,255,.15); }

.sub-search { padding:.5rem .6rem .2rem; }
.sub-search input[type="search"]{
  width:100%; padding:.45rem .6rem; border:1px solid #87bdf5; border-radius:6px;
  outline:none; background:#eaf4ff; color:#053; font-size:.95rem;
}
.sub-search input::placeholder{ color:#3b82f6; }

/* Mobile: le sous-menu se replie dans le panneau principal */
@media (max-width: 900px){
  .dropdown-sub > .sub { position: static; display:none; background:rgba(0,0,0,.08); box-shadow:none; }
  .dropdown-sub.open > .sub { display:block; }
}

/* === Sous-menu Linux : animation latérale fluide === */
.dropdown-sub {
  position: relative;
}
.dropdown-sub > .sub {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  background: #0078d4;
  border-radius: 8px;
  min-width: 260px;
  padding: .4rem 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .25s ease, transform .3s ease;
  z-index: 999;
}
.dropdown-sub:hover > .sub {
  display: block;
  opacity: 1;
  transform: translateX(0);
}
.dropdown-sub .sub a {
  color: #fff;
  text-decoration: none;
  display: block;
  padding: .45rem .8rem;
  border-radius: 4px;
  transition: background .2s ease;
}
.dropdown-sub .sub a:hover {
  background: rgba(255,255,255,0.2);
}
/* --- Mobile: ouverture verticale --- */
@media (max-width: 900px){
  .dropdown-sub > .sub {
    position: static;
    box-shadow: none;
    transform: none !important;
    opacity: 1 !important;
    display: none;
  }
  .dropdown-sub.open > .sub { display: block; }
}


/* ============================================================
   🔧 OPTIMISATION RESPONSIVE MOBILE – CALCULATEURS
   ============================================================ */

/* ✅ Tables scrollables horizontalement sur petit écran */
@media (max-width: 900px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    border-radius: 8px;
  }
  thead {
    display: table-header-group;
  }
  tbody tr td {
    font-size: 0.9rem;
    padding: 8px;
  }
}

/* ✅ Amélioration des blocs et marges */
@media (max-width: 768px) {
  .wrap {
    padding: 12px;
  }

  .card {
    border-radius: 10px;
    margin-bottom: 18px;
    padding: 1rem;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 1.1rem;
  }

  pre {
    font-size: 12px;
    padding: 8px;
  }
}

/* ✅ Ajustement des boutons et formulaires */
@media (max-width: 600px) {
  .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
    padding: .6rem 1rem;
  }

  input, textarea {
    font-size: 0.9rem;
  }

  .tools {
    flex-direction: column;
    gap: 8px;
  }
}

/* ✅ Checklist – Réduction du texte et meilleure lisibilité */
@media (max-width: 700px) {
  #checklistContent table {
    font-size: 0.85rem;
  }

  #checklistContent td,
  #checklistContent th {
    padding: 6px;
  }

  #checklistContent h3 {
    font-size: 1rem;
    margin-top: .8rem;
  }
}

/* ✅ NavBar fixe - meilleure adaptation aux écrans étroits */
@media (max-width: 700px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: .3rem;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
  }
}

.btn-blue {
    background-color: #0055aa;
    color: white !important;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
}
.btn-blue:hover {
    background-color: #003f7a;
}

/* Sous-menu Bootstrap multi-niveaux */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: .1rem;
    margin-right: .1rem;
}

.dropdown-submenu > a.dropdown-toggle::after {
    content: "▶";
    float: right;
    margin-top: 4px;
    font-size: 12px;
}
/* Force le sous-menu à se déployer par-dessus le parent */
.dropdown-menu {
    position: absolute !important;
    z-index: 9999 !important;
}

/* Pour tous les sous-menus */
.dropdown-submenu {
    position: relative !important;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: .2rem;
    margin-right: .2rem;
    min-width: 250px;
    z-index: 99999 !important;
}

/* Empêche le sous-menu de dépasser la fenêtre */
.dropdown-menu {
    overflow: visible !important;
}

/* Menu Formations long : scroll interne OK */
.dropdown-menu.formations-menu {
    max-height: 70vh;
    overflow-y: auto;
}

