<style>
    :root {
        --hdr-primary: #2563eb;
        --hdr-primary-hover: #1d4ed8;
        --hdr-indigo: #6366f1;
        --hdr-dark: #0f172a;
        --hdr-text: #334155;
        --hdr-border: #e2e8f0;
    }

    /* Top Utility Bar */
    .gw-topbar {
        background: #090d16;
        color: #94a3b8;
        font-size: 12px;
        padding: 7px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        letter-spacing: 0.01em;
    }
    .gw-topbar a {
        color: #cbd5e1;
        text-decoration: none;
        transition: color 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .gw-topbar a:hover {
        color: #38bdf8;
    }
    .gw-topbar-status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(16, 185, 129, 0.12);
        border: 1px solid rgba(16, 185, 129, 0.25);
        color: #34d399;
        padding: 2px 10px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
    }
    .gw-pulse-circle {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: #10b981;
        box-shadow: 0 0 8px #10b981;
        animation: pulse-ring 1.8s infinite;
    }
    @keyframes pulse-ring {
        0% { transform: scale(0.9); opacity: 0.9; }
        50% { transform: scale(1.6); opacity: 0.4; }
        100% { transform: scale(0.9); opacity: 0.9; }
    }

    /* Main Glass Navbar */
    .gw-navbar {
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid rgba(226, 232, 240, 0.85);
        padding: 12px 0;
        position: sticky;
        top: 0;
        z-index: 1000;
        transition: all 0.2s ease;
    }

    /* Brand Logo Area */
    .gw-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: #0f172a;
    }
    .gw-brand-icon {
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, var(--hdr-primary), var(--hdr-indigo));
        border-radius: 12px;
        display: grid;
        place-items: center;
        color: #ffffff;
        font-size: 18px;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
        flex-shrink: 0;
    }
    .gw-brand-text {
        display: flex;
        flex-direction: column;
    }
    .gw-brand-title {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: #0f172a;
        line-height: 1.15;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .gw-brand-pill {
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        padding: 1px 6px;
        border-radius: 6px;
        background: #eff6ff;
        color: #2563eb;
        border: 1px solid #bfdbfe;
    }
    .gw-brand-subtitle {
        font-size: 11.5px;
        color: #64748b;
        font-weight: 600;
    }

    /* Nav Links */
    .gw-nav-menu {
        display: flex;
        align-items: center;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .gw-nav-link {
        color: #475569 !important;
        font-size: 14px;
        font-weight: 600;
        padding: 8px 16px !important;
        border-radius: 10px;
        text-decoration: none;
        transition: all 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }
    .gw-nav-link i {
        font-size: 13.5px;
        color: #64748b;
        transition: color 0.15s ease;
    }
    .gw-nav-link:hover {
        color: #2563eb !important;
        background: #f1f5f9;
    }
    .gw-nav-link:hover i {
        color: #2563eb;
    }
    .gw-nav-link.active {
        color: #2563eb !important;
        background: #eff6ff;
        font-weight: 700;
    }
    .gw-nav-link.active i {
        color: #2563eb;
    }

    /* Action Buttons */
    .gw-btn-login {
        color: #334155 !important;
        border: 1px solid #cbd5e1;
        background: #ffffff;
        padding: 8px 16px;
        border-radius: 10px;
        font-size: 13.5px;
        font-weight: 700;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.15s ease;
    }
    .gw-btn-login:hover {
        background: #f8fafc;
        border-color: #94a3b8;
        color: #0f172a !important;
    }
    .gw-btn-cta {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: #ffffff !important;
        padding: 9px 20px;
        border-radius: 10px;
        font-size: 13.5px;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
        display: inline-flex;
        align-items: center;
        gap: 7px;
        transition: all 0.2s ease;
        border: none;
    }
    .gw-btn-cta:hover {
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
    }

    /* Mobile Hamburger */
    .gw-menu-toggle {
        display: none;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        color: #0f172a;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 18px;
        cursor: pointer;
        place-items: center;
    }

    /* Mobile Menu Drawer */
    .gw-mobile-drawer {
        display: none;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        padding: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }
    .gw-mobile-drawer.is-open {
        display: block;
    }
    .gw-mobile-links {
        list-style: none;
        padding: 0;
        margin: 0 0 18px;
        display: grid;
        gap: 6px;
    }
    .gw-mobile-links a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 10px;
        color: #334155;
        font-size: 14.5px;
        font-weight: 600;
        text-decoration: none;
    }
    .gw-mobile-links a.active, .gw-mobile-links a:hover {
        background: #eff6ff;
        color: #2563eb;
    }

    @media (max-width: 991px) {
        .gw-nav-menu, .gw-desktop-actions {
            display: none !important;
        }
        .gw-menu-toggle {
            display: grid;
        }
    }
</style>

<header>
    <!-- Top Bar (Desktop) -->
    <div class="gw-topbar d-none d-md-block">
        <div class="container d-flex justify-content-between align-items-center">
            <div class="d-flex align-items-center gap-4">
                <span class="gw-topbar-status">
                    <span class="gw-pulse-circle"></span>
                    <span>Gateway Status: <strong>Real-Time Active</strong></span>
                </span>
                <span class="d-none d-lg-inline-flex align-items-center gap-1" style="color:#cbd5e1; font-family:'JetBrains Mono', monospace; font-size:11.5px; background:rgba(255,255,255,0.06); padding:2px 8px; border-radius:6px; border:1px solid rgba(255,255,255,0.1);">
                    <i class="fa fa-clock-o text-info"></i> <span id="gwRealTimeClock">--:--:--</span>
                </span>
                @if(!empty($phone))
                    <a href="tel:{{ $phone }}"><i class="fa fa-phone text-primary"></i> Hotline: <strong>{{ $phone }}</strong></a>
                @endif
                @if(!empty($address))
                    <span><i class="fa fa-map-marker text-info"></i> {{ $address }}</span>
                @endif
            </div>

            <div class="d-flex align-items-center gap-3">
                <a href="{{ url('/api_documentation') }}"><i class="fa fa-terminal text-info"></i> REST API Docs</a>
                <span style="color:rgba(255,255,255,0.15);">|</span>
                <a href="{{ url('/login') }}"><i class="fa fa-user-circle text-warning"></i> Portal Sign In</a>
            </div>
        </div>
    </div>

    <!-- Main Navigation Bar -->
    <nav class="gw-navbar">
        <div class="container d-flex justify-content-between align-items-center">
            <!-- Brand Logo Area -->
            <a href="{{ url('/') }}" class="gw-brand">
                <div class="gw-brand-icon">
                    <i class="fa fa-paper-plane"></i>
                </div>
                <div class="gw-brand-text">
                    <div class="gw-brand-title">
                        <span>SMS Gateway</span>
                        <span class="gw-brand-pill">v2.0</span>
                    </div>
                    <span class="gw-brand-subtitle">Android Node &amp; REST Aggregator</span>
                </div>
            </a>

            <!-- Desktop Navigation Menu -->
            <ul class="gw-nav-menu">
                <li>
                    <a class="gw-nav-link {{ request()->is('/') ? 'active' : '' }}" href="{{ url('/') }}">
                        <i class="fa fa-home"></i>
                        <span>Home</span>
                    </a>
                </li>
                <li>
                    <a class="gw-nav-link {{ request()->is('packages') ? 'active' : '' }}" href="{{ url('/packages') }}">
                        <i class="fa fa-tag"></i>
                        <span>Packages &amp; Rates</span>
                    </a>
                </li>
                <li>
                    <a class="gw-nav-link {{ request()->is('api_documentation') ? 'active' : '' }}" href="{{ url('/api_documentation') }}">
                        <i class="fa fa-code"></i>
                        <span>API Reference</span>
                    </a>
                </li>
                <li>
                    <a class="gw-nav-link {{ request()->is('contact') ? 'active' : '' }}" href="{{ url('/contact') }}">
                        <i class="fa fa-envelope"></i>
                        <span>Contact Support</span>
                    </a>
                </li>
            </ul>

            <!-- Desktop Action Buttons -->
            <div class="gw-desktop-actions d-flex align-items-center gap-2">
                <a href="{{ url('/login') }}" class="gw-btn-login">
                    <i class="fa fa-sign-in"></i>
                    <span>Login</span>
                </a>
                <a href="{{ url('/register') }}" class="gw-btn-cta">
                    <i class="fa fa-rocket"></i>
                    <span>Get Started</span>
                </a>
            </div>

            <!-- Mobile Toggle Button -->
            <button class="gw-menu-toggle" id="gwMenuToggle" aria-label="Toggle menu" onclick="toggleMobileMenu()">
                <i class="fa fa-bars" id="gwMenuIcon"></i>
            </button>
        </div>

        <!-- Mobile Drawer Menu -->
        <div class="gw-mobile-drawer" id="gwMobileDrawer">
            <ul class="gw-mobile-links">
                <li>
                    <a class="{{ request()->is('/') ? 'active' : '' }}" href="{{ url('/') }}">
                        <i class="fa fa-home text-primary"></i> Home Overview
                    </a>
                </li>
                <li>
                    <a class="{{ request()->is('packages') ? 'active' : '' }}" href="{{ url('/packages') }}">
                        <i class="fa fa-tag text-success"></i> Packages &amp; Rates
                    </a>
                </li>
                <li>
                    <a class="{{ request()->is('api_documentation') ? 'active' : '' }}" href="{{ url('/api_documentation') }}">
                        <i class="fa fa-code text-info"></i> API Reference
                    </a>
                </li>
                <li>
                    <a class="{{ request()->is('contact') ? 'active' : '' }}" href="{{ url('/contact') }}">
                        <i class="fa fa-envelope text-warning"></i> Contact Support
                    </a>
                </li>
            </ul>

            <div class="d-grid gap-2">
                <a href="{{ url('/login') }}" class="btn btn-outline-primary py-2" style="font-weight:700; border-radius:10px;">
                    <i class="fa fa-sign-in me-1"></i> Sign In to Portal
                </a>
                <a href="{{ url('/register') }}" class="gw-btn-cta py-2 justify-content-center">
                    <i class="fa fa-rocket me-1"></i> Create Free Account
                </a>
            </div>
        </div>
    </nav>
</header>

<script>
    function toggleMobileMenu() {
        const drawer = document.getElementById('gwMobileDrawer');
        const icon = document.getElementById('gwMenuIcon');
        const isOpen = drawer.classList.toggle('is-open');
        
        if (isOpen) {
            icon.className = 'fa fa-times';
        } else {
            icon.className = 'fa fa-bars';
        }
    }

    function updateGatewayRealTimeClock() {
        const clock = document.getElementById('gwRealTimeClock');
        if (!clock) return;
        const now = new Date();
        clock.innerText = now.toLocaleTimeString([], { hour12: true, hour: '2-digit', minute: '2-digit', second: '2-digit' });
    }

    document.addEventListener('DOMContentLoaded', () => {
        updateGatewayRealTimeClock();
        setInterval(updateGatewayRealTimeClock, 1000);
    });
</script>
