/* Search UX Enhancement Styles */

/* City Autocomplete */
.city-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
    background-color: #f9fafb;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Date Quick Options */
.date-quick-options {
    animation: fadeIn 0.3s ease;
}

.date-quick-options button {
    transition: all 0.2s ease;
    border-color: #d1d5db;
}

.date-quick-options button:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Passenger Selector */
.passenger-selector {
    position: relative;
}

.passenger-button {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.passenger-button:hover {
    border-color: #3b82f6;
}

.passenger-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 1000;
    animation: slideDown 0.2s ease;
}

.counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.counter-label {
    display: flex;
    flex-direction: column;
}

.counter-label span:first-child {
    font-weight: 500;
    color: #374151;
}

.counter-label span:last-child {
    font-size: 12px;
    color: #6b7280;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.counter-btn:hover:not(:disabled) {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.counter-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.counter-value {
    font-size: 18px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Age selector for children */
.child-age-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.child-age-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.child-age-btn:hover,
.child-age-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Swap Directions Button */
.swap-directions-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.swap-directions-btn:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-50%) rotate(180deg);
}

/* Enhanced Search Button */
.btn-search-enhanced {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-search-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-search-enhanced:active {
    transform: translateY(0);
}

.btn-search-enhanced.loading {
    pointer-events: none;
    opacity: 0.9;
}

.btn-search-enhanced .loading-dots {
    display: inline-block;
    width: 20px;
}

.btn-search-enhanced .loading-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

/* Search Suggestions */
.search-suggestions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-suggestion-chip {
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-suggestion-chip:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.search-suggestion-chip.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Price Badge */
.price-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    animation: pulse 2s infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .city-autocomplete-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
        animation: slideUp 0.3s ease;
    }
    
    .passenger-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        animation: slideUp 0.3s ease;
    }
    
    .swap-directions-btn {
        position: relative;
        top: 0;
        transform: none;
        margin: 0 auto;
        display: block;
    }
    
    .btn-search-enhanced {
        width: 100%;
        padding: 16px;
        font-size: 17px;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .city-autocomplete-dropdown,
    .passenger-dropdown {
        background: #1f2937;
        border-color: #374151;
    }
    
    .suggestion-item {
        border-color: #374151;
    }
    
    .suggestion-item:hover {
        background-color: #374151;
    }
    
    .passenger-button {
        background: #1f2937;
        border-color: #374151;
        color: white;
    }
    
    .counter-btn {
        background: #1f2937;
        border-color: #4b5563;
        color: white;
    }
    
    .search-suggestion-chip {
        background: #374151;
        color: #d1d5db;
    }
    
    .search-suggestion-chip:hover {
        background: #4b5563;
    }
}