/* ------------------------------------------------------------------
   Global Reset & Base Styles
   ------------------------------------------------------------------ */

/* S’assurer que html et body occupent 100% de la hauteur */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Body en flex column pour positionner header, content, footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Hauteur minimale = hauteur de la fenêtre */
    width: 100%;
    overflow: auto;
    background-image: url('../images/fond_site.jpg');
    background-color: #000;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    font-family: Arial, sans-serif;
    color: #fff;
}

/* ------------------------------------------------------------------
   Header / Navbar
   ------------------------------------------------------------------ */
.navbar {
    flex-shrink: 0;
    /* Ne rétrécit pas en cas de manque d’espace */
    width: 100%;
    background-color: #333;
    position: relative;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
}

.navbar a {
    display: block;
    color: #fff;
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    background-color: #333;
    flex-shrink: 0;
}

.navbar a:hover,
.dropdown:hover .dropbtn {
    background-color: #ddd;
    color: #000;
}

.dropdown {
    position: relative;
    /* Pour positionner le dropdown-content */
    overflow: visible;
}

.dropdown .dropbtn {
    font-size: 16px;
    border: none;
    outline: none;
    color: #fff;
    padding: 14px 20px;
    background-color: #333;
    font-family: inherit;
    margin: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 101;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #ddd;
    color: #000;
}

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

/* ------------------------------------------------------------------
   Main Content Wrapper
   ------------------------------------------------------------------ */

/* Conteneur principal qui s’étire entre header et footer */
#container {
    flex: 1;
    /* Prend tout l’espace disponible */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Zone de contenu sémantique ou div générique */
main {
    position: relative;
    width: 1200px;
    max-width: 100%;
    margin: 30px auto 10px;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    flex-shrink: 0;
    box-sizing: border-box;
    z-index: 0;
}

main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/fond_main.jpg');
    /* Chemin relatif au CSS */
    background-size: contain;
    background-position: center;
    background-repeat: repeat;
    /* pas de répétition */
    opacity: 0.8;
    /* Transparence de l'image */
    border-radius: inherit;
    /* Récupère le border-radius de main */
    z-index: -1;
    /* Derrière le contenu de main */
}

/* Classe pour un contenu intérieur éventuel */
.content {
    background: #fff;
    padding: 50px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #000;
}

/* ------------------------------------------------------------------
   Typography & Utility Classes
   ------------------------------------------------------------------ */
h1,
h2,
h3,
h4 {
    text-align: center;
    padding: 10px;
    margin: 10px 0;
}

h4 {
    color: #ccc;
}

p {
    margin: 3px 0;
}

.hidden {
    display: none !important;
}

a.edit-link {
    color: #ffffff;
    text-decoration: none;
}

a.edit-link:hover {
    color: #d0d1d1;
    text-decoration: underline;
}

.a {
    color: #ffffff;
}

a {
    color: #ffffff;
}

.link {
    color: #ffffff;
}

.link:hover {
    cursor: pointer;
}

/* ------------------------------------------------------------------
   Table Styles (Classements, Technologies, etc.)
   ------------------------------------------------------------------ */
table {
    margin: 1em auto;
    border-collapse: collapse;
    width: 90%;
    max-width: 100%;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

th,
td {
    border: 1px solid #ccc;
    padding: 8px 10px;
    text-align: center;
    word-wrap: break-word;
}

th {
    background-color: #f4f4f4;
    color: #000;
}

.classements-table .positive {
    color: green;
    font-weight: bold;
}

.classements-table .negative {
    color: red;
    font-weight: bold;
}

/* ------------------------------------------------------------------
   Form & Textarea Styles
   ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
   Table PNJ
   ------------------------------------------------------------------ */

/* === Centrage du filtre DataTables === */
/* On annule le float et on centre */
.dataTables_wrapper .dataTables_filter {
    float: none !important;
    margin: 0 auto 10px;
    /* centré horizontalement, avec un peu d’espace sous le filtre */
    text-align: center !important;
}

/* On garde le label en inline-block pour ne pas étirer le input */
.dataTables_wrapper .dataTables_filter label {
    display: inline-block !important;
    text-align: left;
}

/* Passe le texte en blanc et le fond sombre */
.dataTables_filter input {
    color: #fff !important;
    background-color: #333 !important;
    border: 1px solid #555 !important;
}

/* Placeholder en gris clair */
.dataTables_filter input::placeholder {
    color: #ccc !important;
}

/* === Styles spécifiques à #pnj-tables === */
#pnj-tables table,
#cartographie-tables table,
#users-table table {
    border-collapse: collapse;
    border-radius: 15px;
    overflow: hidden;
    width: 90%;
    margin: 0 auto 30px;
    /* centré et espacé */
}

#pnj-tables th,
#pnj-tables td,
#cartographie-tables th,
#cartographie-tables td,
#users-table th,
#users-table td {
    padding: 8px 12px;
    border: 1px solid #444;
    text-align: center;
}

#pnj-tables th,
#cartographie-tables th,
#users-table th {
    background: rgba(30, 30, 30, 0.9);
    color: #fff;
}

#pnj-tables tbody tr:nth-child(odd),
#cartographie-tables tbody tr:nth-child(odd),
#users-table tbody tr:nth-child(odd) {
    background: rgba(20, 20, 20, 0.8);
}

#pnj-tables tbody tr:nth-child(even),
#cartographie-tables tbody tr:nth-child(even),
#users-table tbody tr:nth-child(even) {
    background: rgba(16, 16, 16, 0.8);
}

/* Chevrons de tri */
#pnj-tables th.sorting::after,
#cartographie-tables th.sorting::after,
#users-table th.sorting::after {
    content: ' ⇅';
    font-size: 0.8em;
    color: #aaa;
}

#pnj-tables th.sorting_asc::after,
#cartographie-tables th.sorting_asc::after {
    content: ' ↑';
    color: #fff;
}

#pnj-tables th.sorting_desc::after,
#cartographie-tables th.sorting_desc::after,
#users-table th.sorting_desc::after {
    content: ' ↓';
    color: #fff;
}

/* Conteneur principal centré */
.search-form-wrapper {
    position: relative;
    max-width: 500px;
    margin: auto;
    padding: 30px;
    background: none;
    border-radius: 12px;
    color: #fff;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.search-form-wrapper h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
    letter-spacing: 1px;
}

/* Grid 2 colonnes : labels à gauche, champs à droite */
.search-form {
    display: grid;
    grid-template-columns: auto 1fr;
    /* labels = 150px, contrôles = reste */
    row-gap: 12px;
    column-gap: 8px;
    /* écart réduit entre label et contrôle */
    align-items: center;
}

/* uniformise largeur et box-sizing */

.search-form input[type="text"],
.search-form input[type="number"],
.search-form input[type="email"],
.search-form select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1e1e1e;
    color: #eee;
}

.search-form input:focus,
.search-form select:focus {
    outline: none;
    border-color: #0af;
    box-shadow: 0 0 4px rgba(0, 170, 255, 0.6);
}


/* le champ checkbox dans la même colonne */
.search-form input[type="checkbox"] {
    /* on supprime tout margin pour qu’il colle au grid gap */
    margin: 0;
    transform: scale(1.1);
}

/* labels alignés à droite */
.search-form label {
    text-align: right;
    padding-right: 8px;
    font-size: 0.95em;
    color: #fff;
}

/* Les boutons sur les formulaires */
.search-form .btn-search {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 20px;
}

.search-form .btn-search input {
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

.search-form .btn-search button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.search-form .btn-search img {
    width: 140px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.search-form .btn-search button:hover img,
.search-form .btn-search img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.7);
}

/* Ajoute ceci pour styliser aussi les boutons texte comme une image */
.search-form .btn-search button {
    display: inline-block;
    width: 140px;
    height: 40px;
    line-height: 40px;
    background-color: #1e1e1e;
    color: #eee;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
    transition: transform .2s ease, box-shadow .2s ease;
    border: none;
    cursor: pointer;
}

.search-form .btn-search button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.7);
    background-color: #2a2a2a;
}

textarea {
    background-color: #000;
    border: 1px solid #83949D;
    color: #83949D;
}

.rapport-section textarea {
    width: 70%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #1e1e1e;
    color: #eee;
}


/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
footer {
    flex-shrink: 0;
    /* Reste à sa hauteur définie */
    height: 50px;
    background-color: #333;
    color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: Arial, sans-serif;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ------------------------------------------------------------------
   Responsive Adjustments
   ------------------------------------------------------------------ */
@media (max-width: 600px) {
    main {
        width: 100%;
        padding: 20px;
        margin: 20px auto;
    }

    table {
        width: 100%;
    }

    .technologies-table th,
    .technologies-table td,
    th,
    td {
        font-size: 12px;
        padding: 5px 7px;
    }
}