/* ============================================================
   NAVBAR.CSS — DigiOpo
   Navigaatio, logo, haku, hakutulokset
   ============================================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--navbar);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
}

.logo {
  color: white;
}

.logo-main {
  font-weight: 700;
}

.nav-menu a {
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.15);
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-weight: 600;
  transition: background 0.2s ease;
}

.home-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Haku */

.header-search {
  position: relative;
}

.header-search input {
  padding: 8px 36px 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  width: 220px;
}

.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

#searchResults {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.result-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.result-item:hover {
  background: #f1f5f9;
}

.result-item.selected {
  background: #e0e7ff;
}

/* Mobiili */

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }

  .header-search input {
    width: 140px;
  }
}
