@extends('layout')

@section('title', __('store.clientarea_nav_profile'))

@section('content')
<div class="container py-5">
    <x-clientarea.page-header
        icon="fas fa-user-cog"
        :title="$profilePageTitle ?? __('store.clientarea_nav_profile')"
        :subtitle="$profilePageSubtitle ?? __('store.clientarea_profile_subtitle')"
    />
    <div class="row">
        <!-- Main Content -->
        <div class="col-md-8">
            @yield('profile-content')
        </div>

        <!-- Profile Navigation Sidebar -->
        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <h6 class="mb-0">
                        <i class="fas fa-tools me-2"></i>{{ __('store.clientarea_profile_navigation_title') }}
                    </h6>
                </div>
                <div class="list-group list-group-flush">
                    <a href="{{ route('store.auth.profile.index') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.index') ? 'active' : '' }}">
                        <i class="fas fa-user me-2"></i>{{ __('store.clientarea_profile_navigation_edit_profile') }}
                    </a>

                    <div class="list-group-item px-3 py-2 border-top" style="background: transparent;">
                        <small class="text-muted fw-semibold text-uppercase" style="font-size: 0.7rem;">{{ __('store.clientarea_profile_navigation_payment_methods') }}</small>
                    </div>
                    <a href="{{ route('store.auth.profile.saved-methods') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.saved-methods*') ? 'active' : '' }}">
                        <i class="fas fa-credit-card me-2"></i>{{ __('store.clientarea_profile_navigation_payment_methods') }}
                    </a>
                    <a href="{{ route('store.auth.profile.billing-addresses.index') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.billing-addresses.index') ? 'active' : '' }}">
                        <i class="fas fa-address-book me-2"></i>{{ __('store.clientarea_profile_navigation_billing_addresses') }}
                    </a>

                    <div class="list-group-item px-3 py-2 border-top" style="background: transparent;">
                        <small class="text-muted fw-semibold text-uppercase" style="font-size: 0.7rem;">{{ __('store.clientarea_profile_navigation_authorized_accounts') }}</small>
                    </div>
                    <a href="{{ route('store.auth.profile.authorized-accounts') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.authorized-accounts') ? 'active' : '' }}">
                        <i class="fas fa-users me-2"></i>{{ __('store.clientarea_profile_navigation_authorized_accounts') }}
                    </a>
                    <a href="{{ route('store.auth.profile.my-authorizations') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.my-authorizations') ? 'active' : '' }}">
                        <i class="fas fa-user-shield me-2"></i>{{ __('store.clientarea_profile_navigation_my_authorizations') }}
                    </a>

                    @if(\App\Models\Setting::getValue('client_email_preferences', true))
                    <div class="list-group-item px-3 py-2 border-top" style="background: transparent;">
                        <small class="text-muted fw-semibold text-uppercase" style="font-size: 0.7rem;">{{ __('store.clientarea_profile_navigation_communication_preferences') }}</small>
                    </div>
                    <a href="{{ route('store.auth.profile.communication-preferences') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.communication-preferences') ? 'active' : '' }}">
                        <i class="fas fa-bell me-2"></i>{{ __('store.clientarea_profile_navigation_communication_preferences') }}
                    </a>
                    @endif
                    <a href="{{ route('store.auth.profile.notifications') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.notifications') ? 'active' : '' }}">
                        <i class="fas fa-envelope me-2"></i>{{ __('store.clientarea_profile_navigation_notifications') }}
                    </a>

                    <div class="list-group-item px-3 py-2 border-top" style="background: transparent;">
                        <small class="text-muted fw-semibold text-uppercase" style="font-size: 0.7rem;">{{ __('store/two-factor.nav_title') }}</small>
                    </div>
                    <a href="{{ route('store.auth.profile.security') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.security') ? 'active' : '' }}">
                        <i class="fas fa-lock me-2"></i>{{ __('store/two-factor.nav_title') }}
                    </a>
                    <a href="{{ route('store.auth.profile.login-history') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.login-history') ? 'active' : '' }}">
                        <i class="fas fa-shield-alt me-2"></i>{{ __('store.login_history_title') }}
                    </a>
                    <a href="{{ route('store.auth.profile.account-activity') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.profile.account-activity') ? 'active' : '' }}">
                        <i class="fas fa-history me-2"></i>{{ __('store.clientarea_profile_navigation_account_activity') }}
                    </a>
                    <a href="{{ route('store.auth.data-privacy') }}"
                       class="list-group-item list-group-item-action {{ request()->routeIs('store.auth.data-privacy*') ? 'active' : '' }}">
                        <i class="fas fa-user-lock me-2"></i>{{ __('store.data_privacy_title') }}
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@push('scripts')
@stack('profile-scripts')
@endpush