/**
 * Kling Digital Advanced Search Widget - Main Styles
 */

/* Reset and Base Styles */
.wts-search-widget * {
    box-sizing: border-box;
}

.wts-search-widget {
    width: 100%;
    margin: 0 auto;
}

.wts-search-widget .wts-search-form {
    width: 100%;
}

.wts-search-widget .wts-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

/* Field Wrapper */
.wts-search-widget .wts-field-wrapper {
    flex: 1 1 auto;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.wts-search-widget .wts-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wts-search-widget .wts-label-hidden {
    visibility: hidden;
    height: 0;
    margin: 0;
}

/* Form Fields */
.wts-search-widget .wts-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    color: #333333;
    transition: all 0.3s ease;
    outline: none;
}

.wts-search-widget .wts-field:focus {
    border-color: #93a5be;
    box-shadow: 0 0 0 3px rgba(147, 165, 190, 0.1);
}

.wts-search-widget .wts-field::placeholder {
    color: #999;
}

/* Select Fields */
.wts-search-widget select.wts-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Price Slider */
.wts-search-widget .wts-price-slider-container {
    padding: 10px 5px;
}

.wts-search-widget .wts-price-slider {
    margin-bottom: 20px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.wts-search-widget .wts-price-slider .ui-slider-range {
    background: #93a5be;
    border-radius: 3px;
}

.wts-search-widget .wts-price-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 2px solid #93a5be;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    top: -6px;
    transition: all 0.3s ease;
}

.wts-search-widget .wts-price-slider .ui-slider-handle:hover,
.wts-search-widget .wts-price-slider .ui-slider-handle:focus {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(147, 165, 190, 0.2);
}

.wts-search-widget .wts-price-values {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.wts-search-widget .wts-price-max-value {
    color: #93a5be;
}

/* Submit Button */
.wts-search-widget .wts-submit-button {
    width: 100%;
    padding: 15px 30px;
    background-color: #93a5be;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.wts-search-widget .wts-submit-button:hover {
    background-color: #7a8ea8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 165, 190, 0.3);
}

.wts-search-widget .wts-submit-button:active {
    transform: translateY(0);
}

/* Layout: Horizontal (Default) */
.wts-layout-horizontal .wts-form-fields {
    flex-direction: row;
}

.wts-layout-horizontal .wts-keyword-wrapper,
.wts-layout-horizontal .wts-destination-wrapper,
.wts-layout-horizontal .wts-typology-wrapper {
    flex: 1 1 200px;
}

.wts-layout-horizontal .wts-price-wrapper,
.wts-layout-horizontal .wts-duration-wrapper,
.wts-layout-horizontal .wts-date-wrapper {
    flex: 1 1 180px;
}

.wts-layout-horizontal .wts-submit-wrapper {
    flex: 0 0 auto;
    min-width: 150px;
}

/* Layout: Vertical */
.wts-layout-vertical .wts-form-fields {
    flex-direction: column;
}

.wts-layout-vertical .wts-field-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Layout: Hero Style */
.wts-layout-hero {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e5;
}

.wts-layout-hero .wts-field {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
}

.wts-layout-hero .wts-field:focus {
    background: #fff;
    border-color: #e74c3c;
}

.wts-layout-hero .wts-field-label {
    color: #333;
    font-weight: 600;
}

.wts-layout-hero .wts-price-values {
    color: #333;
}

/* Hero layout uses Elementor-controlled button colors */
.wts-layout-hero .wts-submit-button {
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.2);
}

.wts-layout-hero .wts-submit-button:hover {
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.3);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .wts-layout-horizontal .wts-form-fields {
        gap: 12px;
    }

    .wts-layout-horizontal .wts-field-wrapper {
        flex: 1 1 45%;
    }

    .wts-layout-horizontal .wts-submit-wrapper {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .wts-form-fields {
        gap: 10px;
    }

    .wts-layout-horizontal .wts-form-fields,
    .wts-layout-hero .wts-form-fields {
        flex-direction: column;
    }

    .wts-layout-horizontal .wts-field-wrapper,
    .wts-layout-hero .wts-field-wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 100%;
    }

    .wts-layout-hero {
        padding: 25px 20px;
    }

    .wts-field {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wts-submit-button {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* jQuery UI Datepicker Overrides - Isolated with Custom Class */
/* IMPORTANT: These styles only apply to datepickers from this widget */
/* JavaScript adds .wts-datepicker class dynamically */
.wts-datepicker.ui-datepicker {
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e0e0e0 !important;
}

.wts-datepicker .ui-datepicker-header {
    background: #93a5be !important;
    color: #fff !important;
    border-radius: 8px 8px 0 0 !important;
    border: none !important;
}

.wts-datepicker .ui-datepicker-title {
    color: #fff !important;
}

.wts-datepicker .ui-datepicker-prev,
.wts-datepicker .ui-datepicker-next {
    cursor: pointer !important;
}

.wts-datepicker .ui-state-default {
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #333 !important;
    text-align: center !important;
}

.wts-datepicker .ui-state-hover {
    background: #93a5be !important;
    color: #fff !important;
    border-color: #93a5be !important;
}

.wts-datepicker .ui-state-active {
    background: #7a8ea8 !important;
    color: #fff !important;
    border-color: #7a8ea8 !important;
}

/* Loading State */
.wts-search-form.wts-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wts-search-form.wts-loading .wts-submit-button::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: wts-spin 0.8s linear infinite;
}

@keyframes wts-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.wts-field:focus-visible,
.wts-submit-button:focus-visible {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .wts-search-widget {
        display: none;
    }
}