/* Fichier : /assets/css/admin_styles.css */

/* --- Variables et Styles Globaux --- */
:root {
    --primary-color: #005a9c; /* Bleu institutionnel */
    --secondary-color: #e1000f; /* Rouge pour actions (suppression) */
    --light-gray: #f2f2f2;
    --medium-gray: #ccc;
    --dark-gray: #333;
    --background-color: #f8f9fa;
    --text-color: #212529;
    --success-color: #28a745;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#admin-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

h1, h2, h3 {
    color: var(--dark-gray);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

button {
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--primary-color);
    color: white;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #004170;
}

/* --- En-tête et Navigation --- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
    margin-bottom: 2rem;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    text-decoration: none;
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 4px;
}

.admin-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-session-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Tableaux et Listes --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

thead {
    background-color: var(--light-gray);
}

#students-list {
    list-style: none;
    padding: 0;
}

#students-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
}
#students-list li:nth-child(even) {
    background-color: var(--light-gray);
}
.user-info { display: flex; flex-direction: column; }
.user-class { font-style: italic; color: #555; font-size: 0.9em; }

/* --- Formulaires --- */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* Important pour que le padding ne casse pas la largeur */
}

textarea {
    min-height: 150px;
}

.modal-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

/* --- Modal (Pop-up) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
}

/* --- Classes Utilitaires --- */
.hidden {
    display: none !important;
}

button.btn-delete-ressource, button.btn-delete-user {
    background-color: var(--secondary-color);
}
button.btn-delete-ressource:hover, button.btn-delete-user:hover {
    background-color: #b4000c;
}