/* =======================
   BASE : tels qu'avant
   ======================= */

body {
    font-family: Arial, sans-serif;
    background-image: url('../img/back/0.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0;
    padding: 0;
    color: #333;
}

h1, h2, h3 { text-align: center; color: #222; }

.titre-white {
    color: rgb(180, 255, 233);
    text-align: center;
    margin-top: 50px;
    font-size: 32px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px 0;
    border-top: 2px solid rgb(180, 255, 233);
    border-bottom: 2px solid rgb(180, 255, 233);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Liens / boutons comme avant */
a { text-decoration: none; color: #007BFF; }
a:hover { text-decoration: underline; }

button, input[type="submit"] {
    padding: 10px 15px; border: none; border-radius: 8px;
    background-color: #4CAF50; color: #fff; cursor: pointer; font-size: 14px;
    transition: background-color 0.3s ease;
}
button:hover, input[type="submit"]:hover { background-color: #45a049; }

form {
    background-color: rgba(255,255,255,0.9);
    padding: 15px; margin: 20px auto; width: 300px;
    border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
input[type="text"], input[type="password"], select {
    width: 100%; padding: 8px; margin: 8px 0;
    border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box;
}

.small-btn { padding: 8px 15px; font-size: 14px; }
.danger-btn { background-color: #e53935; color: #fff; font-weight: bold; }
.danger-btn:hover { background-color: #d32f2f; transform: translateY(-3px); box-shadow: 0 8px 12px rgba(0,0,0,0.4); }
.danger-btn:active { transform: translateY(1px); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.alert-btn { background-color: #e67c26; color: #fff; font-weight: bold; }
.alert-btn:hover { background-color: #d3912f; transform: translateY(-3px); box-shadow: 0 8px 12px rgba(0,0,0,0.4); }
.alert-btn:active { transform: translateY(1px); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.success-message {
    color: #fff; background-color: rgba(0, 180, 0, 0.85);
    border: 2px solid #00cc00; border-radius: 10px;
    font-size: 22px; font-weight: bold; padding: 14px 24px;
    text-align: center; width: fit-content; max-width: 80%;
    margin: 20px auto; box-shadow: 0 6px 12px rgba(0,0,0,0.6);
    opacity: 0; animation: fadeIn 0.5s ease-out forwards;
    backdrop-filter: blur(5px);
}
@keyframes fadeIn { to { opacity: 1; } }

.error-message {
    color: #fff; background-color: rgba(255,0,0,0.85);
    border: 2px solid #ff0000; border-radius: 10px;
    font-size: 20px; font-weight: bold; padding: 12px 20px;
    text-align: center; width: fit-content; margin: 20px auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    opacity: 1; animation: fadeOut 1s ease-out 9s forwards;
    backdrop-filter: blur(5px);
}
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* Dashboard tuiles d’origine (la page “ancienne”) */
.dashboard {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 20px;
}
.tile {
    position: relative;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    width: 200px; height: 150px;
    background-color: rgba(0,0,0,0.911);
    border: 2px solid #4CAF50; border-radius: 12px; padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4); text-align: center; text-decoration: none; color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tile:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.6); }
.tile .domain { font-size: 18px; font-weight: bold; margin-bottom: 10px; color: #a0e7ff; text-shadow: 1px 1px 2px #000; }
.tile .url-hidden { font-size: 0px; opacity: 0; transition: all 0.3s ease; word-wrap: break-word; color: #ffecb3; margin-top: 10px; }
.tile:hover .url-hidden { font-size: 14px; opacity: 1; }
.favicon { width: 32px; height: 32px; margin-bottom: 8px; border-radius: 4px; box-shadow: 0 0 5px rgba(0,255,255,0.5); transition: transform 0.3s ease; }
.tile:hover .favicon { transform: scale(1.2); }

/* =======================
   NOUVEAU : TABLE → TUILES
   (on “skinne” #tbl en cartes)
   ======================= */

/* On cache l’en-tête du tableau pour un rendu “cards” */
#tbl thead { display: none; }

/* Le corps devient une grille centrée */
#tbl tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    width: 80%;
    margin: 20px auto;
}

/* Chaque ligne devient une tuile visuelle */
#tbl tbody tr {
    position: relative;
    display: block;
    background-color: rgba(0, 0, 0, 0.911);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 14px 12px 12px 12px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity .2s ease;
}
#tbl tbody tr:hover { transform: translateY(-5px); box-shadow: 0 8px 16px rgba(0,0,0,0.6); }
#tbl tbody tr.row-busy { opacity: .85; }

/* On neutralise la mise en page “table” à l’intérieur */
#tbl tbody td { display: block; border: none; padding: 0; margin: 0; background: transparent; }

/* 1ère cellule : favicon centré */
#tbl tbody tr > td:first-child { text-align: center; margin-bottom: 8px; }
#tbl tbody tr > td:first-child img.fav { width: 32px; height: 32px; border-radius: 4px; box-shadow: 0 0 5px rgba(0,255,255,0.5); }

/* 2e cellule (URL) : titre + “sous-ligne” en petit */
#tbl tbody tr > td.mono a {
    display: block; color: #a0e7ff; text-shadow: 1px 1px 2px #000; font-weight: bold; text-align: center;
    overflow-wrap: anywhere;
}
#tbl tbody tr > td .muted { text-align: center; color: #ffecb3; margin-top: 4px; }

/* 3e cellule : domaine + root (petit) */
#tbl tbody tr > td:nth-child(3) { text-align: center; margin-top: 6px; }
#tbl tbody tr .mono { color: #e0e0e0; }
#tbl tbody tr .muted { color: #bebebe; }

/* 4e cellule : groupe => badge */
#tbl tbody tr > td:nth-child(4) { text-align: center; margin-top: 8px; }
.chip {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    background: #eef7ef; color: #2d6e36; border: 1px solid #cfe9d4; font-size: 12px;
}

/* 5e cellule : statut (texte facultatif) + pastille */
#tbl tbody tr > td.status { text-align: center; margin-top: 8px; min-height: 16px; }
#tbl tbody tr > td.status::before {
    content: "";
    position: absolute;
    top: 8px; right: 8px;
    width: 10px; height: 10px; border-radius: 50%;
    background: grey; /* par défaut */
}
/* Couleurs de pastille selon l’état porté sur la ligne (data-state) */
#tbl tbody tr[data-state="online"]  > td.status::before { background: limegreen; }
#tbl tbody tr[data-state="offline"] > td.status::before { background: red; }
#tbl tbody tr[data-state="pending"] > td.status::before { background: #909090; }

/* Liens dans la “tuile” */
#tbl tbody tr a { color: #fff; text-decoration: none; }
#tbl tbody tr a:hover { text-decoration: underline; }

/* Petites utilitaires */
.wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.muted { color: #bebebe; font-size: 12px; }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; }

/* Au cas où tu utilises encore la vraie “dashboard” en <div>... */
.status-dot { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: grey; }
.status-online  { background: limegreen !important; }
.status-offline { background: red !important; }









/* ===== Barre translucide centrée ===== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.topbar-inner{
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* gauche | centre | droite */
  align-items: center;
  gap: 12px;

  padding: 10px 16px;
  width: min(1100px, 92%);
  border-radius: 14px;

  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

/* — Bonjour à gauche — */
.left-hello{
  grid-column: 1;
  justify-self: start;
}
.topbar .hello{
  color: #e7e7e7e7;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* — Boutons centrés — */
.nav-group{
  grid-column: 2;          /* centre */
  display: flex;
  gap: 8px;
  justify-self: center;
}

/* — Déconnexion à droite — */
.user-group{
  grid-column: 3;          /* droite */
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  color: #f0f6f6;
}

/* Formulaire du bouton Déconnexion : inline, sans fond */
.topbar .inline{
  display: inline-block;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

/* ===== Boutons de navigation ===== */
.menu-btn{
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;

  color: #eaffea;
  background-color: rgba(76,175,80,0.22);
  border: 1px solid rgba(76,175,80,0.55);
  transition: background-color .2s ease, border-color .2s ease, transform .05s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.menu-btn:hover{
  background-color: rgba(76,175,80,0.38);
  border-color: rgba(76,175,80,0.9);
}
.menu-btn:active{ transform: translateY(1px); }
.menu-btn.active{
  background-color: rgba(76,175,80,0.55);
  border-color: rgba(76,175,80,1);
  color: #ffffff;
}

/* Bouton Déconnexion (cohérent avec la barre sombre) */
.danger-btn.small-btn{
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 700;
  background: rgba(200,0,0,0.4);
  border: 1px solid rgba(200,0,0,0.8);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  box-shadow: none;
}
.danger-btn.small-btn:hover{
  background: rgba(220,0,0,0.6);
  border-color: rgba(255,0,0,1);
}
.danger-btn.small-btn:active{ transform: translateY(1px); }

/* — Optionnel: responsive, on empile sous 640px — */
@media (max-width: 640px){
  .topbar-inner{
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .left-hello, .nav-group, .user-group{
    grid-column: 1;
    justify-self: center;
  }
  .left-hello{ justify-self: start; }
  .user-group{ justify-self: end; }
}


