/*
 * Styles pour le calendrier et le formulaire en frontend
 * Version: 3.5
 */


/* section 1 : Conteneur principal et entête */

#synexta-calendar-wrapper {
    max-width: 800px;
    margin: 2em auto;
    font-family: sans-serif;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    flex-grow: 1;
}

.calendar-header button {
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5em 0.8em;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.2s, color 0.2s;
    color: #515151 !important;
}

.calendar-header button:hover {
    background-color: #f0f0f0;
}

.calendar-header button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* section 2 : Styles du tableau (le calendrier) */

.table-date {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    table-layout: fixed;
}

.table-date th,
.table-date td {
    border: 1px solid #ddd;
    text-align: center;
    padding: 0.5em;
    height: 50px;
    vertical-align: top;
    position: relative;
}

.table-date th {
    background-color: #f7f7f7;
    font-weight: bold;
}

.table-date td.empty-day {
    background-color: #fafafa;
}


/* section 3 : Styles des cellules de jour */

.numjour {
    font-size: 0.9em;
    font-weight: bold;
    position: absolute;
    top: 5px;
    right: 5px;
}

.day-content {
    margin-top: 25px;
    font-size: 0.8em;
}

.day-content .price {
    font-weight: 400;
    color: #000000;
    opacity: 0.7;
}


/* section 4 : Styles pour les états des jours */

.day-past {
    background-color: #f5f5f5;
    color: #bbb;
}

.day-past .numjour {
    color: #bbb;
}

.disponible-oui {
    background-color: #e8f5e9 !important;
}

.disponible-non {
    background-color: #fa5151 !important;
    color: #fff;
}

.disponible-non .numjour {
    color: #000;
}


/* section 5 : Styles pour la sélection de dates */

.table-date td.selection-start,
.table-date td.selection-end {
    background-color: #1a73e8 !important;
    background: #1a73e8 !important;
    color: #fff !important;
}

.table-date td.selection-start .numjour,
.table-date td.selection-end .numjour {
    color: #fff !important;
}

.table-date td.selection-range {
    background-color: #1a73e8 !important;
    color: white !important;
}

.table-date td.selection-invalid {
    animation: shake 0.5s;
}

@keyframes shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}


/* section 6 : Styles pour les jours de transition bicolores */

.disponible-non-veille {
    background: linear-gradient(to top right, #fa5151 49.5%, #e8f5e9 50.5%);
}

.disponible-oui-veille {
    background: linear-gradient(to top right, #e8f5e9 49.5%, #fa5151 50.5%);
}


/* section 7 : Styles pour la légende du calendrier */

.legende-wrapper {
    max-width: 800px;
    margin: 1em auto 2em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.legende-item {
    display: flex;
    align-items: center;
}

.legende-box {
    width: 15px;
    height: 15px;
    border: 1px solid #ccc;
    margin-right: 8px;
}

.legende-item span {
    font-size: 12px;
}


/* section 8 : Wrapper et logique d'accordéon */

#synexta-reservation-wrapper {
    max-width: 800px;
    margin: 2em auto;
}

#synexta-accordion-trigger {
    width: 100%;
    font-size: 1.2em !important;
    margin-bottom: 1em;
}

#synexta-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s ease-in-out;
    background: #fdfdfd;
    border-radius: 4px;
    padding: 0 1.5em;
}

#synexta-accordion-content.is-open {
    max-height: 2000px;
    padding: 1.5em;
    transition: max-height 1s ease-in-out;
    padding: 10px 0px !important;
}


/* section 9 : Structure générale du formulaire */

#synexta-quote-form .synexta-form-section {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: 1px solid #f0f0f0;
}

#synexta-quote-form .synexta-form-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

#synexta-quote-form h4 {
    margin-top: 0;
    margin-bottom: 1em;
}

.synexta-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

#synexta-quote-form label {
    margin-bottom: 0.5em;
    font-weight: bold;
    font-size: 0.9em;
}

#synexta-quote-form input[type="text"],
#synexta-quote-form input[type="email"],
#synexta-quote-form input[type="tel"],
#synexta-quote-form select,
#synexta-quote-form textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ddd;
    background-color: #fff;
    box-sizing: border-box;
}

.required {
    color: red;
    font-weight: bold;
}


/* section 10 : Styles des éléments spécifiques */

.synexta-participant-row {
    margin-bottom: 10px;
}

.synexta-participant-row:last-of-type {
    margin-bottom: 0;
}

.synexta-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal !important;
    font-size: 0.85em;
    color: #555;
}

.synexta-consent-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

#synexta-submit-quote {
    width: 100%;
    padding: 1em;
    font-size: 1.1em;
    margin-top: 1.5em;
}

.synexta-loader {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

.synexta-loader .spinner {
    float: none;
    margin: 0;
}


/* section 11 : Messages de retour (feedback) */

#synexta-form-feedback {
    padding: 1em;
    margin-top: 1em;
    border-radius: 4px;
    text-align: center;
    display: none;
    /* Cach par défaut */
}

#synexta-form-feedback.success {
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

#synexta-form-feedback.error {
    background-color: #ffcdd2;
    border: 1px solid #d32f2f;
    color: #b71c1c;
}


/* section 12 : Rendu responsif */

@media (max-width: 768px) {
    .calendar-header h2 {
        font-size: 1.2em;
    }
}

@media (max-width: 600px) {
    .synexta-form-grid-2,
    .synexta-participant-row {
        grid-template-columns: 1fr;
    }
}


/* section 13 : Message d'invite sous le calendrier */

.synexta-calendar-prompt {
    text-align: center;
    padding: 15px;
    margin: 20px auto;
    background-color: #f7f7f7;
    border-left: 4px solid #72aee6;
    color: #555;
    max-width: 800px;
}

#synexta-calendar-wrapper .jour-semaine {
    font-weight: 400;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

#synexta-calendar-wrapper thead th {
    overflow: hidden;
    padding: 0px !important;
    vertical-align: middle;
    height: 20px !important;
}

.annee-affichee {
    font-size: 1.2em;
    display: block;
    line-height: 1em;
    margin: 0px !important;
    padding: 0px !important;
    text-align: center;
}

.mois-affiche {
    font-size: 2em;
    display: block;
    line-height: 1em;
    margin: 0px !important;
    padding: 0px !important;
    text-align: center;
}

.synexta-legend-explanation {
    font-size: 14px !important;
    border: 1px solid #ff00002b;
    padding: 10px;
}

.synexta-legend-explanation p {
    padding: 0px;
    margin: 0px;
}

.synexta-reservation-form-text {
    color: #111;
}

.not-allowed-arrival {
    background-color: #fdd;
    cursor: not-allowed;
}

.not-allowed-departure {
    background-color: #dfd;
    cursor: not-allowed;
}