/**
 * Styles pour le formulaire de réservation Wpt Wowbook Booking
 *
 * @package WPT_Wowbook_Booking
 * @since 1.0.0
 */

/* Conteneur principal */
.wpt-wowbook-booking-form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* En-tête du formulaire */
.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.form-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.product-description {
    font-size: 16px;
    color: #666;
}

/* Indicateur d'étape */
.form-progress {
    margin-bottom: 30px;
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 3px solid #ddd;
    color: #999;
    font-weight: bold;
    font-size: 14px;
    position: relative;
    transition: all 0.3s ease;
}

.step.active {
    background-color: #fff;
    border-top-color: #0073aa;
    color: #0073aa;
}

.step.completed {
    background-color: #f0f8ff;
    border-top-color: #4CAF50;
    color: #4CAF50;
}

/* Messages d'erreur */
.form-messages {
    margin-bottom: 20px;
}

.error-message {
    background-color: #ffeeee;
    color: #cc0000;
    padding: 10px;
    border-left: 4px solid #cc0000;
    margin-bottom: 10px;
}

.success-message {
    background-color: #eeffee;
    color: #008800;
    padding: 10px;
    border-left: 4px solid #008800;
    margin-bottom: 10px;
}

/* Étapes du formulaire */
.form-step {
    display: none;
    animation: fadeIn 0.5s;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mise en page en deux colonnes */
.two-columns {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.left-column, .right-column {
    flex: 1;
    padding: 0 15px;
    min-width: 300px;
}

/* Disposition en deux colonnes pour l'étape de sélection de créneau */
.wpt-wowbook-booking-form .two-columns {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
    justify-content: space-between;
}

/* Styles pour l'affichage sans calendrier */
.wpt-wowbook-booking-form .two-columns.single-column {
    display: block;
}

.wpt-wowbook-booking-form .calendar-disabled .right-column {
    flex: 0 0 100%;
    width: 100%;
    padding: 0;
    max-width: 100%;
}

/* Calendrier */
.booking-calendar {
    background-color: #1c1c1c;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    padding: 15px;
    margin-bottom: 20px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.calendar-header button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
}

.calendar-header button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

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

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 10px;
    text-align: center;
    font-size: 12px;
    color: #999;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 5px;
    text-align: center;
}

.calendar-day {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    margin: 0 auto;
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.calendar-day.disabled {
    color: #666;
    cursor: default;
}

.calendar-day.disabled:hover {
    background-color: transparent;
}

.calendar-day.other-month {
    color: #666;
    opacity: 0.5;
}

.calendar-day.today {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.calendar-day.selected {
    background-color: #0073aa;
    color: white;
}

.date-picker-info {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Créneaux horaires */
.time-slots-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
}

.available-slots {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
    position: relative;
}

.time-slot {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.time-slot:hover {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.time-slot.selected {
    background-color: #e6f7ff;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.time-slot-time {
    font-weight: bold;
}

.time-slot-availability {
    font-size: 14px;
    color: #666;
}

/* Overlay de chargement */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Formulaires et champs */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-row .form-group {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    color: #333;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
}

.form-text {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 5px;
}

span.required {
    color: #cc0000;
}

/* Sections d'informations */
.info-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.info-section h4 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #333;
}

/* Contrat */
.contract-text-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.contract-text {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.terms-acceptance {
    background-color: #fffbea;
    border-left: 4px solid #ffb900;
    padding: 10px 15px;
    margin: 20px 0;
}

/* Signatures */
.signatures-container {
    margin-top: 30px;
}

.signature-section {
    margin-bottom: 30px;
}

.signature-pad-container {
    position: relative;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    width: 400px !important; /* Fixé à 400px exactement comme le canevas */
    height: 200px !important;
    max-width: 100%; /* Pour la responsivité sur mobile */
}

.signature-pad {
    /* Dimensions fixes exactes pour le canevas de signature */
    width: 400px !important;
    height: 200px !important;
    cursor: crosshair;
    background-color: #fff;
    /* Éliminer max-width pour garantir les dimensions exactes */
}

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

/* Résumé de la réservation */
.booking-summary {
    margin-bottom: 30px;
}

.summary-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    margin-bottom: 10px;
    line-height: 1.6;
}

.summary-item .item-label {
    font-weight: 600;
    width: 120px;
    flex-shrink: 0;
}

.notice-box {
    background-color: #fffbea;
    border-left: 4px solid #ffb900;
    padding: 15px 20px;
    margin: 20px 0;
}

/* Navigation entre les étapes */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.button {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.button:hover {
    background-color: #005f8c;
}

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

.prev-step {
    background-color: #f1f1f1;
    color: #333;
}

.prev-step:hover {
    background-color: #e1e1e1;
}

.submit-booking {
    background-color: #4CAF50;
}

.submit-booking:hover {
    background-color: #3e8e41;
}

/* Message de confirmation */
.booking-confirmation {
    text-align: center;
    padding: 30px;
    background-color: #f0fff0;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s;
}

.confirmation-message {
    max-width: 600px;
    margin: 0 auto;
}

.confirmation-message h3 {
    color: #4CAF50;
    font-size: 24px;
    margin-bottom: 20px;
}

.booking-details {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.return-button {
    margin-top: 20px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 767px) {
    .two-columns {
        display: block;
    }

    .left-column, .right-column {
        padding: 0;
        margin-bottom: 30px;
        width: 100%;
    }

    .form-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .button {
        width: 100%;
        margin-bottom: 10px;
    }

    .signature-pad-container {
        height: 150px;
    }
}

/* Styles pour la capture de carte d'identité */
.id-card-capture-container {
    margin-bottom: 30px;
}

.id-card-capture-container .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.id-card-capture-container .capture-column,
.id-card-capture-container .preview-column {
    flex: 1;
    padding: 0 15px;
    min-width: 300px;
}

.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 15px;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-canvas {
    display: none;
}

#camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.id-card-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    border: 2px dashed #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3);
}

.camera-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.preview-container {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.preview-title {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.id-card-preview {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

#id-card-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.no-photo-text {
    color: #888;
    text-align: center;
    font-style: italic;
}

@media (max-width: 767px) {
    .id-card-capture-container .row {
        flex-direction: column;
    }
    
    .id-card-capture-container .preview-column {
        margin-top: 20px;
    }
}
