/* Centrer le contenu */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;
    min-height: 100vh; /* Centrer verticalement */
}


/* ✅ Conteneur du formulaire */
.login-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 250px;
    margin-top: 200px;
}

/* ✅ Logo */
.logo {
    width: 222px;
    margin-bottom: 20px;
}

/* ✅ Champs du formulaire */
input[type="password"] {
    width: 200px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* ✅ Bouton de connexion */
#btConnexion {
    width: 222px;
    padding: 10px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background: #0056b3;
}

/* ✅ Message d'erreur */
.error-message {
    color: red;
    font-size: 14px;
    margin-bottom: 10px;
}

header {
    background: #007BFF;
    color: white;
    padding: 10px;
    text-align: center;
    width: 100%;
}

/* ✅ Bouton de déconnexion */
.logout-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    background: #c0392b;
}

header select {
    margin-top: 10px;
    padding: 8px;
    font-size: 16px;
}

.select_folder {
    font-size: 14px;
}

h1 {
    margin: 0;
    padding: 0;
}

h2 {
    margin: 0;
    padding: 0 0 10px 0;
    font-size: 20px;
}

h3 {
    padding: 0 0 10px 0;
    margin: 0;
    font-size: 14px;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 50%;
    margin: auto;
    margin-top: 20px;
}



table {
    width: 80%;
    border-collapse: collapse;
    background: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 5px;
    text-align: left;
}

th {
    background: #eee;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px; /* Largeur max */
}

/* Ajustement de la table */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 5px;
    text-align: left;
}

/* ✅ Styles pour le tableau des fichiers actifs */
#files-table th:first-child, #files-table td:first-child {
    width: 75%; /* Colonne du nom du fichier plus large */
}

#files-table th:last-child, #files-table td:last-child {
    width: 25%; /* Colonne des actions plus petite */
    text-align: center;
}

/* ✅ Styles pour le tableau des fichiers archivés */
#archives-table th:first-child, #archives-table td:first-child {
    width: 5%; /* Colonne des cases à cocher */
}

#archives-table th:nth-child(2), #archives-table td:nth-child(2) {
    width: 50%; /* Colonne du nom du fichier */
}

#archives-table th:nth-child(3), #archives-table td:nth-child(3) {
    width: 20%; /* Colonne de la date */
}

#archives-table th:nth-child(4), #archives-table td:nth-child(4) {
    width: 10%; /* Colonne de l'heure */
}

#archives-table th:last-child, #archives-table td:last-child {
    width: 20%; /* Assurer que la colonne "Actions" ait une largeur fixe */
    min-width: 120px; /* Éviter qu'elle devienne trop petite */
    text-align: center;
}

/* ✅ Ajustement du contenu de la cellule pour correspondre à l'en-tête */
#archives-table td.actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

/* Icônes des actions */
/* ✅ Appliquer l'effet de hover uniquement à l'élément sélectionné */
#files-table td.actions .action-btn,
#files-table td.actions .action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin: 3px;
    width: auto; /* S'adapte au texte */
    text-decoration: none; /* Supprime le soulignement des liens */
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, opacity 0.2s;
}

/* ✅ Uniformiser les couleurs de fond des actions */
.action-btn.rename { background: #f39c12; color: white; } /* Orange */
.action-btn.archive { background: #e74c3c; color: white; } /* Rouge */
.action-btn.download, .action-link { background: #3498db; color: white; } /* Bleu */

/* ✅ Effet hover propre sur chaque bouton individuellement */
.action-btn:hover,
.action-link:hover {
    background-color: #f2f2f2 !important; /* Gris clair */
    color: black !important; /* Texte en noir */
}

/* ✅ Assurer que les liens "Télécharger" aient le même style que les boutons */
.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin: 3px;
    border-radius: 5px;
    text-decoration: none;
    background: #3498db;
    color: white;
}

/* ✅ Effet hover sur le lien "Télécharger" */
.action-link:hover {
    background-color: #f2f2f2 !important;
    color: black !important;
}

/* ✅ Boutons globaux */
.action-btn {
    width:100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* ✅ Boutons spécifiques */
.rename { color: #f39c12; }
.archive { color: #e74c3c; }
.download { color: #3498db; }
.restore { color: #2ecc71; }
.delete { color: #e74c3c; }


/* ✅ Effet hover propre sur chaque bouton individuellement */
.action-btn:hover,
.action-link:hover {
    background-color: #f2f2f2 !important; /* Gris clair */
    color: black !important; /* Texte en noir */
}

/* ✅ Assurer que les liens "Télécharger" aient le même style que les boutons */
.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin: 3px;
    border-radius: 5px;
    text-decoration: none;
    background: #3498db;
    color: white;
}

/* ✅ Effet hover sur le lien "Télécharger" */
.action-link:hover {
    background-color: #f2f2f2 !important;
    color: black !important;
}

/* ✅ Icônes */
.action-btn i {
    font-size: 16px;}

a {
    text-decoration: none;

}

.restore-selection-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 10px;
}

.restore-selection-btn:hover {
    background: #27ae60;
}

/* ✅ Bouton "Ajouter un fichier" */
.upload-btn, .archives-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 15px 0;
}

.upload-btn i {
    font-size: 18px;
}

.upload-btn:hover {
    background: #0056b3;
}

/* ✅ Formulaire d'upload (caché par défaut) */
.upload-form {
    display: none;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.upload-form form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.upload-form input[type="file"] {
    border: 1px solid #ccc;
    padding: 5px;
}

.upload-form button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.upload-form button[type="submit"] {
    background: #28a745;
    color: white;
}

.upload-form button[type="submit"]:hover {
    background: #218838;
}

.upload-form button[type="button"] {
    background: #dc3545;
    color: white;
}

.upload-form button[type="button"]:hover {
    background: #c82333;
}

/* ✅ Conteneur pour rendre le tableau des archives scrollable sur mobile */
.archives-container {
    width: 100%;
    overflow-x: auto; /* Permet le scroll horizontal */
}

/* ✅ Correction de la taille des cellules "Actions" */
#archives-table td.actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50px; /* Assurer une hauteur minimale */
    padding: 8px;
}

/* ✅ Assurer que les boutons occupent bien l'espace */
#archives-table td.actions .action-btn {
    width: 100%; /* Prendre toute la largeur */
    text-align: center;
}

/* ✅ Ajout du hover */
#archives-table td.actions .action-btn:hover {
    background-color: #f2f2f2 !important;
    color: black !important;
}

/* ✅ Icône toujours visible */
#archives-table td.actions .action-btn i {
    margin-right: 5px;
}

#archives-table td.actions .action-btn span {
    display: none; /* Cacher le texte */
}
.action-btn span,
.action-link span {
    display: none; /* Cache le texte */
}
/* ✅ Mode responsive : masquer les textes des boutons sous 600px */
@media screen and (max-width: 600px) {
    /* ✅ Conteneur du formulaire */
    .login-container {
        margin-top: 100px;
    }

    .action-btn,
    .action-link {
        padding: 8px; /* Réduire la taille */
        width: 40px; /* Taille fixe pour tous les boutons */
        height: 40px;
        text-align: center;
    }

    .action-btn i,
    .action-link i {
        margin-right: 0; /* Supprime l'espace réservé au texte */
    }

    .action-btn span,
    .action-link span {
        display: none; /* Cache le texte */
    }

    th:last-child, td:last-child {
        width: auto;
        text-align: center;
    }

    .upload-form form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .logout-btn {
        display: none;
    }
}
/* ✅ Réduire les tailles des colonnes pour mobile */
@media screen and (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
        font-size: 12px;
    }

    #archives-table {
        width: 100%;
    }

    #archives-table th, 
    #archives-table td {
        padding: 6px; /* Réduit l’espace intérieur */
        white-space: nowrap; /* Empêche le retour à la ligne dans les cellules */
    }

    #archives-table th:first-child,
    #archives-table td:first-child {
        width: 10%; /* Colonne des cases à cocher */
    }

    #archives-table th:nth-child(2),
    #archives-table td:nth-child(2) {
        width: 40%; /* Nom du fichier */
    }

    #archives-table th:nth-child(3),
    #archives-table td:nth-child(3) {
        width: 20%; /* Date */
    }

    #archives-table th:nth-child(4),
    #archives-table td:nth-child(4) {
        width: 10%; /* Heure */
    }

    #archives-table th:last-child,
    #archives-table td:last-child {
        width: 15%; /* Réduire la largeur pour mieux s’adapter */
        min-width: 80px;
        text-align: center;
    }

    #archives-table td.actions {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    #archives-table td.actions .action-btn {
        width: 40px; /* Taille fixe */
        height: 40px;
        text-align: center;
        padding: 0;
    }

    #archives-table td.actions .action-btn i {
        margin-right: 0;
    }

    #archives-table td.actions .action-btn span {
        display: none; /* Cacher le texte */
    }
    #archives-table th:last-child::before {
        content: "\f0ad"; /* Icône FontAwesome "cogs" ⚙ */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        display: inline-block;
    }

    #archives-table th:last-child {
        text-indent: -9999px; /* Masque le texte */
    }
}