.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--card-background);
  border-bottom: 1px solid var(--tile-border);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.navStart, .navEnd {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navSearch {
  flex: 0 1 300px;
  margin: 0 1rem;
}

.secondRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .secondRow {
    margin-top: 0;
  }
  .navSearch {
    flex: 0 1 300px;
    margin: 0 0;
  }
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 1.5rem;
  width: 150px;
}

.logoImage {
  height: auto;
  object-fit: contain;
  width: 100%;
}

.navLinks {
  display: flex;
}

.navLink {
  color: var(--foreground-rgb);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.navLink:hover {
  background-color: var(--hover-overlay);
}

.navLink.active {
  font-weight: 700;
  color: var(--link-color);
}

.authButton {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  height: 36px;
  display: flex;
  align-items: center;
  padding-top: 0.5rem;
}

.authButton:hover {
  background-color: var(--primary-hover);
}

@media (max-width: 600px) {
  .authButton {
    font-size: 0.9rem;
  }
}

/* Responsive styles */
@media (max-width: 1100px) {
  .navbar {
    flex-wrap: wrap;
    padding: 1.0rem 1.5rem 1.7rem;
    gap: 0.7rem;
  }

  .navStart {
    width: 100%;
    justify-content: space-between;
  }

  .navLinks {
    white-space: nowrap;
    gap: 0.5rem;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }

  .navLinks::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome, Safari, Opera */
  }

  .navEnd {
    display: flex;
    align-items: center;
  }
  .navSearch {
    flex: 0 1 300px;
    margin: 0 0;
  }
}

@media (max-width: 600px) {
  .logo {
    margin-right: 0rem;
  }

  .navLink {
    padding: 0.5rem 0.4rem;
    font-size: 0.9rem;
  }

  .navSearch {
    order: 0;
    flex: 1 1 auto;
    margin-right: 1.5rem;
  }

  .navEnd {
    gap: 0.25rem;
  }

  /* Put search and nav end items on same row */
  .navbar {
    flex-wrap: wrap;
  }

  .navStart {
    width: 100%;
  }

  .secondRow {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .navSearch {
    flex: 0 1 300px;
    margin: 0 0;
  }
}

/* Small mobile layout */
@media (max-width: 520px) {
  .navbar {
    padding: 1rem 1.5rem 1.5rem;
    gap: 0;
  }
  
  .navStart {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    display: inline;
    margin-bottom: 1rem;
  }
  
  .logo {
    margin: 0 auto;
    justify-content: center;
    width: 80%;
    max-width: 240px;
  }
  
  .logoImage {
    margin: 0 auto;
    width: 100%;
  }
  
  .navLinks {
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    gap: 0.4rem;
    margin-top: 1rem;
  }
  
  .secondRow {
    margin-top: 0rem;
    gap: 1rem;
    flex-direction: column;
  }

  .navSearch {
    flex: 0;
    margin: 0 0;
  }
}