/**
 * Location Search Widget Styles
 */

.nearb-location-search--widget {
    max-width: 800px;
    margin: 0 auto;
}

.nearb-location-search--widget .nearb-search-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.nearb-location-search--widget .nearb-search-input-wrapper {
    position: relative;
    flex: 1 1 300px;
    min-width: 0;
}

.nearb-location-search--widget .nearb-location-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s;
}

.nearb-location-search--widget .nearb-location-input:focus {
    border-color: #3b82f6;
}

.nearb-location-search--widget .nearb-location-input::placeholder {
    color: #94a3b8;
}

.nearb-location-search--widget .nearb-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    padding: 0;
    list-style: none;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.nearb-location-search--widget .nearb-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.nearb-location-search--widget .nearb-suggestion-item:last-child {
    border-bottom: none;
}

.nearb-location-search--widget .nearb-suggestion-item:hover {
    background-color: #f8fafc;
}

.nearb-location-search--widget .nearb-suggestion-loading,
.nearb-location-search--widget .nearb-suggestion-empty,
.nearb-location-search--widget .nearb-suggestion-error {
    padding: 0.75rem 1rem;
    color: #64748b;
    font-style: italic;
    text-align: center;
}

.nearb-location-search--widget .nearb-suggestion-error {
    color: #ef4444;
}

.nearb-location-search--widget .nearb-distance-wrapper {
    flex: 0 0 auto;
}

.nearb-location-search--widget .nearb-distance-select {
    height: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5rem;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.nearb-location-search--widget .nearb-distance-select:focus {
    border-color: #3b82f6;
}

.nearb-location-search--widget .nearb-geo-btn,
.nearb-location-search--widget .nearb-search-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.nearb-location-search--widget .nearb-geo-btn {
    background-color: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}

.nearb-location-search--widget .nearb-geo-btn:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.nearb-location-search--widget .nearb-geo-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.nearb-location-search--widget .nearb-geo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nearb-location-search--widget .nearb-geo-btn.nearb-loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.nearb-location-search--widget .nearb-search-btn {
    background-color: #3b82f6;
    color: white;
    flex: 0 0 auto;
}

.nearb-location-search--widget .nearb-search-btn:hover {
    background-color: #2563eb;
}

.nearb-location-search--widget .nearb-search-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 640px) {
    .nearb-location-search--widget .nearb-search-form {
        flex-direction: column;
    }
    
    .nearb-location-search--widget .nearb-search-input-wrapper {
        flex: 1 1 auto;
    }
    
    .nearb-location-search--widget .nearb-distance-wrapper {
        flex: 1 1 auto;
    }
    
    .nearb-location-search--widget .nearb-distance-select {
        width: 100%;
    }
    
    .nearb-location-search--widget .nearb-geo-btn {
        display: none; /* Hide GPS button on mobile to save space */
    }
    
    .nearb-location-search--widget .nearb-search-btn {
        width: 100%;
    }
}

/* Tabler theme compatibility */
.page-wrapper .nearb-location-search--widget {
    margin: 1rem 0;
}

.card .nearb-location-search--widget {
    padding: 1rem;
}

/* Elementor compatibility */
.elementor-widget-shortcode .nearb-location-search--widget {
    margin: 0;
}
