/**
 * Styles frontend pour BookingVO
 * Gère l'apparence de la modal et du calendrier
 */

/* Styles pour la fenêtre modale */
.bookingvo-modal-container {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.bookingvo-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.bookingvo-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.bookingvo-modal-close:hover {
    color: #333;
}

/* Styles pour le calendrier */
#bookingvo-modal-calendar-container {
    padding: 15px 0;
}

/* Style pour le calendrier réduit */
.calendar-reduced {
    transition: all 0.3s ease;
    min-width: 280px;
    margin: 0 auto;
}

.calendar-reduced .bookingvo-calendar-table {
    width: 100%;
    margin: 0 auto;
}

/* Styles spécifiques pour le calendrier réduit */
.calendar-reduced .day {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.calendar-reduced .bookingvo-calendar-table th {
    font-size: 11px;
}

/* Assurer que les jours restent alignés avec les jours de la semaine */
@media (max-width: 768px) {
    .bookingvo-dates {
        width: 100%;
    }
    
    .bookingvo-weekdays, .bookingvo-days {
        width: 100%;
    }
    
    .day {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .bookingvo-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .calendar-reduced {
        min-width: 100%;
        padding: 10px;
    }
}

/* Styles pour le formulaire de rendez-vous */
.bookingvo-form-container {
    margin-top: 20px;
}

.bookingvo-form-container input[type="text"],
.bookingvo-form-container input[type="email"],
.bookingvo-form-container input[type="tel"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bookingvo-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.bookingvo-form-container .bookingvo-submit-btn {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.bookingvo-form-container .bookingvo-submit-btn:hover {
    background-color: #135e96;
}

/* Styles pour les messages de confirmation */
.bookingvo-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.bookingvo-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bookingvo-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bookingvo-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Styles pour les indications de chargement */
.bookingvo-loading {
    text-align: center;
    padding: 20px;
}

/* ===== Styles spécifiques au calendrier ===== */
.bookingvo-calendar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

.bookingvo-header {
    text-align: center;
    margin-bottom: 25px;
}

.bookingvo-header h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.bookingvo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.bookingvo-dates {
    flex: 1;
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 12px;
    overflow: hidden;
}

.bookingvo-month {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.bookingvo-month button {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555;
    padding: 5px 10px;
    transition: color 0.2s;
}

.bookingvo-month button:hover {
    color: #2271b1;
}

.current-month {
    font-size: 16px;
    font-weight: 600;
}

.bookingvo-weekdays {
    display: none; /* Masquer l'ancienne structure */
}

.weekday {
    text-align: center;
    padding: 3px 0;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    box-sizing: border-box;
    width: 100%;
}

.bookingvo-days {
    width: 100%;
}

/* Styles pour le tableau du calendrier */
.bookingvo-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.bookingvo-calendar-table th {
    text-align: center;
    padding: 3px 0;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.bookingvo-calendar-table td {
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
}

.day {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    margin: 0 auto;
    box-sizing: border-box;
}

.day:not(.disabled):hover {
    background-color: rgba(34, 113, 177, 0.1);
}

.day.selected {
    background-color: #2271b1 !important;
    color: white !important;
}

.day.today {
    font-weight: bold;
    border: 2px solid #2271b1;
}

.day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.day.jour-ferme {
    background-color: rgba(200, 200, 200, 0.2) !important;
    position: relative;
    color: #aaa !important;
    cursor: not-allowed !important;
}

.day.jour-ferme::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1px;
    background-color: rgba(150, 150, 150, 0.5);
    transform: rotate(45deg);
}

.day.other-month {
    color: #999;
}

/* Horaires */
.bookingvo-times {
    flex: 1;
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

.bookingvo-times h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.time-slot {
    padding: 10px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-slot:hover {
    background-color: rgba(34, 113, 177, 0.1);
}

.time-slot.selected {
    background-color: #2271b1;
    color: white;
}

/* Formulaire */
.bookingvo-form {
    width: 100%;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 15px;
}

.bookingvo-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.bookingvo-form input[type="text"],
.bookingvo-form input[type="email"],
.bookingvo-form input[type="tel"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bookingvo-submit {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.bookingvo-submit:hover {
    background-color: #135e96;
}

/* Styles responsifs */
@media screen and (max-width: 768px) {
    .bookingvo-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .bookingvo-grid {
        flex-direction: column;
    }
    
    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .day {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}

/* Styles spécifiques pour la modale */
#bookingvo-modal-calendar-container .bookingvo-calendar {
    padding: 10px;
}

#bookingvo-modal-calendar-container .bookingvo-dates {
    min-width: auto;
    width: 100%;
    padding: 10px;
}

#bookingvo-modal-calendar-container .day {
    width: 28px;
    height: 28px;
    font-size: 11px;
}
