@php
    $locales = [
        'ro' => ['label' => 'RO', 'full' => 'Română'],
        'ru' => ['label' => 'RU', 'full' => 'Русский'],
        'en' => ['label' => 'EN', 'full' => 'English'],
    ];
    $current = app()->getLocale();
    $style = $style ?? 'chip';
    $back = urlencode(request()->fullUrl());
@endphp

@if ($style === 'chip')
    <div style="display:inline-flex;align-items:center;gap:2px;background:rgba(255,255,255,.15);border-radius:8px;padding:2px;font-size:12px;">
        @foreach ($locales as $code => $meta)
            <a href="{{ url('/locale/' . $code . '?redirect=' . $back) }}" title="{{ $meta['full'] }}"
                style="background:{{ $code === $current ? 'rgba(255,255,255,.95)' : 'transparent' }};
                       color:{{ $code === $current ? '#1f2937' : '#fff' }};
                       padding:5px 10px;border-radius:6px;font-size:12px;font-weight:600;
                       text-decoration:none;display:inline-block;">
                {{ $meta['label'] }}
            </a>
        @endforeach
    </div>
@else
    <div style="display:inline-flex;gap:4px;font-size:12px;">
        @foreach ($locales as $code => $meta)
            <a href="{{ url('/locale/' . $code . '?redirect=' . $back) }}" title="{{ $meta['full'] }}"
                style="background:{{ $code === $current ? '#3b82f6' : 'transparent' }};
                       color:{{ $code === $current ? '#fff' : '#4b5563' }};
                       border:1px solid {{ $code === $current ? '#3b82f6' : '#d1d5db' }};
                       padding:4px 10px;border-radius:6px;font-size:12px;font-weight:600;
                       text-decoration:none;display:inline-block;">
                {{ $meta['label'] }}
            </a>
        @endforeach
    </div>
@endif
