<template>
  <header class="navbar">
    <div class="container">
      <RouterLink
        to="/"
        class="logo"
      >
        <img
          src="/spbr-uncolored-nostars-noring.png"
          alt="Logo"
        >
      </RouterLink>

      <nav class="links">
        <a href="#">Supported games</a>
        <a href="#">Error Codes</a>
        <a href="#">Discord Server</a>
        <a href="#">Install SPBR</a>
      </nav>

      <div class="search-box">
        <input
          v-model="query"
          type="text"
          placeholder="Search"
        >
        <button class="search-btn">
          <Icon
            name="octicon:search-24"
            class="icon"
            alt="Search"
          />
        </button>
      </div>
    </div>
  </header>
</template>

<script setup>
import { ref } from 'vue'

const query = ref('')
</script>

<style scoped>
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
}

.navbar {
  background-color: #383838;
  border-bottom: 2px solid #333;
  padding: 10px 20px;
  font-family: 'Arial', sans-serif;
}

.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.logo img {
  height: 30px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.links {
  display: flex;
  gap: 25px;
}

.links a {
  text-decoration: none;
  color: #aaa;
  font-weight: bold;
  font-size: 14px;
  transition: color 0.2s;
}

.links a:hover {
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 20px;
  padding: 4px 12px;
}

.search-box input {
  border: none;
  outline: none;
  padding: 5px;
  font-size: 14px;
  color: #eee;
  background: transparent;
  width: 150px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  margin-left: 5px;
}

:deep(.icon) {
  width: 18px;
  height: 18px;
  color: #aaa;
  fill: currentColor;
  transition: color 0.2s, transform 0.1s;
  opacity: 0.8;
}

.search-btn:hover :deep(.icon) {
  color: #fff;
  transform: scale(1.1);
}
</style>
