/* ===== Corps de page ===== */
body {
    font-family: "Arial", sans-serif;
    margin: 20px;
    background-color: #f0f2f5;
    color: #333;
}

h2, h3, h4 {
    color: #222;
}

/* ===== Messages ===== */
.error {
    color: #e74c3c;
    font-weight: bold;
}

.success {
    color: #2ecc71;
    font-weight: bold;
}

/* ===== Liens et boutons ===== */
a, button, input[type="submit"], .card-actions a, .user-actions a {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    text-align: center;
}

a:hover, button:hover, input[type="submit"]:hover, .card-actions a:hover, .user-actions a:hover {
    background-color: #2980b9;
}

/* ===== Formulaires ===== */
form label {
    font-weight: bold;
}

input[type="text"], input[type="email"], input[type="password"], select, input[type="file"] {
    padding: 6px 10px;
    margin: 4px 0 10px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 100%;
    max-width: 400px;
}

/* ===== Catégories pliables ===== */
.category-block {
    margin-bottom: 30px;
    border-radius: 8px;
    padding: 10px;
    background-color: #eaf2f8;
    border-left: 6px solid #3498db;
}

.category-title {
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}

/* ===== Liste documents (accordéon) ===== */
.documents-list {
    display: none;            /* cacher toutes les listes au départ */
    flex-wrap: wrap;
    gap: 15px;
    overflow: hidden;         /* éviter dépassement contenu */
    transition: max-height 0.3s ease; /* animation ouverture/fermeture */
}

/* ===== Carte document ===== */
.document-card {
    background-color: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    flex: 1 1 220px;        /* largeur min 220px, flex-grow auto */
    max-width: 280px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.document-card:hover {
    transform: translateY(-3px);
}

.document-card b {
    font-size: 14px;
    margin-bottom: 6px;
}

/* ===== Boutons dans la carte ===== */
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 6px;
}

.card-actions a {
    font-size: 12px;
    color: #fff;
    background-color: #3498db;
    padding: 6px 8px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
}

.card-actions a:hover {
    background-color: #2980b9;
}

/* ===== Actions utilisateurs ===== */
.user-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .documents-list {
        flex-direction: column;
    }
    .document-card {
        width: 100%;
    }
}
