@extends('layouts.base')

@section('title', 'Security')

@section('content')

{{-- ===== HERO ===== --}}
<section class="bg-body-bg py-16">
    <div class="max-w-7xl mx-auto px-4 sm:px-6">
        <div class="grid grid-cols-1 lg:grid-cols-12 gap-8 items-center">
            <div class="lg:col-span-8">
                <h1 class="font-serif text-3xl md:text-4xl font-bold text-body-text leading-tight">
                    How we protect <span class="text-primary">your account</span>
                </h1>
                <p class="text-body-muted text-lg mt-3">Security is a core part of our platform, not an afterthought.</p>
                <p class="text-body-muted mt-2">We use industry-standard security practices to protect your data and funds. Below you can learn about the specific measures we have in place.</p>
            </div>
            <div class="lg:col-span-4">
                <div class="bg-white rounded-xl border border-body-border p-6">
                    <div class="flex items-center gap-3">
                        <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                            <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
                        </div>
                        <div>
                            <p class="font-bold text-body-text">Security first</p>
                            <span class="text-body-muted text-sm">SSL encryption on all connections</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

{{-- ===== SECURITY FEATURES ===== --}}
<section class="bg-surface-base py-16 text-white">
    <div class="max-w-7xl mx-auto px-4 sm:px-6">
        <div class="grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
            <div class="lg:col-span-4">
                <h2 class="font-serif text-3xl font-bold">Built with <span class="text-primary">security</span> in mind</h2>
                <p class="text-gray-300 mt-4 leading-relaxed">We follow standard security practices to protect your personal information and trading activity. Our team regularly reviews and updates our security measures.</p>
            </div>
            <div class="lg:col-span-8">
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    @php
                        $secFeatures = [
                            ['icon' => 'M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z', 'text' => 'SSL/TLS encrypted connections'],
                            ['icon' => 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z', 'text' => 'Two-factor authentication (2FA)'],
                            ['icon' => 'M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z', 'text' => 'Segregated client accounts'],
                            ['icon' => 'M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2', 'text' => 'KYC identity verification'],
                        ];
                    @endphp
                    @foreach($secFeatures as $sf)
                    <div class="flex items-center gap-3 bg-white/5 rounded-lg p-4">
                        <svg class="w-10 h-10 text-primary flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="{{ $sf['icon'] }}"/></svg>
                        <p class="text-white text-sm font-medium">{{ $sf['text'] }}</p>
                    </div>
                    @endforeach
                </div>
            </div>
        </div>
    </div>
</section>

{{-- ===== FUND SAFETY ===== --}}
<section class="bg-body-bg py-16">
    <div class="max-w-7xl mx-auto px-4 sm:px-6">
        <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-start">
            <div>
                <h2 class="font-serif text-3xl font-bold text-body-text">How we handle your funds</h2>
                <p class="text-body-muted mt-4 leading-relaxed">{{ $settings->site_name }} keeps client funds in segregated accounts, separate from company operating funds. This means your deposits are not used for our business expenses.</p>
                <ul class="mt-6 space-y-3">
                    @php
                        $fundFeatures = [
                            'Client funds held separately from company funds',
                            'SSL encryption on all data transmissions',
                            'Regular security reviews and updates',
                            'Verified withdrawal process with identity checks',
                        ];
                    @endphp
                    @foreach($fundFeatures as $f)
                    <li class="flex items-start">
                        <svg class="w-5 h-5 text-primary flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>
                        <span class="text-body-muted text-sm ml-2">{{ $f }}</span>
                    </li>
                    @endforeach
                </ul>
            </div>
            <div class="bg-white rounded-xl border border-body-border shadow-sm p-2">
                <div id="tradingview-widget"></div>
            </div>
        </div>
    </div>
</section>

@push('scripts')
<script type="text/javascript">
    new TradingView.widget({
        "autosize": true,
        "symbol": "BITSTAMP:BTCUSD",
        "interval": "D",
        "timezone": "Etc/UTC",
        "theme": "light",
        "style": "1",
        "locale": "en",
        "toolbar_bg": "#f1f3f6",
        "enable_publishing": false,
        "allow_symbol_change": true,
        "container_id": "tradingview-widget",
        "height": "400",
        "width": "100%"
    });
</script>
@endpush

{{-- ===== ACCOUNT SECURITY TIPS ===== --}}
<section class="bg-white py-16">
    <div class="max-w-7xl mx-auto px-4 sm:px-6">
        <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
            <div class="flex items-start gap-4">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center flex-shrink-0">
                    <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/></svg>
                </div>
                <div>
                    <h4 class="font-semibold text-body-text">Use a strong password</h4>
                    <p class="text-body-muted text-sm mt-2 leading-relaxed">Choose a unique password that you don't use on other websites. We recommend at least 12 characters with a mix of letters, numbers and symbols.</p>
                </div>
            </div>
            <div class="flex items-start gap-4">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center flex-shrink-0">
                    <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"/></svg>
                </div>
                <div>
                    <h4 class="font-semibold text-body-text">Enable two-factor authentication</h4>
                    <p class="text-body-muted text-sm mt-2 leading-relaxed">Add an extra layer of security to your account by enabling 2FA. This requires a code from your phone each time you log in.</p>
                </div>
            </div>
            <div class="flex items-start gap-4">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center flex-shrink-0">
                    <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
                </div>
                <div>
                    <h4 class="font-semibold text-body-text">Watch for phishing</h4>
                    <p class="text-body-muted text-sm mt-2 leading-relaxed">We will never ask for your password via email. If you receive a suspicious message claiming to be from us, contact our support team directly.</p>
                </div>
            </div>
        </div>
    </div>
</section>

{{-- ===== ASSET CLASSES BAR ===== --}}
<section class="bg-body-bg py-10 border-t border-body-border">
    <div class="max-w-7xl mx-auto px-4 sm:px-6">
        <div class="flex flex-col lg:flex-row items-center gap-6">
            <div class="lg:w-64 lg:border-r lg:border-body-border lg:pr-6">
                <h4 class="font-semibold text-body-text">Available asset classes</h4>
                <p class="text-body-muted text-sm">Browse the markets you can trade on our platform</p>
            </div>
            <div class="flex-1 grid grid-cols-3 md:grid-cols-6 gap-4 text-center">
                @php
                    $products = [
                        ['icon' => 'M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z', 'label' => 'Forex'],
                        ['icon' => 'M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4', 'label' => 'Crypto'],
                        ['icon' => 'M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z', 'label' => 'Indices'],
                        ['icon' => 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z', 'label' => 'Stocks'],
                        ['icon' => 'M13 10V3L4 14h7v7l9-11h-7z', 'label' => 'Energy'],
                        ['icon' => 'M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4', 'label' => 'Commodities'],
                    ];
                @endphp
                @foreach($products as $p)
                <div>
                    <div class="w-12 h-12 rounded-full bg-white border border-body-border mx-auto flex items-center justify-center">
                        <svg class="w-5 h-5 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="{{ $p['icon'] }}"/></svg>
                    </div>
                    <p class="text-body-muted text-xs mt-2">{{ $p['label'] }}</p>
                </div>
                @endforeach
            </div>
        </div>
    </div>
</section>

@endsection
