@charset "UTF-8";
/* CSS Document */

/* Style global simple et neutre */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.planning-container {
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

h1, h2 {
    margin-top: 0;
    text-align: center;
}

/* Alertes */

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.alert-success {
    background: #e6f4ea;
    border: 1px solid #9ad29f;
    color: #256c2d;
}

.alert-error {
    background: #fde8e8;
    border: 1px solid #f5b5b5;
    color: #b02222;
}

/* En-tête du calendrier */

.calendar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.calendar-title {
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-nav,
.btn-today,
.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 2px 0 2px 0;
}

.btn-nav {
    background: #e0e0e0;
}

.btn-today {
    background: #d0e8ff;
}

.btn-primary {
    background: #3c7dd9;
    color: #ffffff;
}

.btn-secondary {
    background: #cccccc;
}

.btn-danger {
    background: #e74c3c;
    color: #ffffff;
}

/* Tableau du calendrier */

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    table-layout: fixed;
}

.calendar-table th,
.calendar-table td {
    border: 1px solid #dddddd;
    text-align: center;
    padding: 4px;
    vertical-align: top;
}

.calendar-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Styles des jours */

.calendar-day {
    height: 70px;
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

/* Couleur des jours du mois en cours */
.day-current-month {
    background: #ffffff;
}

/* Couleur des week-ends (samedi + dimanche) */
.day-weekend {
    background: #fff6e5;
}

/* Couleur des jours hors mois en cours */
.day-other-month {
    background: #f0f0f0;
    color: #999999;
}

/* Jour du jour ("surveillance") */
.day-today {
    box-shadow: 0 0 0 2px #d32f2f inset;
}

/* Jour avec au moins un rendez-vous (classe informative) */
.day-has-rdv {
}

/* Effet survol */
.calendar-day:hover {
    outline: 2px solid #3c7dd9;
}

/* Numéro du jour */
.day-number {
    position: absolute;
    top: 4px;
    left: 4px;
    font-weight: 600;
}

/* Puce parfaitement ronde pour indiquer des rendez-vous */
.day-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3c7dd9;
    position: absolute;
    bottom: 6px;
    right: 6px;
}

/* Nombre de rendez-vous à côté de la puce */
.day-dot-count {
    position: absolute;
    bottom: 2px;
    right: 20px;
    font-size: 0.75rem;
    color: #3c7dd9;
    font-weight: bold;
}

/* Légende */

.calendar-legend {
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.legend-box {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 4px;
}

.legend-current {
    background: #ffffff;
    border: 1px solid #cccccc;
}

.legend-weekend {
    background: #fff6e5;
    border: 1px solid #ffcc80;
}

.legend-other {
    background: #f0f0f0;
    border: 1px solid #cccccc;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3c7dd9;
    display: inline-block;
    margin-left: 10px;
}

/* Modale */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    max-width: 70%;
    /*width: 100%;*/
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    position: absolute;
    right: 8px;
    top: 6px;
    cursor: pointer;
}

.modal-date {
    text-align: center;
    font-weight: 500;
    margin-top: 0;
}

/* Formulaire */

.form-row {
    margin-bottom: 10px;
}

.form-row label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row select,
.form-row textarea,
.form-row input[type="date"],
.form-row input[type="time"],
.form-row input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #cccccc;
    font-size: 0.9rem;
}

.form-row textarea {
    resize: vertical;
}

.form-row .help-text {
    font-size: 0.8rem;
    color: #FF0004;
}

.text-right {
    text-align: right;
}

.char-counter {
    font-size: 0.8rem;
    text-align: right;
    color: #666666;
}

/* Table admin */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    border: 1px solid #dddddd;
    padding: 4px 6px;
}

.admin-table th {
    background: #f0f0f0;
    font-weight: 600;
}

/* Boîte message dans la modale admin */

.admin-message-box {
    border: 1px solid #dddddd;
    background: #fafafa;
    padding: 6px 8px;
    font-size: 0.85rem;
    max-height: 120px;
    overflow: auto;
    white-space: pre-wrap;
}

/* Barre de filtres admin */

.admin-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    background: #fafafa;
}

.admin-filters-form,
.admin-settings-form,
.admin-deleteall-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.filter-group label {
    margin-bottom: 2px;
}

.filter-group select,
.filter-group input[type="number"] {
    width: auto;
}

.filter-buttons {
    display: flex;
    gap: 5px;
}

.info-group span {
    display: inline-block;
}

/* Pagination */

.pagination {
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
}

.pagination a {
    margin: 0 4px;
    text-decoration: none;
}

.pagination strong {
    margin: 0 4px;
}

/* =====================================
   START BLOC LOGO ET COMPTEUR
======================================*/
/* Le conteneur parent */
.container-header {
    max-width: 980px;
    margin: 0 auto 20px;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between; /* Espace maximum entre les deux blocs */
    align-items: center;           /* Aligne verticalement le logo et le badge */
}

/* Le bloc contenant le logo */
.bloc-gauche {
    display: flex;
    align-items: center;
}

/* Le bloc contenant le statut et les futurs boutons */
.bloc-droit {
    display: flex;
    gap: 15px;                     /* Espace entre le badge et les futurs boutons */
    align-items: center;
    text-align: right;
}

/* Style rapide pour le badge (optionnel)
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    background-color: #f0f0f0;
    font-family: sans-serif;
} */

/* Conteneur pour positionner l'infobulle */
/* Le Badge */
.badge-custom {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: bold;
    color: #ffffff;
    cursor: help;
}

/* Couleurs 
.badge-custom.ouvert { background-color: #2ecc71 !important; }
.badge-custom.ferme { background-color: #e74c3c !important; }*/

/* 1. L'INFOBULLE (Le rectangle noir) */
.badge-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 130%;            /* Affiche EN DESSOUS (au lieu de bottom: 130%) */
    left: 40%;           /* Décale légèrement vers la gauche (au lieu de 50%) */
    transform: translateX(-50%) translateY(-10px); /* Animation qui monte */
    
    background: #2c3e50;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* 2. LA FLÈCHE (Elle doit maintenant pointer vers le haut) */
.badge-custom::before {
    content: "";
    position: absolute;
    top: 130%;           /* Positionnée entre le badge et l'infobulle */
    left: 20%;           /* Alignée avec le décalage de l'infobulle */
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: #2c3e50; /* Flèche vers le haut */
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* 3. AFFICHAGE AU SURVOL */
.badge-custom:hover::after, 
.badge-custom:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.timer { font-weight: normal; font-size: 0.9em; margin-left: 5px; }

/* =====================================
   END BLOC LOGO ET COMPTEUR
======================================*/

/* Responsive */

@media (max-width: 800px) {
    .admin-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-filters-form,
    .admin-settings-form,
    .admin-deleteall-form {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 600px) {
    .calendar-header {
        flex-direction: column;
    }

    .calendar-table th,
    .calendar-table td {
        padding: 2px;
        font-size: 0.75rem;
    }

    .calendar-day {
        height: 55px;
    }
}
