/* Utilitaire standard HTML */
[hidden] {
  display: none !important;
}

/* Styles SmartPentestScan */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: #121212;
  color: #eee;
  font-family: Arial, sans-serif;
  line-height: 1.4;
}

/* En-tête et pied de page */
header, footer {
  text-align: center;
  background-color: #1f1f1f;
  padding: 15px;
  color: #05dbf2;
}

/* Conteneur principal */
.container {
  max-width: 800px;
  margin: 40px auto;
  background-color: #1f1f1f;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

h1, h2 {
  color: #05dbf2;
  margin-bottom: 15px;
}

/* Formulaires */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #ccc;
}

input[type="text"],
select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #2c2c2c;
  border: 1px solid #444;
  border-radius: 4px;
  color: #eee;
}

input[type="text"]::placeholder {
  color: #aaa;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-left: 5px;
  color: #05dbf2;
  font-weight: bold;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Cases à cocher */
.checkboxes {
  display: flex;
  gap: 20px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.checkboxes label {
  font-weight: normal;
  color: #ccc;
  display: inline-flex;
  align-items: center;
}

.checkboxes input[type="checkbox"] {
  margin-right: 5px;
}

/* Boutons */
button, .btn {
  background-color: #05dbf2;
  color: #121212;
  font-weight: bold;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  text-decoration: none;
}

button:hover, .btn:hover {
  background-color: #0af;
}

/* Messages d'erreur */
.error-message {
  background-color: #ff4c4c;
  color: #fff;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

/* Tableau des résultats */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background-color: #2c2c2c;
  border-radius: 10px;
  overflow: hidden;
}

table thead {
  background-color: #333;
}

table th, table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #444;
  color: #eee;
}

table th {
  color: #05dbf2;
  text-transform: uppercase;
  letter-spacing: 1px;
}

table tr:nth-child(even) {
  background-color: #252525;
}

/* États des ports */
.open-state {
  color: #4caf50;
  font-weight: 700;
}

.closed-state {
  color: #ff6b6b;
  font-weight: 600;
  font-style: normal;
}

/* =========================================
   Barre de progression (PROPRE + visible en scan)
   ========================================= */

/* Cachée par défaut */
.progress-bar-container {
  margin: 20px auto;
  width: min(720px, 92%);
  background-color: #2c2c2c;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  display: none;
}

/* Affichée uniquement quand la page est en "scan en cours" */
.results-page.is-scanning .progress-bar-container {
  display: block;
}

/* Barre animée (indéterminée) */
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #05dbf2;
  border-radius: 999px;
}

/* Animation indéterminée uniquement sur results pendant un scan */
.results-page.is-scanning .progress-bar-fill {
  width: 40%;
  animation: progressIndeterminate 1.25s infinite ease-in-out;
}


@keyframes progressIndeterminate {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

/* JSON debug */
pre {
  display: block;
  margin-bottom: 20px;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Retour */
.retour-container {
  margin-top: 20px;
  text-align: center;
}

.retour-container .btn {
  background-color: #05dbf2;
  color: #121212;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.retour-container .btn:hover {
  background-color: #0af;
}

/* Mode clair */
body.light-mode {
  background-color: #d3d3d3;
  color: #121212;
}

body.light-mode header,
body.light-mode footer {
  background-color: #bbb;
  color: #121212;
}

body.light-mode .container {
  background-color: #e0e0e0;
  color: #121212;
}

body.light-mode table {
  background-color: #f0f0f0;
}

body.light-mode table tr:nth-child(even) {
  background-color: #c0c0c0;
}

body.light-mode .open-state {
  color: #228b22;
}

body.light-mode .closed-state {
  color: #d32f2f;
}

/* ✅ Lisibilité garantie sur la page results en mode sombre */
body:not(.light-mode) .results-page,
body:not(.light-mode) .results-page .container {
  color: #eee;
}

body.light-mode .results-page,
body.light-mode .results-page .container {
  color: #121212;
}

/* Bouton sombre/clair */
.btn-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: none;
  color: #05dbf2;
  padding: 8px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.btn-theme-toggle span {
  margin: 0 4px;
  transition: filter 0.2s ease-in-out;
  display: inline-block;
}

.btn-theme-toggle span:hover {
  filter: brightness(1.5);
}

.btn-theme-toggle:hover {
  background-color: transparent;
  transform: scale(1.1);
}

/* Labels mode clair */
body.light-mode label {
  color: #333333;
}

body.light-mode .checkboxes label {
  color: #333333;
}

/* Responsive mobile */
@media (max-width: 600px) {
  .container {
    overflow-x: auto;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    background-color: #2c2c2c;
    border-radius: 10px;
    overflow: hidden;
  }

  table thead {
    display: none;
  }

  table tr {
    display: block;
    margin-bottom: 10px;
    border: 1px solid #444;
    background-color: #252525;
    padding: 10px;
    border-radius: 6px;
  }

  table td {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #444;
  }

  table td:last-child {
    border-bottom: none;
  }

  table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #05dbf2;
  }
}

/* Desktop */
@media (min-width: 601px) {
  table thead {
    display: table-header-group;
    background-color: #333;
  }

  table tr {
    display: table-row;
  }

  table th, table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #444;
    color: #eee;
  }
}

/* Lignes clair/foncé pour mode clair (✅ corrigé : les 2 doivent être lisibles) */
body.light-mode .ligne-claire td {
  color: #212121 !important;
}

body.light-mode .ligne-foncee td {
  color: #212121 !important;
}

/* Vulnérabilités */
.vuln-detected {
  background-color: #ff4d4d;
  color: white;
  padding: 5px;
  border-radius: 5px;
}

/* Nikto */
.nikto-results {
  background-color: #333;
  color: #ffcc00;
  padding: 10px;
  border-radius: 5px;
  white-space: pre-wrap;
}

/* JSON container */
.json-container {
  background-color: #1e1e1e;
  color: #f8f8f2;
  padding: 15px;
  border-radius: 10px;
  overflow: auto;
  max-height: 400px;
  transition: max-height 0.3s ease-in-out;
}

/* Field error / accessibilité */
.field-error,
#target-error-msg {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.06);
  padding: 6px 8px;
  border-radius: 4px;
  margin-top: 6px;
  font-size: 0.95rem;
}

/* Focus visible pour clavier */
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid rgba(5, 219, 242, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Focus spécifique pour inputs / boutons */
input[type="text"]:focus,
select:focus,
button:focus,
.btn:focus,
a.btn:focus {
  box-shadow: 0 0 0 3px rgba(5, 219, 242, 0.12);
}

/* Respecter la préférence système si non forcée 
@media (prefers-color-scheme: light) {
  body:not(.light-mode) {
    background-color: #dcdcdc;
    color: #121212;
  }
} */

/* =========================
   Menu (header)
   ========================= */
.site-header {
  text-align: center;
  background-color: #1f1f1f;
  padding: 15px;
  color: #05dbf2;
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand h1 { margin: 0; }
.brand p { margin: 6px 0 0; opacity: 0.9; }

.top-nav {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  color: #05dbf2;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(5, 219, 242, 0.22);
  background: rgba(5, 219, 242, 0.06);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: rgba(5, 219, 242, 0.14);
}

/* =========================
   Consent box
   ========================= */
.consent-box {
  margin: 14px 0 18px;
  padding: 12px 12px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}

.consent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-weight: normal;
  color: #ccc;
}

.consent-item a { color: #05dbf2; text-decoration: underline; }
.consent-hint { margin: 10px 0 0; opacity: 0.85; font-size: 0.95rem; }

/* =========================
   Terminal live (scan)
   ========================= */
.terminal-wrap {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  background: #0b0f14;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.terminal-title {
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-actions { display: flex; gap: 8px; }

.terminal-btn {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
}

.terminal-btn:hover { background: rgba(255,255,255,0.12); }

.terminal-body {
  height: 280px;
  overflow: auto;
  padding: 10px 12px;
  color: #e8e8e8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-line.dim { opacity: 0.75; }
.terminal-line.err { color: #ff6b6b; }
.terminal-line.ok  { color: #51cf66; }

/* petits helpers */
.muted { font-size: 0.9em; opacity: 0.8; }



/* =========================
   Footer légal
   ========================= */
.site-footer {
  margin-top: 60px;
  padding: 20px 10px;
  background-color: #1a1a1a;
  color: #aaa;
  text-align: center;
  font-size: 0.9rem;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
}

.footer-brand {
  margin-bottom: 8px;
}

.footer-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: #05dbf2;
  text-decoration: none;
  opacity: 0.85;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}
