/*--------------------------------------------------------*/
/* Variables CSS modernes                                 */
/*--------------------------------------------------------*/
:root {
    --primary: #2A9D8F;  /* Vert océan moderne */
    --secondary: #264653; /* Bleu ardoise profond */
    --accent: #E9C46A;   /* Jaune doré */
    --background: #F8F9FA;
    --text: #2B2D42;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #2A9D8F 0%, #264653 100%);
    --radius: 12px; /* Rayon des coins arrondis */
    --transition: all 0.3s ease; /* Transition fluide */

    /* Couleurs spécifiques pour l'intro */
    --intro-bg: white; /* Fond clair par défaut */
    --intro-text: #2B2D42; /* Texte sombre par défaut */
}

/*--------------------------------------------------------*/
/* Reset et styles de base                                */
/*--------------------------------------------------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/*--------------------------------------------------------*/
/* En-tête                                                */
/*--------------------------------------------------------*/
header {
    background: var(--gradient);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/*--------------------------------------------------------*/
/* Section d'intro                                        */
/*--------------------------------------------------------*/
.intro {
    background-color: var(--intro-bg); /* Utilisation de la variable */
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 2rem auto;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--intro-text); /* Utilisation de la variable */
    box-shadow: var(--shadow);
    max-width: 800px;
}

.intro strong {
    color: var(--primary);
    font-weight: 600;
}

.intro .highlight {
    color: var(--accent);
    font-weight: 600;
    font-style: italic;
}

/*--------------------------------------------------------*/
/* Bouton de retour                                       */
/*--------------------------------------------------------*/
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.back-button:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/*--------------------------------------------------------*/
/* Barre de recherche                                     */
/*--------------------------------------------------------*/
.search-bar {
    position: relative;
    margin-bottom: 2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
}

.search-bar i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
}

/*--------------------------------------------------------*/
/* Compteur de documents                                  */
/*--------------------------------------------------------*/
.document-count {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 500;
    text-align: center;
    color: var(--text);
}

#visible-count {
    color: var(--primary);
    font-weight: 600;
}

#total-count {
    color: var(--secondary);
    font-weight: 600;
}

/*--------------------------------------------------------*/
/* Tableau des fiches                                     */
/*--------------------------------------------------------*/
.file-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    margin-bottom: 2rem;
}

.file-table th {
    background: var(--secondary);
    color: white;
    padding: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
}

.file-table th:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.file-table th:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.file-table td {
    padding: 1rem;
    background: white;
    border: none;
    transition: var(--transition);
}

.file-table tr {
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    transition: var(--transition);
}

.file-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/*--------------------------------------------------------*/
/* Vignettes                                              */
/*--------------------------------------------------------*/
.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.thumbnail:hover {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 60px;
    height: 60px;
    background: #F1FAEE;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

/*--------------------------------------------------------*/
/* Liens stylisés                                         */
/*--------------------------------------------------------*/
.file-table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.file-table a:hover {
    color: var(--accent);
}

/*--------------------------------------------------------*/
/* Responsive design                                      */
/*--------------------------------------------------------*/
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .file-table th, .file-table td {
        padding: 0.75rem;
    }

    .thumbnail, .no-thumbnail {
        width: 50px;
        height: 50px;
    }
}

/*--------------------------------------------------------*/
/* Mode sombre                                            */
/*--------------------------------------------------------*/
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #4ECDC4;
        --secondary: #1A535C;
        --background: #1E1E1E;
        --text: #F8F9FA;

        /* Couleurs spécifiques pour l'intro en mode sombre */
        --intro-bg: #2B2B2B; /* Fond sombre */
        --intro-text: #F8F9FA; /* Texte clair */
    }

    .container {
        background: #2B2B2B;
    }

    .file-table td {
        background: #2B2B2B;
    }

    .file-table tr {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    }

    .file-table tr:hover {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }

    .no-thumbnail {
        background: #3A3A3A;
    }
}

/*--------------------------------------------------------*/
/* Animation d'entrée                                     */
/*--------------------------------------------------------*/
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-table tr {
    animation: fadeIn 0.4s ease forwards;
}

/*--------------------------------------------------------*/
/* Pied de page                                           */
/*--------------------------------------------------------*/
footer {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--primary);
    margin: 0 0.5rem;
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}