/* --- Structure Générale --- */
body {
    display: flex;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    height: 100vh;
    background-color: #f4f4f9;
}

aside#sidebar {
    width: 250px;
    background-color: #ffffff;
    padding: 15px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

main#planning-container {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

h2, h3 {
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

/* --- Palette de Matières --- */
#palette {
    margin-bottom: 20px;
}

.bloc-matiere {
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    font-weight: bold;
    color: #333;
    cursor: move;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.1);
}

/* --- Grille du Planning (Jour) --- */
#planning-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.jour {
    min-height: 100px; /* Réduit car on ne dépose plus directement dedans */
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    cursor: pointer; /* Indique qu'on peut cliquer */
    transition: all 0.2s ease;
    position: relative;
}

.jour:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.jour-header {
    padding: 5px 8px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
    font-weight: 500;
}

.jour-header strong {
    font-size: 1.1em;
}

/* Indicateur visuel si un jour a des données */
.jour .data-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background-color: #007bff;
    border-radius: 50%;
    display: none; /* Caché par défaut */
}

.jour.has-data .data-indicator {
    display: block; /* Montré si le jour a des données */
}


/* --- Fenêtre Modale (Vue horaire) --- */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-overlay.hidden {
    display: none;
}

#modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    height: 80vh;
    overflow-y: auto;
    position: relative;
}

#modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #888;
}

#modal-hourly-grid {
    margin-top: 20px;
}

.hourly-slot {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 5px 0;
}

.hourly-time {
    width: 60px;
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
}

.hourly-drop-zone {
    flex-grow: 1;
    min-height: 40px;
    border: 2px dashed transparent;
    border-radius: 4px;
    padding: 2px;
}

/* Feedback visuel lors du survol d'une zone horaire */
.hourly-drop-zone.drag-over {
    background-color: #e0ffe0;
    border-color: #999;
}

/* Style pour un bloc déplacé dans le planning horaire */
.bloc-planning {
    padding: 8px;
    border-radius: 5px;
    font-weight: bold;
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: move;
}


/* --- Statistiques & Actions --- */
#stats-content p {
    margin: 5px 0;
    font-size: 0.9em;
}

#btn-save {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: auto;
}
#btn-save:hover {
    background-color: #0056b3;
}
#save-status {
    text-align: center;
    font-size: 0.8em;
    margin-top: 5px;
}