@extends('layouts.app')

@section('page-title', 'Settings')

@section('content')
 <div class="container" style="border-radius: 113px; background: #08459b; box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
     <div class="container">
    <div class="row">
        <!-- Admin Management Section - Super Admin Only -->
        @auth
            @if(auth()->user()->isSuperAdmin())
                <div class="col-12 mb-4" >
                    <div>
                        <div class="card-header text-white" style="border-radius: 35px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                            <h5 class="mb-0"><i class="fas fa-shield-alt"></i> Admin Management</h5>
                        </div>
                        <div class="card-body">
                            <div class="row g-3">
                                <!-- Manage Admins -->
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('super-admin.admins') }}" class="btn  w-100 p-3">
                                        <i class="fas fa-users-cog fa-2x mb-2"></i>
                                        <br>Manage Admins
                                    </a>
                                </div>

                                <!-- Users -->
                                @auth
                                    @if(auth()->user()->isAdmin() || auth()->user()->isSuperAdmin())
                                        @if(auth()->user()->isSuperAdmin() || auth()->user()->hasPermission('view_customers'))
                                            <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                                <a href="{{ route('admin.users') }}" class="btn w-100 p-3">
                                                    <i class="fas fa-users fa-2x mb-2"></i>
                                                    <br>Users
                                                </a>
                                            </div>
                                        @endif
                                    @endif
                                @endauth

                                <!-- Clients -->
                                @if(auth()->check() && (auth()->user()->isSuperAdmin() || auth()->user()->hasPermission('view_customers')))
                                    <div class="col-md-6 col-lg-2"style="border-radius: 35px; margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                        <a href="{{ route('customers.index') }}" class="btn w-100 p-3">
                                            <i class="fas fa-user fa-2x mb-2"></i>
                                            <br>Clients
                                        </a>
                                    </div>
                                @endif

                                <!-- Permissions -->
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('super-admin.permissions') }}" class="btn w-100 p-3">
                                        <i class="fas fa-lock fa-2x mb-2"></i>
                                        <br>Permissions
                                    </a>
                                </div>

                                <!-- Activity History -->
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('super-admin.activity-logs.index') }}" class="btn w-100 p-3">
                                        <i class="fas fa-history fa-2x mb-2"></i>
                                        <br>Activity History
                                    </a>
                                </div>

                                <!-- Transaction History -->
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('super-admin.activity-logs.transactions') }}" class="btn w-100 p-3">
                                        <i class="fas fa-exchange-alt fa-2x mb-2"></i>
                                        <br>Transaction History
                                    </a>
                                </div>

                                <!-- Statistics -->
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('super-admin.statistics') }}" class="btn w-100 p-3">
                                        <i class="fas fa-chart-bar fa-2x mb-2"></i>
                                        <br>Statistics
                                    </a>
                                </div>
                                 <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('expense-types.index') }}" class="btn w-100 p-3">
                                        <i class="fas fa-minus-circle fa-2x mb-2"></i>
                                        <br>Expence Type
                                    </a>
                                </div>
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('particulars.index') }}" class="btn w-100 p-3">
                                        <i class="fas fa-list-alt fa-2x mb-2"></i>
                                        <br>Particulars
                                    </a>
                                </div>
                                <div class="col-md-6 col-lg-2"style="border-radius: 35px;margin-right: 10px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                                    <a href="{{ route('segments.index') }}"class="btn w-100 p-3">
                                       <i class="fas fa-file-invoice fa-2x mb-2"></i>
                                        <br>Segments
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            @elseif(auth()->user()->isAdmin())
                {{-- Admin (non-super) view --}}
                <div class="col-12 mb-4">
                    <div class="card border-info">
                        <div class="card-header bg-info text-white">
                            <h5 class="mb-0"><i class="fas fa-user-shield"></i> Admin Panel</h5>
                        </div>
                        <div class="card-body">
                            <div class="row g-3">
                                <!-- Users -->
                                @if(auth()->user()->hasPermission('view_customers'))
                                    <div class="col-md-6 col-lg-4">
                                        <a href="{{ route('admin.users') }}" class="btn btn-outline-info w-100 p-3">
                                            <i class="fas fa-users fa-2x mb-2"></i>
                                            <br>Users
                                        </a>
                                    </div>
                                @endif

                                <!-- Clients -->
                                @if(auth()->user()->hasPermission('view_customers'))
                                    <div class="col-md-6 col-lg-4">
                                        <a href="{{ route('customers.index') }}" class="btn btn-outline-info w-100 p-3">
                                            <i class="fas fa-user fa-2x mb-2"></i>
                                            <br>Clients
                                        </a>
                                    </div>
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
            @endif
        @endauth

        <!-- Account Settings Section -->
        <div class="col-12">
            <div>
                <div class="card-header text-white" style="border-radius: 35px;background: #c5dff7;box-shadow: inset 7px 7px 10px #8ea1b2, inset -7px -7px 10px #fcffff;">
                    <h5 class="mb-0">Account Settings</h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <div>
                                <div class="card-body text-center">
                                    <i class="fas fa-user-circle fa-3x text-primary mb-3"></i>
                                    <h6>Profile Information</h6>
                                    <p class="small text-muted">Update your name, email, and other profile details</p>
                                    <a href="{{ route('profile') }}" class="btn btn-sm btn-primary">
                                        <i class="fas fa-edit"></i> Edit Profile
                                    </a>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6 mb-3">
                            <div>
                                <div class="card-body text-center">
                                    <i class="fas fa-key fa-3x text-warning mb-3"></i>
                                    <h6>Change Password</h6>
                                    <p class="small text-muted">Update your password to keep your account secure</p>
                                    <a href="{{ route('password.change') }}" class="btn btn-sm btn-warning">
                                        <i class="fas fa-lock"></i> Change Password
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

 </div>
 @endsection
