<script>
  import { page } from '$app/stores';
</script>

<header class="absolute left-0 right-0 mx-auto w-[calc(100%-1rem)] md:w-[80%] md:left-1/2 md:-translate-x-1/2 z-50 h-auto mt-2 rounded-lg">
  <div class="navbar bg-transparent px-4 md:px-8 lg:px-12 h-full relative">
    <!-- Logo -->
    <div class="flex-1">
      <a href="/" class="inline-block text-2xl font-display text-white hover:opacity-80 transition-opacity">
        <img src="/logo.png" alt="Standard Marine GCC" class="h-16 w-auto filter brightness-0 invert" />
      </a>
    </div>

    <!-- Navigation -->
    <div class="flex-none">
      <ul class="menu menu-horizontal px-1 text-white font-body text-lg">
        <li class="relative">
          <a 
            href="/products" 
            class="hover:bg-white/10 transition-colors"
            class:active={$page.url.pathname === '/products'}
          >
            Products
          </a>
        </li>
        <li class="relative">
          <a 
            href="/services" 
            class="hover:bg-white/10 transition-colors"
            class:active={$page.url.pathname === '/services'}
          >
            Services
          </a>
        </li>
        <li class="relative">
          <a 
            href="/contact" 
            class="hover:bg-white/10 transition-colors"
            class:active={$page.url.pathname === '/contact'}
          >
            Contact Us
          </a>
        </li>
      </ul>
    </div>
  </div>

  <!-- Glass effect background -->
  <div class="absolute rounded-lg inset-0 bg-black/30 backdrop-blur-sm -z-10"></div>
</header>

<style>
  .active {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 500;
  }

  /* Glass effect on scroll */
  :global(.scrolled) header {
    background-color: rgb(var(--color-base-100) / 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgb(var(--color-base-200) / 0.5);
    transition: all 0.3s ease;
  }
</style> 