@import 'common.css';

.navbar {
  background-color: var(--nav-bg);
  color: var(--text-color);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-color);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  width: 100%;
  height: 64px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 0 1rem;
}

.logo {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.nav-links .link {
  display: flex;
  align-items: center;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
  opacity: 0.8;
  letter-spacing: 0.02em;
  height: 100%;
}

.nav-links .link:hover {
  color: var(--primary-color);
  opacity: 1;
}

.nav-links .link.active {
  color: var(--primary-color);
  opacity: 1;
}

.nav-links .link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

.hamburger {
  display: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger .bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

/* Theme Toggle Styles */
.theme-toggle-container {
  margin-left: auto;
  margin-right: 1rem;
  display: flex;
  align-items: center;
}

.theme-toggle {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 24px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  transition: all 0.3s ease;
}

.theme-toggle i {
  font-size: 14px;
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

.theme-toggle .fa-sun {
  color: var(--accent-color);
  opacity: 1;
}

.theme-toggle .fa-moon {
  color: var(--accent-color);
  opacity: 0;
}

.theme-ball {
  position: absolute;
  left: 4px;
  width: 18px;
  height: 18px;
  background-color: var(--toggle-ball);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 2;
}

/* Dark theme styles */
[data-theme="dark"] .theme-toggle {
  background-color: var(--toggle-bg);
}

[data-theme="dark"] .theme-toggle .fa-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .fa-moon {
  opacity: 1;
}

[data-theme="dark"] .theme-ball {
  transform: translateX(24px);
  background-color: var(--toggle-ball);
}

/* Mobile styles */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }

  .hamburger {
    display: block;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    background-color: var(--navbar-bg);
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    transition: left 0.3s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    left: 0;
  }

  .theme-toggle-container {
    margin-right: 0.5rem;
  }
}
