/**
 * Styles supplémentaires pour le moteur de réservation - EightCar Sixt Edition
 * Style Booking.com
 */

/* === DATE DISPLAY BOOKING STYLE === */
.input-wrapper {
  position: relative;
}

/* Affichage humanisé (par-dessus l'input natif) */
.date-display-booking {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: none;
  align-items: center;
  padding: 1rem 1rem 1rem 2.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: white;
  border: 2px solid #CCCCCC;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: all;
  z-index: 2;
  transition: border-color 0.2s ease;
}

.date-display-booking:hover {
  border-color: var(--primary);
}

/* Afficher quand il y a une valeur */
.date-display-booking.visible {
  display: flex;
}

/* Cacher l'input natif quand affichage humanisé visible */
.input-wrapper input[type="date"].has-value {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* === OVERRIDE: Autocomplete pour style Sixt === */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.5rem;
}

.autocomplete-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--background-light);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--background-light);
}

.autocomplete-item .icon {
    font-size: 1.5rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.autocomplete-item .details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.autocomplete-item .name {
    font-weight: 500;
    color: var(--text);
    font-size: 0.875rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.autocomplete-item .type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-loading,
.autocomplete-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.autocomplete-loading i {
    margin-right: 0.5rem;
}

/* === ONE-WAY FIELD ANIMATION (style Sixt) === */
.oneway-field-sixt {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.oneway-field-sixt.active {
    max-height: 150px;
    opacity: 1;
}

/* === DURATION & PRICE DISPLAY (style Sixt) === */
.widget-duration-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(74, 123, 167, 0.08) 0%, rgba(212, 175, 55, 0.08) 100%);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget-duration-price.active {
    display: flex !important;
    opacity: 1;
    transform: translateY(0);
}

.duration-text,
.price-text {
    color: var(--text);
}

.duration-text strong,
.price-text strong {
    color: var(--primary);
    font-weight: 700;
}

.price-separator {
    color: var(--text-light);
}

/* === VALIDATION STATES (style Sixt) === */
.field-input-sixt.is-valid {
    border-color: #10B981 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

.field-input-sixt.is-invalid {
    border-color: #EF4444 !important;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #EF4444;
    font-weight: 500;
}

.form-field.has-error .error-message {
    display: block;
}

/* === LOADING STATE BUTTON === */
.booking-btn-sixt.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.booking-btn-sixt.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 1024px) {
    .autocomplete-dropdown {
        max-height: 250px;
    }

    .widget-duration-price {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .price-separator {
        display: none;
    }
}

@media (max-width: 768px) {
    .autocomplete-item {
        padding: 0.875rem 1rem;
    }

    .autocomplete-item .icon {
        font-size: 1.25rem;
        width: 24px;
    }

    .autocomplete-item .name {
        font-size: 0.875rem;
    }

    .widget-duration-price {
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* === Z-INDEX FIX === */
.booking-widget-sixt-horizontal {
    position: relative;
    z-index: 1;
}

.autocomplete-dropdown {
    z-index: 1001;
}

/* === FOCUS STATES (Accessibilité) === */
.field-input-sixt:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* === SCROLLBAR STYLING (Autocomplete) === */
.autocomplete-dropdown::-webkit-scrollbar {
    width: 8px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* === ANIMATION SMOOTH POUR CHECKBOX ONE-WAY === */
.checkbox-sixt:checked ~ .oneway-field-sixt {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 150px;
        opacity: 1;
    }
}

/* === RESPONSIVE BOOKING STYLE === */
@media (max-width: 992px) {
  .booking-form-horizontal {
    flex-wrap: wrap;
  }

  .form-field-location {
    flex: 1 1 100%;
  }

  .form-field-datetime {
    flex: 1 1 calc(50% - 4px);
  }

  .btn-search-booking {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  /* Options en colonne */
  .booking-options-bar {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  /* Formulaire en colonne */
  .booking-form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* Tous les champs full width */
  .form-field-location,
  .form-field-datetime {
    flex: 1 1 100%;
    width: 100%;
  }

  /* Bouton full width et plus haut */
  .btn-search-booking {
    width: 100%;
    min-height: 54px;
    font-size: 1.1rem;
  }

  /* Widget moins de padding */
  .booking-widget-sixt-horizontal {
    padding: 1rem;
    border-width: 2px; /* Bordure moins épaisse sur mobile */
  }

  /* Floating labels plus petits */
  .floating-label {
    font-size: 0.7rem;
  }

  /* DateTime display plus compact */
  .datetime-display {
    padding: 1.5rem 1rem 0.5rem 2.5rem;
    min-height: 52px;
  }

  .datetime-display .date-text {
    font-size: 0.875rem;
  }

  .datetime-display .time-text {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  /* Inputs plus compacts sur très petit écran */
  .field-input-booking {
    padding: 1.5rem 1rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    min-height: 52px;
  }

  .input-wrapper i {
    left: 0.875rem;
    font-size: 0.9375rem;
  }

  .datetime-display {
    padding: 1.5rem 1rem 0.5rem 2.5rem;
    min-height: 52px;
  }

  .datetime-display .date-text {
    font-size: 0.8125rem;
  }

  .datetime-display .time-text {
    font-size: 0.7rem;
  }

  .floating-label {
    left: 2.5rem;
    font-size: 0.65rem;
    top: 6px;
  }
}
