/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F8FAFC;
}

::-webkit-scrollbar-thumb {
    background: #012A48;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #001A2F;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Hero carousel animations */
.hero-slide {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide.active {
    opacity: 1;
}

/* Parallax effect */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Custom Form Elements - Standardized */
.input-container {
    transition: all 0.2s ease;
    min-width: 0;
}

.input-container:focus-within {
    box-shadow: 0 0 0 3px rgba(1, 42, 72, 0.12);
    border-color: #012A48 !important;
}

/* Standardized input styling */
.search-input {
    width: 100%;
    background: transparent;
    outline: none;
    color: #1A1A1A;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

.search-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555555;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Unified input box base */
.search-input-box {
    background-color: white;
    height: 3.5rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #E5E7EB;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.search-input-box:hover {
    background-color: #F9FAFB;
}

.search-input-box:focus-within {
    border-color: #A48C64;
    box-shadow: 0 0 0 3px rgba(1, 42, 72, 0.1);
}

.search-input-box .input-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.search-input-box:focus-within .input-icon {
    color: #012A48;
}

/* Search form grid standardization */
.search-form-grid {
    display: grid;
    gap: 0.75rem;
    align-items: stretch;
}

/* Responsive search button */
.search-btn-primary {
    background-color: #012A48;
    color: white;
    height: 3.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px -5px rgba(1, 42, 72, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.search-btn-primary:hover {
    background-color: #001A2F;
    box-shadow: 0 10px 30px -5px rgba(1, 42, 72, 0.2);
}

.search-btn-primary:active {
    transform: scale(0.98);
}

.search-btn-primary i,
.search-btn-primary svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.search-btn-primary:hover i,
.search-btn-primary:hover svg {
    transform: translateX(2px);
}

/* Sticky Search Fixes */
#search-panel.is-sticky .search-input-box,
#search-panel.is-sticky .input-container {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

#search-panel.is-sticky .search-input-box:hover,
#search-panel.is-sticky .input-container:hover {
    background-color: #F1F5F9;
}

#search-panel.is-sticky .search-label,
#search-panel.is-sticky label {
    color: #64748B;
}

#search-panel.is-sticky .search-input,
#search-panel.is-sticky input {
    color: #1E293B;
}

#search-panel.is-sticky .search-input::placeholder,
#search-panel.is-sticky input::placeholder {
    color: #94A3B8;
}

/* Improved Sticky Tabs Readability */
#search-panel.is-sticky {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.12);
}

#search-panel.is-sticky #search-tabs-container {
    background-color: #F1F5F9;
    box-shadow: none;
    padding: 0.375rem;
    margin-bottom: 1rem;
}

#search-panel.is-sticky.is-collapsed #search-tabs-container {
    margin-bottom: 0;
}

#search-panel.is-sticky .search-tab:not(.active) {
    color: #64748B;
}

#search-panel.is-sticky .search-tab:not(.active):hover {
    color: #012A48;
    background-color: rgba(1, 42, 72, 0.06);
}

/* Button Enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:active {
    transform: scale(0.98);
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-8px);
}

/* Accent Line */
.accent-line {
    position: relative;
}

.accent-line::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 60px;
    height: 4px;
    background: #A48C64;
    border-radius: 2px;
}

/* Mobile-first responsive improvements */
@media (max-width: 639px) {
    .search-form-grid {
        gap: 0.625rem;
    }

    .search-input-box {
        height: 3.25rem;
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }

    .search-btn-primary {
        width: 100%;
        height: 3.25rem;
        font-size: 0.9375rem;
    }

    .search-label {
        font-size: 9px;
    }

    .search-input {
        font-size: 0.8125rem;
    }

    #search-tabs-container {
        justify-content: center;
        gap: 0.25rem;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .search-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-btn-primary {
        grid-column: span 2;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .search-btn-primary {
        min-width: 160px;
    }
}

/* Radio button styling for glass panels */
.search-form input[type="radio"] {
    accent-color: #012A48;
}

#search-panel.is-sticky .search-form input[type="radio"]+span {
    color: #374151;
}

#search-panel.is-sticky .search-form label:hover input[type="radio"]+span {
    color: #A48C64;
}

/* Custom checkbox styling */
.custom-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #D1D5DB;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: transparent;
}

.custom-checkbox:hover {
    border-color: #012A48;
}

.custom-checkbox:checked {
    background-color: #012A48;
    border-color: #012A48;
}

.custom-checkbox:focus {
    box-shadow: 0 0 0 3px rgba(1, 42, 72, 0.2);
    outline: none;
}

.custom-checkbox:checked+.check-icon {
    opacity: 1;
}

/* Popover improvements */
.traveler-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 20rem;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px -5px rgba(1, 42, 72, 0.25);
    padding: 1.25rem;
    z-index: 60;
    border: 1px solid #F3F4F6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
}

.traveler-popover.is-open,
.traveler-popover:not(.hidden) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Counter button styling */
.counter-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1;
    background: white;
    cursor: pointer;
}

.counter-btn:hover {
    border-color: #012A48;
    color: #012A48;
    background-color: #F8FAFC;
}

.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.counter-btn:disabled:hover {
    border-color: #E5E7EB;
    color: #555555;
    background-color: white;
}

.counter-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Custom select dropdown styling */
.custom-select .custom-options {
    animation: dropdownFade 0.15s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select .option-item {
    transition: background-color 0.15s ease;
}

.custom-select .option-item:hover {
    background-color: #F8FAFC;
}

.custom-select .option-item:active {
    background-color: #E8EDFC;
}

/* Time picker specific styling */
#tr-time-opts .option-item {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Sticky state adjustments for checkbox */
#search-panel.is-sticky .custom-checkbox {
    border-color: #D1D5DB;
}

#search-panel.is-sticky label span {
    color: #374151;
}

#search-panel.is-sticky label:hover span {
    color: #012A48;
}

/* Focus visible for accessibility */
.search-input:focus-visible,
.search-btn-primary:focus-visible,
.search-tab:focus-visible {
    outline: 2px solid #012A48;
    outline-offset: 2px;
}

/* Package checkbox label - always dark for readability */
.pkg-checkbox-label {
    color: #374151 !important;
}

label:hover .pkg-checkbox-label {
    color: #642667 !important;
}

/* Sticky state - collapsed to tab bar only */
#search-panel.is-sticky.is-collapsed #search-inputs-container {
    display: none !important;
}

#search-panel.is-sticky #search-inputs-container {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

#search-panel.is-sticky #search-tabs-container {
    margin-bottom: 0;
}

#search-panel.is-sticky:not(.is-collapsed) #search-tabs-container {
    margin-bottom: 1rem;
}

/* Ensure sticky wrapper works */
#search-container-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Collapsed sticky tab bar styling */
#search-panel.is-sticky.is-collapsed {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

#search-panel.is-sticky.is-collapsed #search-tabs-container {
    margin: 0 auto;
    width: fit-content;
}

/* Smooth scrolling for autocomplete containers */
.traveler-popover,
.custom-options {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.traveler-popover::-webkit-scrollbar,
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.traveler-popover::-webkit-scrollbar-thumb,
.custom-options::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

/* Remove border/outline from search inputs */
.search-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Autocomplete dropdown styling - wider and properly positioned */
.autocomplete-results {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    min-width: 340px !important;
    width: max-content !important;
    max-width: min(500px, 90vw) !important;
    background: white !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 20px 40px -5px rgba(1, 42, 72, 0.25) !important;
    max-height: 320px !important;
    overflow-y: auto !important;
    z-index: 100 !important;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-results::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

.autocomplete-results .p-2 {
    padding: 0.75rem 1rem !important;
    transition: background-color 0.15s ease;
}

.autocomplete-results .p-2:hover {
    background-color: #F8FAFC !important;
}

/* Loading state in autocomplete */
.autocomplete-results .p-3 {
    padding: 1rem !important;
    text-align: center;
}

/* Ensure input box has relative positioning for dropdown */
.search-input-box {
    position: relative !important;
}

/* Mobile responsiveness for autocomplete */
@media (max-width: 639px) {
    .autocomplete-results {
        min-width: 280px !important;
        max-width: calc(100vw - 2rem) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Ensure search forms don't clip dropdowns */
.search-form {
    overflow: visible !important;
}

.search-form-grid {
    overflow: visible !important;
}

#search-inputs-container {
    overflow: visible !important;
}

#search-panel {
    overflow: visible !important;
}

/* Higher z-index for traveler popovers to appear above content */
.traveler-popover {
    z-index: 200 !important;
}

/* Ensure custom-options appear above content */
.custom-options {
    z-index: 200 !important;
}
