<script>
  let { screen, onNavigate } = $props();
</script>

<nav class="topbar">
  <div class="logo-area">
    <span class="logo">Journi</span>
  </div>
  <div class="nav-links">
    <button class="nav-btn" class:active={screen === 'worldmap'} onclick={() => onNavigate('worldmap')}>Map</button>
    <button class="nav-btn" class:active={screen === 'timeline'} onclick={() => onNavigate('timeline')}>Journal</button>
  </div>
</nav>

<style>
  .topbar {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 32px;
    height: 52px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    z-index: 10;
  }

  .logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .logo {
    font-family: var(--heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-h);
    letter-spacing: -0.5px;
  }

  .nav-links {
    display: flex;
    gap: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
  }

  .nav-btn {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 300;
    padding: 4px 18px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.01em;
  }
  .nav-btn:hover { color: var(--text-h); }
  .nav-btn.active {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 1px 4px rgba(124,58,237,0.25);
  }
</style>
