<div class="sections theme-form">
    <div class="section-tabs">
        <span class="section-tab active" data-name="azienda">Azienda</span>
        <span class="section-tab" data-name="servizi">Servizi</span>
        <span class="section-tab" data-name="attività">Attività</span>
        <span class="section-tab" data-name="tariffario">Tariffario</span>
    </div>

    <div class="section-content active" data-name="azienda">
        <div class="row">
            <div class="col-md-6 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="logo">Logo</label>
                    <input class="form-control @error('logo') is-invalid @enderror" id="logo" name="logo" type="file" placeholder="Nessun file selezionato" accept="image/*" required>
                    @error('logo')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>

            <div class="col-md-6"></div>

            <div class="col-md-6 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="name">Ragione sociale</label>
                    <input class="form-control @error('name') is-invalid @enderror" id="name" name="name" type="text" placeholder="Inserisci" required value="{{$name}}">
                    @error('name')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-6 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="business_name">Nome business</label>
                    <input class="form-control @error('business_name') is-invalid @enderror" id="business_name" name="business_name" type="text" placeholder="Inserisci" required value="{{$business_name}}">
                    @error('business_name')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>

            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="phone">Telefono</label>
                    <input class="form-control @error('phone') is-invalid @enderror" id="phone" name="phone" type="tel" placeholder="Inserisci" required value="{{$phone}}">
                    @error('phone')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="email">Email</label>
                    <input class="form-control @error('email') is-invalid @enderror" id="email" name="email" type="email" placeholder="Inserisci" required value="{{$email}}">
                    @error('email')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="pec">Pec</label>
                    <input class="form-control @error('pec') is-invalid @enderror" id="pec" name="pec" type="text" placeholder="Inserisci" required value="{{$pec}}">
                    @error('pec')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="costitution_date">Data costituzione</label>
                    <input class="form-control @error('costitution_date') is-invalid @enderror" id="costitution_date" name="costitution_date" type="date" placeholder="Inserisci" required value="{{$costitution_date}}">
                    @error('costitution_date')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>

            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="address">Indirizzo</label>
                    <input class="form-control @error('address') is-invalid @enderror" id="address" name="address" type="text" placeholder="Inserisci" required value="{{$address}}">
                    @error('address')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="zip">Cap</label>
                    <input class="form-control @error('zip') is-invalid @enderror" id="zip" name="zip" type="text" placeholder="Inserisci" required value="{{$zip}}">
                    @error('zip')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="city_id">Città</label>
                    <select class="form-select @error('city_id') is-invalid @enderror" id="city_id" name="city_id" required>
                        <option value="" @if (!$city_id) selected @endif disabled>Seleziona</option>
                        {{-- @foreach ($cities as $city)
                        <option value="{{$city->id}}" @if ($city_id==$city->id) selected @endif>{{$city->name}}</option>
                        @endforeach --}}
                        <option value="city_1">city_1</option>
                    </select>
                    @error('city_id')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="country_id">Stato</label>
                    <select class="form-select @error('country_id') is-invalid @enderror" id="country_id" name="country_id" required>
                        <option value="" @if (!$country_id) selected @endif disabled>Seleziona</option>
                        {{-- @foreach ($countries as $country)
                        <option value="{{$country->id}}" @if ($country_id==$country->id) selected @endif>{{$country->name}}</option>
                        @endforeach --}}
                        <option value="country_1">country_1</option>
                    </select>
                    @error('country_id')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>

            <div class="col-md-12 col-xs-12 mb-4">
                <div class="form-group has-switch">
                    <label for="operational_headquarters">Sede operativa uguale alla sede legale</label>
                    <label class="switch">
                        <input class="form-control @error('operational_headquarters') is-invalid @enderror" id="operational_headquarters" name="operational_headquarters" type="checkbox" @if ($operational_headquarters) checked @endif>
                        @error('operational_headquarters')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                        <span class="switch-state bg-primary"></span>
                    </label>
                </div>
            </div>

            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="fiscal_code">Codice fiscale</label>
                    <input class="form-control @error('fiscal_code') is-invalid @enderror" id="fiscal_code" name="fiscal_code" type="text" placeholder="Inserisci" required value="{{$fiscal_code}}">
                    @error('fiscal_code')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="vat">Partita Iva</label>
                    <input class="form-control @error('vat') is-invalid @enderror" id="vat" name="vat" type="text" placeholder="Inserisci" required value="{{$vat}}">
                    @error('vat')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="sdi_code">Codice SDI</label>
                    <input class="form-control @error('sdi_code') is-invalid @enderror" id="sdi_code" name="sdi_code" type="text" placeholder="Inserisci" required value="{{$sdi_code}}">
                    @error('sdi_code')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>
            <div class="col-md-3 col-xs-12 mb-4">
                <div class="form-group">
                    <label for="ateco_code">Codice ateco</label>
                    <input class="form-control @error('ateco_code') is-invalid @enderror" id="ateco_code" name="ateco_code" type="text" placeholder="Inserisci" required value="{{$ateco_code}}">
                    @error('ateco_code')
                    <div class="invalid-feedback">{{ $message }}</div>
                    @enderror
                </div>
            </div>

            <div class="col-md-12 mb-4"></div>

            <div class="col-md-12 col-xs-12 mb-4 mt-4">
                <div class="form-group">
                    <button class="btn btn-primary text-uppercase btn-medium" type="button" wire:click="save()">Salva</button>
                </div>
            </div>
        </div>
    </div>

    <div class="section-content" data-name="servizi">
        <livewire:company-service :company="$current_company" />
    </div>

    <div class="section-content" data-name="attività">
        <livewire:company-activity :company="$current_company" />
    </div>
    
    <div class="section-content" data-name="tariffario">
        <livewire:company-rate :company="$current_company" />
    </div>
</div>