
/* @import "https://cdn.jsdelivr.net/npm/fullcalendar@6.1.8/index.global.min.css"; */
:root {
    --primary: black;
    --secondary: white;
    --inactive: #aaa;
    --duration: 0.3s;
    --couleur_titre: #000fb0;
}
/*
body {
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    margin: 0;
    padding: 20px;
}
*/
h1 {
    text-align: center;
    color: #003366;
}
.calendar-container h2 {
    color: var(--couleur_titre) !important;
}
.calendar-container {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fc-header-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.is-mobile .fc-header-toolbar.fc-toolbar.fc-toolbar-ltr {
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    margin-bottom: 0em !important;
}

.is-mobile .fc .fc-daygrid-body-natural .fc-daygrid-day-events {
    margin-bottom: 0.2em;
    margin-top: 0em;
}


.is-mobile .fc-event-title, .fc-event-time {
    visibility: hidden;
}

.is-mobile .fc-event-title-container {
    text-align: left;
    height: 1.5em; /* évite un collapse de hauteur */
}


.fc-toolbar-chunk:last-child {
    display: flex;
    justify-content: flex-end;
}

.toggle-wrapper {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

.toggle-wrapper input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 70px;
    height: 40px;
    background: black;
    border-radius: 20px;
    transition: all 0.3s ease;
    z-index: 1;
}

.toggle-labels {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    color: white;
}

.toggle-wrapper input:checked ~ .toggle-slider {
    transform: translateX(70px);
}
.toggle-wrapper input:not(:checked) ~ .toggle-labels span:first-child {
    color: white; /* Vue Calendrier active */
}
.toggle-wrapper input:not(:checked) ~ .toggle-labels span:last-child {
    color: grey; /* Vue Calendrier active */
}

.toggle-wrapper input:checked ~ .toggle-labels span:first-child {
    color: grey; /* Vue Liste active */
}
.toggle-wrapper input:checked ~ .toggle-labels span:last-child {
    color: white; /* Vue Liste active */
}

.list-view {
    display: none;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;

}

    
.fc-event-title-container {
    text-align: center;
}

.event-card {
    background: #fff;
    border-left: 0.5em solid #1e90ff;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    text-align: left;
}

.event_formation { border-color:orange; }
.event_sortie { border-color: green; }
.event_piscine { border-color:royalblue; }
.event_fosse { border-color: black; }
.event_secourisme { border-color: darkred; }
.event_autre { border-color: grey; }

.event-title { font-size: 1.2em; margin-bottom: 10px; color: #333; }
.event-date { color: #666; font-size: 0.95em; }

.hidden { display: none; }

.is-mobile .calendar_addons {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* légende */
.legend {
    display: none;
    gap: 0.1em;
    margin: 1em auto;
    font-size: x-small;
}

.is-mobile .legend {
    display: flex;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: white;
    min-width: 60px;
    text-align: center;


    gap: 6px;
    font-size: 0.9em;
    color: #333;
}

.color-box {
    width: 16px;
    height: 16px;
    display: inline-block;
    border-radius: 3px;
    border: 1px solid #ccc;
}

/* Couleurs des catégories */
.color-box.event_piscine     { background-color: royalblue; }
.color-box.event_secourisme  { background-color: darkred; }
.color-box.event_formation   { background-color: orange; }
.color-box.event_fosse       { background-color: black; }
.color-box.event_autre       { background-color: grey; }


/* toogle button */
.control {
    position: relative;
    width: 200px;
    height: 3em;
    background: var(--secondary);
    border-radius: 50px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    font-size: initial;
}

.control input {
    display: none;
}

.control label {
    flex: 1;
    text-align: center;
    z-index: 1;
    cursor: pointer;
    color: var(--inactive);
    transition: color var(--duration);
}

.indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--primary);
    border-radius: 50px;
    transition: transform var(--duration);
    z-index: 0;
}

#liste:checked ~ .indicator {
    transform: translateX(100%);
}

#calendrier:checked ~ label[for="calendrier"],
#liste:checked ~ label[for="liste"] {
    color: var(--secondary);
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1em !important;
}

.fc-button-group button, button.fc-today-button.fc-button.fc-button-primary {
    box-shadow: none !important;
    background: black !important;
    color: white !important;
    font-size: 0.9em !important;
}

.fc-next-button, .fc-prev-button {
    border-radius: 0.5em !important;
    margin-left: 2px !important;
}

.fc-today-button {
    border-radius: 2em !important;
    background: black !important;
    color: white !important;
    font-size: 0.9em !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
button.fc-today-button.fc-button.fc-button-primary {
    background: royalblue !important;
    color: white !important;
    border: none;
}

button.fc-today-button.fc-button.fc-button-primary:hover {
    opacity: 0.8 !important;
    cursor: pointer;
    box-shadow: 0 0 8px royalblue !important;
}

button.fc-today-button.fc-button.fc-button-primary:disabled {
    background: grey !important;
    box-shadow: none !important;
}

.fc .fc-daygrid-day-frame {
    height: 8em;
/*    overflow: hidden; */
    display: flex;
    flex-direction: column;
}

.is-mobile .fc .fc-daygrid-day-frame {
    height: 6em;
}

.fc .fc-daygrid-day-number {
    padding: 0 4px 0 4px !important;
}
/* Tooltip */
/* Tooltip custom */
.fc-event {
    position: relative;
    cursor: pointer;
}

.fc-event .tooltip-custom {
    visibility: hidden;
    opacity: 0;
    max-width: 90vw;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    border-radius: 4px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s;
    white-space: nowrap;
    pointer-events: none;
}
.fc-event:hover .tooltip-custom {
    visibility: visible;
    opacity: 1;
}

.is-mobile .fc-event:last-child .tooltip-custom {
    left: auto !important;
    right: 0 !important;
    transform: none;
}

.is-mobile .fc-event .tooltip-custom {
    max-width: 90vw;
/*    left: 50%;
    transform: translateX(-50%); */
    white-space: normal;
    word-wrap: break-word;
}

.is-mobile .fc-event {
    overflow: visible; /* Permet au tooltip de dépasser si besoin */
}
