/* Search Overlay Styles */
.search-overlay {
    background: rgba(0, 0, 0, 0.317);
    backdrop-filter: blur(15px);
}

/* Ensure modal is visible when shown - don't override Bootstrap's display control */
#searchOverlay.modal.show {
    display: block !important;
    z-index: 1055 !important;
}

#searchOverlay.modal.show .modal-dialog {
    display: flex !important;
    align-items: center !important;
    min-height: calc(100% - 1rem) !important;
    z-index: 1056 !important;
    margin: 1.75rem auto !important;
    max-width: 800px !important;
}

#searchOverlay.modal.show .modal-content {
    z-index: 1057 !important;
}

.search-overlay .modal-content {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
}

.search-overlay .modal-header {
    border: none !important;
    padding: 10px 15px !important;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.9) 0%, rgba(30, 64, 175, 0.8) 100%) !important;
}

.search-overlay .modal-body { 
    backdrop-filter: blur(20px) !important;
    background: rgba(255, 255, 255, 0.95) !important;
}

.search-overlay-title {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin: 0;
    text-align: center;
}

.search-overlay-subtitle {
    color: rgba(71, 85, 105, 0.8);
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.search-overlay-form-content {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.search-overlay-form-content .form-control,
.search-overlay-form-content .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-overlay-form-content .form-control:focus,
.search-overlay-form-content .form-select:focus {
    background: white;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

/* Specific styling for overlay inputs */
#overlayCityInput,
#overlayLocationSearchInput {
    border: 2px solid #e5e7eb;
    background: white;
}

#overlayCityInput:focus,
#overlayLocationSearchInput:focus {
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    outline: none;
}

#overlayCityInput:hover,
#overlayLocationSearchInput:hover {
    border-color: #93c5fd;
}

.search-overlay-form-content .btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-overlay-form-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.4);
}

/* Location tags and dropdown - support both class names for backward compatibility */
.search-overlay-form .selected-location-tag,
.search-overlay-form-content .selected-location-tag {
    background: rgba(30, 64, 175, 0.2);
    color: white;
    border: 1px solid rgba(30, 64, 175, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
    transition: all 0.3s ease;
}

.search-overlay-form .selected-location-tag:hover,
.search-overlay-form-content .selected-location-tag:hover {
    background: rgba(30, 64, 175, 0.3);
    transform: translateY(-2px);
}

.search-overlay-form .remove-location,
.search-overlay-form-content .remove-location {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-overlay-form .remove-location:hover,
.search-overlay-form-content .remove-location:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

.search-overlay-form .location-dropdown,
.search-overlay-form-content .location-dropdown {
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.search-overlay-form .location-option,
.search-overlay-form-content .location-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.search-overlay-form .location-option:last-child,
.search-overlay-form-content .location-option:last-child {
    border-bottom: none;
}

.search-overlay-form .location-option:hover,
.search-overlay-form-content .location-option:hover {
    background: #f8fafc;
    color: #1e40af;
}

.search-overlay-form .location-option i,
.search-overlay-form-content .location-option i {
    color: #1e40af;
    font-size: 14px;
}

.search-overlay-form .location-option span,
.search-overlay-form-content .location-option span {
    font-weight: 500;
}

.search-overlay-form-content .radio-group {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin: 0;
    align-items: center;
}

.search-overlay-form-content .radio-group > .form-label {
    margin-bottom: 0;
    margin-right: 8px;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    white-space: nowrap;
}

.search-overlay-form-content .radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    justify-content: flex-start;
}

.search-overlay-form-content .radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.search-overlay-form-content .radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-overlay-form-content .radio-option:hover .radio-custom {
    border-color: #93c5fd;
}

.search-overlay-form-content .radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #3b82f6;
    background: #3b82f6;
}

.search-overlay-form-content .radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.search-overlay-form-content .radio-option input[type="radio"]:checked ~ .radio-label {
    color: #1e40af;
    font-weight: 600;
}

.search-overlay-form-content .radio-label {
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
    user-select: none;
    cursor: pointer;
}

.search-overlay-form-content .radio-option input[type="radio"]:focus + .radio-custom {
    box-shadow: 0 0 0 3px rgba(219, 234, 254, 1);
}

/* Animation for search overlay */
.search-overlay .modal-dialog {
    animation: slideInDown 0.5s ease-out;
}

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

/* Ensure modal is visible on all screen sizes */
#searchOverlay.modal {
    display: none;
}

#searchOverlay.modal.show {
    display: block !important;
}

#searchOverlay.modal.show .modal-dialog {
    display: block !important;
}

/* Desktop specific styles - ensure modal is visible */
@media (min-width: 769px) {
    #searchOverlay.modal.show {
        display: block !important;
        z-index: 1055 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    
    #searchOverlay.modal.show .modal-dialog {
        display: flex !important;
        position: relative !important;
        width: auto !important;
        max-width: 800px !important;
        margin: 1.75rem auto !important;
        pointer-events: none !important;
    }
    
    #searchOverlay.modal.show .modal-content {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        pointer-events: auto !important;
    }
    
    #searchOverlay.modal.show .modal-backdrop {
        z-index: 1054 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }
}

/* Mobile responsiveness for search overlay */
@media (max-width: 768px) {
    .search-overlay-title {
        font-size: 2rem;
    }
    
    .search-overlay-subtitle {
        font-size: 1rem;
    }
    
    .search-overlay-form-content .form-control {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .search-overlay-form-content .btn-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .search-overlay-form-content .selected-location-tag {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .search-overlay-form-content .radio-option {
        padding: 6px 10px;
    }
    
    .search-overlay-form-content .radio-custom {
        width: 16px;
        height: 16px;
    }
    
    .search-overlay-form-content .radio-option input[type="radio"]:checked + .radio-custom::after {
        width: 5px;
        height: 5px;
    }
    
    .search-overlay-form-content .radio-label {
        font-size: 13px;
    }
}
