<div class="row">
    <div class="col-lg-12 col-md-12 col-sm-12 col-12 p-0">
        <div class="card">
            <div class="card-header">
                <h4 class="box-title m-0 p-0">{{__('Company Information') }}</h4>
            </div>
            <div class="card-body">
                <div class="col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-12">
                        <form action="{{ route('updateUserCompany') }}" method="post" id="company_information_form"
                        enctype="multipart/form-data" class="box-body lightlabel">
                            <div class="row">
                                <div class="form-group col-12 col-md-4 pb-3">
                                    <div class="relative z-0 w-full group">
                                        <input type="text"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control business-name-validation" name="business_name" id="business_name"
                                        value="{{old('business_name', (isset($userCompany) && $userCompany->business_name ? $userCompany->business_name : '') )}}">
                                        <label for="business_name" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company Name')}}<span class="text-danger">*</span></label>
                                    </div>
                                    <div class="text-danger error business_name_error"></div>
                                </div>

                                <div class="form-group col-12 col-md-4 pb-3">
                                    <div class="relative z-0 w-full group">
                                        <input type="text"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control business-name-validation" name="company_registration_number" id="company_registration_number"
                                        value="{{old('company_registration_number', (isset($userCompany) && $userCompany->company_registration_number ? $userCompany->company_registration_number : '') )}}">
                                        <label for="company_registration_number" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company Registration Number')}} </label>
                                    </div>
                                    <div class="text-danger error company_registration_number_error"></div>
                                </div>

                                <div class="form-group col-12 col-md-4 pb-3">
                                    <div class="relative z-0 w-full group">
                                        <input type="text"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control special-case-validation" name="vat_number" id="vat_number"
                                        value="{{old('vat_number', (isset($userCompany) && $userCompany->vat_number ? $userCompany->vat_number : '') )}}">
                                        <label for="vat_number" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company VAT / Tax ID')}} </label>
                                    </div>
                                    <div class="text-danger error vat_number_error"></div>
                                </div>

                                <div class="form-group col-12 col-md-4 mb-0">
                                    <div class="relative z-0 w-full group">
                                        <input type="text"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control business-name-validation" name="company_owner_name" id="company_owner_name"
                                        value="{{old('company_owner_name', (isset($userCompany) && $userCompany->company_owner_name ? $userCompany->company_owner_name : '') )}}">
                                        <label for="company_owner_name" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company Owner Name')}} </label>
                                    </div>
                                    <div class="text-danger error company_owner_name_error"></div>
                                </div>

                                <div class="form-group col-12 col-md-4 mb-0">
                                    <div class="relative z-0 w-full group">
                                        <input type="text"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control business-name-validation" name="company_director_name" id="company_director_name"
                                        value="{{old('company_director_name', (isset($userCompany) && $userCompany->company_director_name ? $userCompany->company_director_name : '') )}}">
                                        <label for="company_director_name" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company Director Name')}} </label>
                                    </div>
                                    <div class="text-danger error company_director_name_error"></div>
                                </div>

                                <div class="form-group col-12 col-md-4 mb-0">
                                    <div class="relative z-0 w-full group">
                                        <input type="url"  placeholder="" class="rounded-lg p-2.5 w-full text-sm text-gray-900 bg-transparent border-gray-300 appearance-none focus:outline-none border-2 focus:ring-1 peer pl-15 h-11 form-control url-validation" name="company_url" id="company_url" value="{{old('company_url', (isset($userCompany) &&
                                        $userCompany->company_url ? $userCompany->company_url : ''))}}"  {{ isset($userCompany) && $userCompany->company_url && $userCompany->company_status === 0 ? 'readonly' : '' }}>
                                        <label for="company_url" class="col-form-label ml-2 p-2 py-0 peer-focus:font-medium absolute left-0 text-sm text-gray-600 duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-focus:start-0 rtl:peer-focus:translate-x-1/4 peer-focus:text-indigo-400 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 bg-white peer-focus:z-10">{{__('Company URL')}}</label>
                                    </div>
                                    <div class="text-danger error company_url_error"></div>
                                    <i>{{ __('e.g. http://example.com or https://example.com')}}</i>
                                </div>

                                <div class="form-group col-md-4 col-lg-4 col-sm-12 col-12">
                                    <div class="w-full group">
                                        <label for="company_logo" class="col-form-label p-0">{{__('Company Logo')}}</label>
                                        <input  placeholder="" class="form-control" type="file" name="company_logo" id="company_logo"
                                        {{ isset($userCompany) && $userCompany->company_logo && $userCompany->company_status === 0 ? 'disabled' : '' }}>
                                    </div>
                                    <div class="text-danger error company_logo_error"></div>
                                    <i>{{__('Only jpg,jpeg,png files are valid')}}</i>
                                </div>

                                <div class="col-md-12 col-12"></div>
                               
                                <div class="col-md-6">
                                    <div class="form-group mb-3">
                                        @if(isset($userCompany) && $userCompany->company_logo)
                                            <img src="{{ config('csrnow.admin_url').$userCompany->company_logo }}" id="previewLogo" height="100">
                                        @else
                                            <img src="" id="previewLogo" height="100">
                                        @endif
                                    </div>
                                </div>
                                
                                <div class="col-md-12">
                                    <div id="liveAlertPlaceholder">
                                        @if(isset($userCompany) && $userCompany->company_status === 0)
                                            <div class="alert alert-dark align-items-center alert-dismissible fade show d-block alert_section" role="alert">
                                                <b>{{__('The review of your logo and URL is in progress.')}}</b>
                                                <p>{{__('Please allow up to 7 days for approval and check back periodically.')}}</p>
                                                <a type="button" class="btn-close company-btn-close"  data-bs-dismiss="alert" aria-label="Close"  data-placement="top"></a>
                                            </div>
                                        @elseif(isset($userCompany) && $userCompany->company_status === 2)
                                            <div class="alert alert-dark align-items-center alert-dismissible fade show d-block alert_section" role="alert">
                                                <b>{{__('Logo & url have been rejected')}}</b>
                                                <p>{{__('Your requested company url & logo is rejected. The reason is :')}} {{__($userCompany->rejected_message)}} .</p>
                                                <a type="button" class="btn-close company-btn-close"  data-bs-dismiss="alert" aria-label="Close"  data-placement="top"></a>
                                            </div>
                                        @endif
                                    </div> 
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <button type="submit" class="btn btn-primary submitBtn">{!! renderIconHtml('update') !!}{{__('Update')}}</button>
                                    </div>
                                </div>
                            </div>
                    </form>
                    </div>
                </div>
                </div>
            </div>
        </div>
    </div>
</div>
