/* Transfer Search Component Styles */

/* Full-width background section */
.transfer-search-section {
    padding: 21px 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 650px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Inline mode - for ACF blocks inside content */
.transfer-search-section--inline {
    height: auto;
    min-height: auto;
    background-attachment: scroll; /* Change from fixed to scroll for inline mode */
    align-items: flex-start;
    padding: 40px 0;
}

/* Header styling */
.transfer-search-header {
    padding: 0 49px;
}

.transfer-search-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 36px;
    vertical-align: middle;
    max-width: 580px;

}

/* Features Section */
.transfer-search-features {
    padding: 36px 49px;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
}

.feature-icon {
    flex-shrink: 0;
    width: 55px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.1);
}

.feature-text {
    flex: 1;
    color: #ffffff;
    text-align: left;
    font-weight: 400;
    font-size: 14px;
    line-height: 19px;
    vertical-align: middle;
}

/* Transfer search form container */
.transfer-search {
    padding: 0 49px;
    background: transparent;
    position: relative;
    width: 100%;
    max-width: 1200px;
}

.transfer-search__row {
    position: relative;
}

/* Increase padding-right for place search fields to accommodate clear button */
#transfer-from,
#transfer-to {
    padding-right: 40px !important;
}

.transfer-search__content {
    width: 100%;
    position: relative;
}

/* Form Groups - minimal layout only */
.transfer-search .form-group {
    position: relative;
}
/* Error States */

.transfer-search .form-group--error input,
.transfer-search .form-group--error select {
    border-color: #e74c3c !important;
}

.transfer-search .form-group__error-message {
    color: #e74c3c;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
    display: none;
    padding-left: 2px;
}

.transfer-search .form-group--error .form-group__error-message:not(:empty) {
    display: block;
}

/* Return Trip Fields */
.return-trip-field {
    transition: all 0.3s ease;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    padding: 0;
}

.return-trip-field--visible {
    opacity: 1;
    max-height: 400px;
    overflow: visible;
}

@media (max-width: 992px) {
    .transfer-search {
        padding: 20px;
    }

    .transfer-search-title {
        font-size: 32px;
    }

    .transfer-search-section {
        height: 700px;
    }

    .transfer-search-features {
        padding: 32px 49px;
    }

    .feature-text span {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .transfer-search {
        padding: 8px 18px;
    }

    .transfer-search-section {
        padding: 5px 0;
        background-attachment: scroll;
        height: 900px;
    }

    .transfer-search-header {
        padding: 0 10px;
        text-align: center;
    }

    .transfer-search-title {
        font-size: 32px;
        line-height: 1.3;
        max-width: none;
    }

    .transfer-search-section {
        height: 850px;
        padding: 15px 0;
    }

    .transfer-search-features {
        padding: 20px 15px;
    }

    .feature-item {
        padding: 0 30px;
        margin-bottom: 8px;
        gap: 12px;
        display: flex;
        justify-content: flex-start;
    }

    .feature-icon {
        width: 24px;
        height: 24px;
    }

    .feature-text span {
        font-weight: 400;
        font-size: 14px;
        line-height: 14px;
        vertical-align: middle;
    }

    /* Mobile: merge "from" and "to" fields visually */
    /* Remove gap between fields */
    .transfer-search__row {
        gap: 0 !important;
    }

    /* "From" field - remove bottom border and bottom border-radius */
    #transfer-from {
        border-bottom: none;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding-right: 65px !important; /* Prevent text overlap with switch button */
    }

    /* "To" field - remove top border-radius */
    #transfer-to {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        padding-right: 65px !important; /* Prevent text overlap with switch button */
    }

    /* Add separator line between fields (doesn't reach the button) */
    .transfer-search__row > .w-100:last-child .place-search-wrapper::before {
        content: "";
        position: absolute;
        left: 15px;
        right: 48px; /* Stop before the switch button */
        top: 0;
        height: 1px;
        background: #dee2e6;
        pointer-events: none;
        z-index: 1;
    }

    /* Move clear button to the right on mobile */
    .transfer-search__row .transfer-field__clear {
        right: 40px;
    }
}

@media (max-width: 480px) {
    .transfer-search {
        padding: 8px 18px;
    }

    .transfer-search-header {
        padding: 0 5px;
        text-align: center;
    }

    .transfer-search-title {
        padding-top: 15px;
        font-size: 22px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: 0;
        max-width: none;
    }

    .transfer-search-subtitle {
        font-size: 16px;
    }

    .transfer-search-section {
        height: 800px;
    }

    .transfer-search-features {
        padding: 15px 10px;
    }

    .feature-item {
        margin-bottom: 7px;
        padding: 0 30px;
        gap: 14px;
        height: auto;
    }

    .feature-icon {
        max-width: 24px;
        max-height: 24px;
    }

    .feature-text span {
        font-size: 14px;
        line-height: 1.25;
    }
}

/* Form Loading State */
.transfer-search--loading {
    pointer-events: none;
    opacity: 0.8;
}

.transfer-search--loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: transferSearchSpin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes transferSearchSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Focus Management */
.transfer-search:focus-within {
    box-shadow: none;
}

/* Common Transfer Field Classes
 *
 * These generic classes provide consistent styling across all transfer form fields:
 * - .transfer-field__wrapper: Common wrapper for all field types
 * - .transfer-field__input: Base input styling (with icon padding)
 * - .transfer-field__input--no-icon: Input without icon (like passenger selector)
 * - .transfer-field__icon: Consistent icon positioning and styling
 * - .transfer-field__clear: Clear button for fields that support it
 * - .transfer-field__dropdown: Base dropdown styling
 * - .transfer-field__dropdown--open: Open dropdown state
 *
 * Apply these classes along with field-specific classes for consistency
 */

/* Transfer Field Wrapper */
.transfer-field__wrapper {
    position: relative;
    width: 100%;
}

/* Transfer Field Input Base Styles */
.transfer-field__input {
    background: #f8f9fa;
    border: none;
    border-radius: 6px;
    padding: 14px 20px 14px 36px;
    color: #495057;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: none;
    min-height: 50px;
    outline: none;
    font-size: 16px;
    line-height: 100%;
    vertical-align: middle;
}

/* Transfer Field Input without Icon (like passenger selector) */
.transfer-field__input--no-icon {
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Transfer Field Input Focus States */
.transfer-field__input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
    outline: none;
}

/* Transfer Field Input Hover States */
.transfer-field__input:hover {
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.1);
}

/* Transfer Field Placeholder Styles */
.transfer-field__input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

/* Transfer Field Readonly Cursor */
.transfer-field__input[readonly] {
    cursor: pointer;
    background-color: #f8f9fa;
}

/* Transfer Field Icon */
.transfer-field__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    font-weight: normal;
}

/* Transfer Field Icon Hover/Focus States */
.transfer-field__wrapper:hover .transfer-field__icon,
.transfer-field__input:focus + .transfer-field__icon {
    color: #ffc107;
}

/* Transfer Field Clear Button */
.transfer-field__clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999999;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    border-radius: 50%;
    transition:
        color 0.3s ease,
        background-color 0.3s ease;
    display: flex; /* Always visible */
    width: 24px;
    height: 24px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.transfer-field__clear:hover {
    color: #666666;
    background-color: #f5f5f5;
}

.transfer-field__clear:focus {
    outline: none;
    color: #ffc107;
}

/* Transfer Field Dropdown */
.transfer-field__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    margin-top: 4px;
}

.transfer-field__dropdown--open {
    display: block;
    animation: transferFieldDropdownSlideIn 0.2s ease-out;
}

@keyframes transferFieldDropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transfer Field Error States */
.form-group--error .transfer-field__input {
    background: #ffcccc;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.5);
    border-color: #e74c3c !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form-group--error .transfer-field__icon {
    color: #e74c3c;
    opacity: 1;
    font-weight: bold;
}

.form-group--error .transfer-field__input::placeholder {
    color: #c0392b;
}

/* On mobile: hide error text under "from" field — shared div shown after "to" field instead */
@media (max-width: 767px) {
    .transfer-search__row > .w-100:first-child .form-group__error-message {
        display: none;
    }
}

#transfer-from-error-mobile:not(:empty) {
    display: block;
    margin-top: -8px;
    margin-bottom: 4px;
}

/* Transfer Field Mobile Responsive */
@media (max-width: 768px) {
    .transfer-field__input {
        padding: 14px 16px 14px 46px;
        font-size: 16px;
        min-height: 52px;
    }

    .transfer-field__input--no-icon {
        padding: 14px 16px;
    }

    .transfer-field__icon {
        left: 14px;
        font-size: 16px;
        width: 22px;
        height: 22px;
        color: #6c757d;
    }
}

@media (max-width: 480px) {
    .transfer-field__input {
        padding: 12px 14px 12px 42px;
        font-size: 16px;
        min-height: 48px;
    }

    .transfer-field__input--no-icon {
        padding: 12px 14px;
    }

    .transfer-field__icon {
        left: 12px;
        font-size: 14px;
        width: 20px;
        height: 20px;
        color: #6c757d;
    }
}

/* Trusted Payments */
.trusted-payments {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    backdrop-filter: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    min-height: 50px;
}

.trusted-payments__content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: nowrap;
}

.trusted-payments__badge {
    height: 32px;
    width: auto;
    filter: brightness(1.1);
    opacity: 0.9;
}

.trusted-payments__cards {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trusted-payments__card {
    height: 28px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.trusted-payments__card:hover {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .trusted-payments {
        justify-content: flex-start;
        margin-top: 0;
        min-height: 40px;
    }

    .trusted-payments__content {
        gap: 8px;
        justify-content: flex-start;
    }

    .trusted-payments__badge {
        height: 24px;
    }

    .trusted-payments__card {
        height: 20px;
    }

    .trusted-payments__cards {
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .trusted-payments {
        justify-content: flex-start;
        margin-top: 0;
        min-height: auto;
    }

    .trusted-payments__content {
        gap: 6px;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .trusted-payments__badge {
        height: 18px;
        flex-shrink: 0;
    }

    .trusted-payments__card {
        height: 16px;
        flex-shrink: 0;
    }

    .trusted-payments__cards {
        gap: 2px;
        flex-shrink: 0;
    }
}

/* Yandex Rating Styles */
.yandex-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 50px;
}

.yandex-rating iframe {
    border: none;
    border-radius: 4px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.yandex-rating iframe:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .yandex-rating {
        margin-top: 20px;
    }
}

.col-1-field {
    width: 100%;
}
.col-2-fields {
    width: 100%;
}

@media (min-width: 768px) {
    .col-1-field {
        width: 33.33%;
    }
    .col-2-fields {
        width: 66.66%;
    }
}


