/* ============================================================
   FICHIER : style.css (COMPLET ET MODIFIÉ POUR LE BOUTON LOGIN)
   ============================================================ */
/* --- CORRECTIF SCROLLBAR 1PX --- */
/* Ceci oblige les bordures et padding à rester DANS les dimensions définies */
*, *::before, *::after {
    box-sizing: border-box;
}
:root {
    /* Couleurs Thème Clair (Par défaut) */
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --primary: #007bff;
    --primary-hover: #0056b3;
    --border: #dddddd;
    --input-bg: #ffffff;
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --busy-bg: #e0e0e0;
    --busy-pattern: #dcdcdc;
}
body.dark {
    /* Couleurs Thème Sombre */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #aaaaaa;
    --primary: #4dabf7;
    --primary-hover: #339af0;
    --border: #333333;
    --input-bg: #2c2c2c;
    --success-bg: #1b4b28;
    --success-text: #a5d6a7;
    --error-bg: #4a181b;
    --error-text: #ef9a9a;
    --busy-bg: #333333;
    --busy-pattern: #444444;
}
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden; /* Sécurité supplémentaire */
}
/* --- Mises en page (Layouts) --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
/* Conteneur Pleine Largeur (pour l'agenda public) */
.container-fluid {
    width: 98%;
    max-width: 100%;
    margin: 20px auto;
    padding: 0 10px;
}
/* --- Composants Globaux --- */
.card, .container-box {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
}
input, select, textarea, button {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 10px;
    font-family: inherit;
}
button { cursor: pointer; font-weight: bold; transition: 0.2s; }
/* Bouton Accueil (Retour) */
.home-btn { 
    display: inline-block; 
    margin-bottom: 15px; 
    padding: 8px 15px; 
    background: var(--input-bg); 
    border: 1px solid var(--border); 
    border-radius: 5px; 
    color: var(--text-color); 
    text-decoration: none; 
    font-size: 0.9em; 
    font-weight: bold; 
}
.home-btn:hover { background: var(--border); }
/* Bouton Thème Flottant */
.toggle-theme {
    position: fixed;
    top: 20px;
    right: 20px;
    width: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 30px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
/* Messages d'état */
.success { background: var(--success-bg); color: var(--success-text); padding: 15px; border-radius: 5px; text-align: center; margin-bottom: 20px; }
.error { background: var(--error-bg); color: var(--error-text); padding: 15px; border-radius: 5px; text-align: center; margin-bottom: 20px; }

/* --- MODIFICATION APPLIQUÉE ICI --- */
/* --- Barre de Navigation (Haut de Page) --- */
.navbar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000; /* S'assure qu'il est au-dessus du contenu */
}
/* On réinitialise les styles de la liste pour ce contexte */
.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
/* Style du bouton de connexion */
.login-btn {
    display: inline-block;
    padding: 8px 15px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--primary); /* Utilise la couleur primaire pour le texte */
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background 0.2s;
}
.login-btn:hover {
    background: var(--border);
}
/* --- FIN DE LA MODIFICATION --- */

/* --- Tables (Admin & Dashboard) --- */
table { width: 100%; border-collapse: collapse; font-size: 0.9em; margin-top: 10px; }
th, td { padding: 5px; border-bottom: 1px solid var(--border); text-align: left; }
/* --- Page Accueil (Directory) --- */
.profile { text-align: center; margin-bottom: 30px; }
.profile-img { max-width: 200px; height: auto; }
/* Les anciennes règles .navbar ul et .nav-link ont été supprimées d'ici */
.search-bar { margin-bottom: 30px; }
.search-bar input { padding: 15px; border-radius: 30px; font-size: 1.1rem; }
.category { margin-bottom: 40px; }
.category h2 { border-bottom: 2px solid var(--border); padding-bottom: 10px; margin-bottom: 20px; color: var(--primary); }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.link {
    display: block; padding: 20px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; text-align: center; text-decoration: none; color: var(--text-color); transition: transform 0.2s;
}
.link:hover { transform: translateY(-5px); border-color: var(--primary); color: var(--primary); }
.link strong { display: block; font-size: 1.1em; margin-bottom: 5px; }
.footer { text-align: center; color: var(--text-muted); margin-top: 50px; padding: 20px; }
/* --- Calendrier Public (Agenda) --- */
/* Navigation Semaine */
.week-nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    background: var(--card-bg); 
    padding: 10px; 
    border-radius: 8px; 
    border:1px solid var(--border); 
}
.week-nav a { 
    padding: 8px 15px; 
    background: var(--input-bg); 
    border-radius: 5px; 
    border:1px solid var(--border); 
    text-decoration: none; 
    color: var(--text-color); 
    white-space: nowrap;
}
/* Grille Calendrier */
.calendar-wrapper { 
    overflow-x: auto; 
    width: 100%;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px; /* Petit espace pour le scrollbar si nécessaire */
}
.calendar-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background-color: var(--border);
    border: 1px solid var(--border);
    gap: 1px;
    border-radius: 8px;
    overflow: hidden;
    min-width: 1000px;
    width: 100%;
}
.cal-header {
    background-color: var(--input-bg);
    font-weight: bold;
    text-align: center;
    padding: 10px 5px;
    font-size: 0.9rem;
    position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--text-muted);
}
.cal-time {
    background-color: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight:bold;
}
.cal-cell {
    background-color: var(--card-bg);
    height: 45px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.cal-cell:hover {
    background-color: var(--primary);
    opacity: 0.5;
}
.cell-label { 
    font-size: 0.8em; 
    color: var(--text-color); 
    opacity: 0.5; 
    font-weight: bold; 
    pointer-events: none; 
    user-select: none; 
}
/* Case indisponible */
.unavailable {
    background-color: var(--busy-bg) !important;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}
/* Case partiellement occupée */
.partially-busy {
    background-image: linear-gradient(45deg, var(--busy-bg) 25%, transparent 25%, transparent 50%, var(--busy-bg) 50%, var(--busy-bg) 75%, transparent 75%, transparent);
    background-size: 8px 8px;
}
/* Sélecteur de créneau dans le modal */
.time-slots-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}
.time-slots-container div {
    display: flex;
    align-items: center;
    gap: 5px;
}
.time-slots-container input[type="radio"] {
    width: auto;
    margin: 0;
}
.time-slots-container label {
    font-weight: bold;
    cursor: pointer;
}
/* Légende */
.legend { display: flex; gap: 20px; justify-content: center; margin-top: 15px; font-size: 0.9em; color: var(--text-muted); }
.dot { width: 12px; height: 12px; display: inline-block; margin-right: 5px; border: 1px solid var(--border); }
/* --- Modals (Pop-ups) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    display: none;
    justify-content: center; align-items: center;
    z-index: 9999;
}
.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}
.modal-content label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}
/* --- Styles utilitaires Admin/Dashboard --- */
.grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.full { grid-column: span 2; }
/* --- RESPONSIVE NAVIGATION --- */
@media (max-width: 800px) {
    .grid { grid-template-columns: 1fr !important; }
    .week-nav { flex-wrap: wrap; justify-content: center; }
    .week-nav a { padding: 5px 8px; font-size: 0.8rem; }
}