:root {
    --bg-dark: #010409;
    --bg-medium: #0d1117;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-blue: #3399ff;
    --accent-blue-hover: #58a6ff;
    --font-family-text: 'Roboto', sans-serif;
    --font-family-title: 'Orbitron', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background-color: var(--bg-medium);
    color: var(--text-primary);
    font-family: var(--font-family-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 2rem 0; }
main { flex-grow: 1; }
h1, h2, h3 { font-family: var(--font-family-title); color: white; margin-bottom: 1rem; }
h1 { font-size: 3rem; text-align: center; }
h2 { font-size: 2.2rem; border-bottom: 2px solid var(--accent-blue); padding-bottom: 0.5rem; margin-bottom: 2rem; }
h3 { font-size: 1.5rem; }
a { color: var(--accent-blue); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--accent-blue-hover); }
.btn { display: inline-block; padding: 0.8rem 1.5rem; border: 1px solid var(--accent-blue); border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px; }
.btn-primary { background-color: var(--accent-blue); color: var(--bg-dark); }
.btn-primary:hover { background-color: var(--accent-blue-hover); transform: translateY(-3px); box-shadow: 0 4px 15px rgba(51, 153, 255, 0.4); }
.btn-secondary { background-color: transparent; color: var(--accent-blue); }
.btn-secondary:hover { background-color: var(--accent-blue); color: var(--bg-dark); }
.subtitle { font-size: 1.2rem; text-align: center; color: var(--text-secondary); margin-bottom: 2rem; }
.content-section { padding: 4rem 0; }
.grid-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.card { background-color: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5); }
.card img { width: 100%; height: 225px; object-fit: cover; }
.card-content { padding: 1.5rem; }
.cta-section { text-align: center; background-color: var(--bg-dark); padding: 3rem; border-radius: 8px; }
.cta-section h2 { border: none; }

/* Styles pour les formulaires d'authentification */
.auth-form-container {
    max-width: 450px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.auth-form-container h2 {
    text-align: center;
    border-bottom: none;
}
.auth-form .form-group {
    margin-bottom: 1.5rem;
}
.auth-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}
.auth-form .form-group input {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-medium);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 1rem;
}
.auth-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}
.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
}
.error-message {
    background-color: #4a0404;
    color: #ffbaba;
    border: 1px solid #9e2323;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 1rem;
}
.success-message {
    background-color: #032d12;
    color: #a7f0ba;
    border: 1px solid #16652f;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 1rem;
}

/* Styles pour le Dashboard Admin */
.admin-dashboard .subtitle { text-align: left; }
.dashboard-section {
    background-color: var(--bg-dark);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.section-header h2 {
    border: none;
    margin: 0;
}
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.data-table th { background-color: #161b22; font-family: var(--font-family-title); }
.data-table .actions { display: flex; gap: 0.5rem; }
.btn-sm { font-size: 0.8rem; padding: 0.4rem 0.8rem; border-radius: 4px; border: 1px solid transparent; cursor: pointer; }
.btn-edit { background-color: var(--accent-blue); color: var(--bg-dark); }
.btn-delete { background-color: #8b1c1c; color: #f5c8c8; border-color: #b82a2a; }
.status { padding: 0.2rem 0.5rem; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.status.active { background-color: rgba(38, 166, 65, 0.2); color: #3fb950; }
.status.inactive { background-color: rgba(139, 148, 158, 0.2); color: #8b949e; }

/* Filtres et Pagination */
.filter-form { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.pagination a { color: var(--text-primary); padding: 0.5rem 1rem; border: 1px solid var(--border-color); border-radius: 4px; }
.pagination a:hover { background-color: var(--border-color); }
.pagination a.active { background-color: var(--accent-blue); color: var(--bg-dark); border-color: var(--accent-blue); }

/* Modale */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7); }
.modal-content { background-color: var(--bg-dark); margin: 10% auto; padding: 2rem; border: 1px solid var(--border-color); width: 90%; max-width: 500px; border-radius: 8px; position: relative; }
.close-btn { color: var(--text-secondary); float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: white; }
#modal-title { margin-top: 0; }
#user-form small { color: var(--text-secondary); font-size: 0.8rem; }

.btn-activate { background-color: #238636; color: #c2eacb; border-color: #3fb950; }

/* ---- Gestion de l'accordéon d'articles ---- */

/* Par défaut, on cache le texte complet */
.card .full-text {
    display: none;
}
/* Quand la carte est ouverte, on cache le texte court et on montre le texte complet */
.card.is-open .short-text {
    display: none;
}
.card.is-open .full-text {
    display: block;
}

/* Gestion du texte du bouton "Lire la suite / Réduire" */
.card .read-more-btn .text-reduce {
    display: none;
}
.card.is-open .read-more-btn .text-expand {
    display: none;
}
.card.is-open .read-more-btn .text-reduce {
    display: inline;
}

.article-page h1 { text-align: left; }
.article-page .article-meta { color: var(--text-secondary); margin-bottom: 1rem; }
.article-page .article-image-full { width: 100%; max-width: 800px; height: auto; border-radius: 8px; margin: 1.5rem 0; }
.article-page .article-content-full { font-size: 1.1rem; line-height: 1.8; }
.article-page hr { border: none; border-top: 1px solid var(--border-color); margin: 1.5rem 0; }