/* --- Style général --- */
:root {
    --bg-color: #1e1e24;
    --surface-color: #2c2c34;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #999999;
    --accent-color: #58a6ff;
    --border-color: #3a3a42;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 2rem;
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    line-height: 1.6;
}

/* --- Conteneur principal --- */
.container {
    max-width: 900px;
    margin: auto;
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

h1 {
    color: #f1f1f1;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 2em;
}

/* --- Style de l'arborescence (Tree View) --- */
.tree-view ul {
    list-style-type: none;
    padding-left: 25px;
    margin: 5px 0;
    border-left: 1px solid var(--border-color);
}

.tree-view li {
    padding: 6px 0;
    position: relative;
}

/* Cache les sous-listes par défaut */
.tree-view li ul {
    display: none;
}

/* Affiche les sous-listes quand le parent a la classe 'expanded' */
.tree-view li.expanded > ul {
    display: block;
}

/* Style pour le nom du dossier cliquable */
.folder-toggle {
    cursor: pointer;
    font-weight: 500;
    user-select: none; /* Empêche la sélection du texte */
    transition: color 0.2s ease;
}
.folder-toggle:hover {
    color: var(--accent-color);
}

/* Style pour les fichiers */
.file-item a {
    text-decoration: none;
    color: var(--primary-text-color);
    transition: color 0.2s ease;
}
.file-item a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Icônes via des pseudo-éléments ::before */
.folder-toggle::before {
    content: '▶'; /* Flèche repliée */
    display: inline-block;
    color: var(--accent-color);
    transition: transform 0.2s ease-in-out;
    margin-right: 10px;
    font-size: 0.8em;
}
.file-item a::before {
    content: '📎'; /* Trombone pour fichier */
    margin-right: 10px;
    opacity: 0.7;
}

/* Rotation de la flèche quand le dossier est déplié */
.tree-view li.expanded > .folder-toggle::before {
    transform: rotate(90deg);
}

/* Affichage de la taille du fichier */
.file-size {
    font-size: 0.85em;
    color: var(--secondary-text-color);
    margin-left: 15px;
    font-style: italic;
}

.error-message {
    color: #ff5858;
    background-color: rgba(255, 88, 88, 0.1);
    border: 1px solid #ff5858;
    padding: 1rem;
    border-radius: 5px;
}