@php
            $todayVisits = \App\Models\Backend\Visit::todayVisits();
            $thisWeek = \App\Models\Backend\Visit::thisWeekVisits();
            $thisMonth = \App\Models\Backend\Visit::thisMonthVisits();
            $thisYear = \App\Models\Backend\Visit::thisYearVisits();
            $totalVisits = \App\Models\Backend\Visit::totalVisits();
            $mainLinks = \App\Models\Backend\ContentApplication::with(['translations' => function($q) use ($lang) { $q->where('application_translation_language', $lang); }])->where('application_cat', 'MAIN_LINKS')->where('application_status', 'ACTIVE')->orderBy('application_sort')->get();
            $externalLinks = \App\Models\Backend\ContentApplication::with(['translations' => function($q) use ($lang) { $q->where('application_translation_language', $lang); }])->where('application_cat', 'EXTERNAL_LINKS')->where('application_status', 'ACTIVE')->orderBy('application_sort')->get();
            @endphp
            <style>
            .footer {
                background: var(--gray-900);
                color: rgba(255,255,255,0.7);
                font-size: 0.82rem;
                border-top: 1px solid rgba(255,255,255,0.06);
            }
            .footer-main { padding: 48px 0 32px; }
            .footer-grid {
                display: grid;
                grid-template-columns: 2fr 1fr 1fr 1.5fr;
                gap: 40px;
            }
            .footer-brand .fb-logo {
                display: flex; align-items: center; gap: 12px;
                margin-bottom: 14px;
            }
            .footer-brand .fb-logo img { height: 42px; width: auto; }
            .footer-brand .fb-logo span {
                font-size: 0.9rem; font-weight: 700;
                color: white;
            }
            .footer-brand p { font-size: 0.8rem; line-height: 1.7; color: rgba(255,255,255,0.45); }
            .footer-col h4 {
                color: white;
                font-size: 0.8rem; font-weight: 700;
                margin-bottom: 16px;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
            .footer-col ul li { margin-bottom: 6px; }
            .footer-col ul li a {
                color: rgba(255,255,255,0.45);
                transition: all 0.2s;
                font-size: 0.8rem;
            }
            .footer-col ul li a:hover { color: var(--gold); padding-left: 4px; }
            .footer-contact li {
                display: flex; gap: 10px; align-items: flex-start;
                margin-bottom: 10px;
                color: rgba(255,255,255,0.45);
                font-size: 0.8rem;
            }
            .footer-contact li i { width: 16px; margin-top: 4px; color: var(--gold); font-size: 0.75rem; }
            .visitor-stats {
                grid-column: 1 / -1;
                background: rgba(255,255,255,0.04);
                border-radius: 10px;
                padding: 14px 20px 12px;
                margin-top: 24px;
                border: 1px solid rgba(255,255,255,0.08);
            }
            .visitor-stats h5 {
                color: var(--gold);
                font-size: 0.6rem;
                font-weight: 700;
                margin-bottom: 8px;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                text-align: center;
            }
            .visitor-stats .v-row {
                display: flex;
                justify-content: space-around;
                gap: 0;
            }
            .visitor-stats .v-item {
                flex: 1;
                text-align: center;
                padding: 4px 8px;
                font-size: 0.65rem;
                color: rgba(255,255,255,0.45);
                border-right: 1px solid rgba(255,255,255,0.08);
            }
            .visitor-stats .v-item:last-child { border-right: none; }
            .visitor-stats .v-item .v-label { display: block; font-size: 0.58rem; margin-bottom: 3px; color: rgba(255,255,255,0.35); }
            .visitor-stats .v-item .v-value { color: var(--gold); font-weight: 700; font-size: 0.85rem; }
            .social-links { display: flex; gap: 8px; margin-top: 16px; }
            .social-links a {
                width: 34px; height: 34px;
                border-radius: 10px;
                background: rgba(255,255,255,0.05);
                display: flex; align-items: center; justify-content: center;
                color: rgba(255,255,255,0.4);
                transition: all 0.2s;
                font-size: 0.8rem;
                border: 1px solid rgba(255,255,255,0.06);
            }
            .social-links a:hover {
                background: var(--gold);
                color: var(--gray-900);
                border-color: var(--gold);
                transform: translateY(-2px);
            }
            .footer-bottom {
                border-top: 1px solid rgba(255,255,255,0.06);
                padding: 18px 0;
            }
            .footer-bottom .container {
                display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
            }
            .footer-bottom .fb-left { text-align: left; }
            .footer-bottom .fb-left .copy {
                font-size: 0.75rem;
                color: rgba(255,255,255,0.3);
            }
            .footer-bottom .fb-left .browser-note {
                font-size: 0.68rem;
                color: rgba(255,255,255,0.2);
                margin-top: 3px;
            }
            .footer-bottom-links { display: flex; gap: 16px; }
            .footer-bottom-links a {
                color: rgba(255,255,255,0.35);
                transition: color 0.2s;
                font-size: 0.75rem;
            }
            .footer-bottom-links a:hover { color: var(--gold); }
            @media (max-width: 1024px) {
                .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
                .footer-main { padding: 40px 0 24px; }
            }
            @media (max-width: 768px) {
                .footer-grid { grid-template-columns: 1fr; gap: 24px; }
                .footer-main { padding: 32px 0 20px; }
                .footer-brand .fb-logo img { height: 34px; }
                .footer-col h4 { font-size: 0.85rem; }
                .footer-bottom .container { flex-direction: column; text-align: center; gap: 12px; }
                .footer-bottom .fb-left { text-align: center; }
                .footer-bottom-links { justify-content: center; flex-wrap: wrap; gap: 12px; }
                .footer-bottom .fb-left .copy { font-size: 0.75rem; }
            }
            @media (max-width: 480px) {
                .footer-main { padding: 24px 0 16px; }
                .footer-grid { gap: 20px; }
                .footer-brand .fb-logo img { height: 28px; }
                .footer-col ul li a { font-size: 0.78rem; }
                .footer-contact li { font-size: 0.78rem; }
                .footer-bottom-links { gap: 8px; }
                .footer-bottom-links a { font-size: 0.72rem; }
            }
            </style>
            <footer class="footer">
                <div class="footer-main">
                    <div class="container">
                        <div class="footer-grid">
                            <div class="footer-brand">
                                <div class="fb-logo">
                                    <img src="/dynaweb4/img/logo.png" alt="Logo Agensi">
                                    
                                </div>
                                <p>{{ t("dynaweb4_desc") }}</p>
                                <div class="social-links">
                                    <a href="#" aria-label="Facebook"><i class="fab fa-facebook-f"></i></a>
                                    <a href="#" aria-label="Twitter"><i class="fab fa-twitter"></i></a>
                                    <a href="#" aria-label="Instagram"><i class="fab fa-instagram"></i></a>
                                    <a href="#" aria-label="YouTube"><i class="fab fa-youtube"></i></a>
                                </div>
                            </div>
                            <div class="footer-col">
                                <h4>Pautan Utama</h4>
                                <ul>
                                    @foreach($mainLinks as $link)
                                    @php $lt = $link->translations->first(); @endphp
                                    @if($lt)
                                    <li><a href="{{ $link->application_url }}" {{ str_starts_with($link->application_url ?? '', 'http') ? 'target="_blank" rel="noopener"' : '' }}>{{ $lt->application_translation_title }}</a></li>
                                    @endif
                                    @endforeach
                                </ul>
                            </div>
                            <div class="footer-col">
                                <h4>Sambungan</h4>
                                <ul>
                                    @foreach($externalLinks as $link)
                                    @php $lt = $link->translations->first(); @endphp
                                    @if($lt)
                                    <li><a href="{{ $link->application_url }}" target="_blank" rel="noopener">{{ $lt->application_translation_title }}</a></li>
                                    @endif
                                    @endforeach
                                </ul>
                            </div>
                            <div class="footer-col">
                                <h4>Hubungi Kami</h4>
                                <ul class="footer-contact">
                                    <li><i class="fas fa-map-marker-alt"></i> <span>LG-10, Lower Ground Floor, SACC Mall, 40000 Shah Alam, Selangor, MALAYSIA</span></li>
                                    <li><i class="fas fa-envelope"></i> <span>webmaster@dynaweb.com</span></li>
                                    <li><i class="fas fa-phone"></i> <span>+603-8888 0000</span></li>
                                    <li><i class="fas fa-fax"></i> <span>+603-8888 1111</span></li>
                                </ul>
                            </div>
                            <div class="visitor-stats">
                                <h5>Statistik Pelawat</h5>
                                <div class="v-row">
                                    <div class="v-item"><span class="v-label">Hari Ini</span><span class="v-value">{{ number_format($todayVisits) }}</span></div>
                                    <div class="v-item"><span class="v-label">Minggu Ini</span><span class="v-value">{{ number_format($thisWeek) }}</span></div>
                                    <div class="v-item"><span class="v-label">Bulan Ini</span><span class="v-value">{{ number_format($thisMonth) }}</span></div>
                                    <div class="v-item"><span class="v-label">Tahun Ini</span><span class="v-value">{{ number_format($thisYear) }}</span></div>
                                    <div class="v-item"><span class="v-label">Jumlah</span><span class="v-value">{{ number_format($totalVisits) }}</span></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="footer-bottom">
                    <div class="container">
                        <div class="fb-left">
                            <div class="copy">&copy; 2026. Hak Cipta Terpelihara.</div>
                            <div class="browser-note">Paparan terbaik menggunakan pelayar Mozilla Firefox dan Google Chrome dengan resolusi skrin 1366x768.</div>
                        </div>
                        <div class="footer-bottom-links">
                            <a href="#">Penafian</a>
                            <a href="#">Dasar Privasi</a>
                            <a href="#">Dasar Keselamatan</a>
                            <a href="#">Perlindungan Data</a>
                        </div>
                    </div>
                </div>
            </footer>