/* style.css */
:root {
    /* --- PAR DÉFAUT : THÈME SOMBRE --- */
    --bg: #121212;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-muted: #bbbbbb;
    --primary: #81ecec; /* Cyan clair pour ressortir sur le noir */
    --accent: #e67e22;  /* Orange Miel */
    --border: #333333;
    --shadow: 0 4px 6px rgba(0,0,0,0.4);
}

/* --- CLASSE LIGHT-MODE (Pour ceux qui veulent du blanc) --- */
body.light-mode {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #333333;
    --text-muted: #666666;
    --primary: #2c3e50; /* Bleu nuit */
    --accent: #d35400;
    --border: #dddddd;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header --- */
header {
    background: var(--card-bg);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--accent);
    font-weight: bold;
    text-decoration: none;
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Boutons */
.btn-toggle-theme {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-toggle-theme:hover { background: rgba(255,255,255,0.1); }

.btn-admin {
    background-color: var(--primary);
    color: #121212 !important; /* Texte noir sur fond cyan */
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}
body.light-mode .btn-admin { color: white !important; } /* Texte blanc sur fond bleu nuit */

.btn-logout {
    color: #e74c3c !important;
    text-decoration: none;
    font-size: 1.1rem;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

h1, h2, h3 { color: var(--text); }

/* --- Cartes --- */
.grid-cours, .grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

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

.card-img {
    height: 160px;
    background: var(--primary); /* Couleur variable selon le thème */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--bg); /* L'icône prend la couleur du fond de page */
}

.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { margin-top: 0; }
.card-desc { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; flex-grow: 1; }

.badge {
    display: inline-block; padding: 4px 8px; border-radius: 4px; 
    font-size: 0.75rem; font-weight: bold; margin-bottom: 10px; width: fit-content;
}
.badge.video { background: rgba(230, 126, 34, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.badge.pdf { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }

.btn-main {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    display: block;
    box-sizing: border-box;
}
.btn-main:hover { opacity: 0.9; }

/* --- Formulaires --- */
.auth-box {
    max-width: 400px;
    margin: 60px auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
input, select, textarea {
    width: 100%; padding: 12px; margin-bottom: 15px;
    background: var(--bg); color: var(--text);
    border: 1px solid var(--border); border-radius: 6px;
    box-sizing: border-box;
}