/* CSS variables for consistency */
:root {
  --primary-color: #0078d4;
  --text-color: #222;
  --text-light: #444;
  --text-muted: #888;
  --background: #f7f7fa;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

header {
  background: var(--text-color);
  color: var(--white);
  padding: 1rem;
  text-align: center;
}

header .title {
  font-weight: 700;
  max-width: fit-content;
  overflow: hidden;
  border-right: 0.15em solid orange;
  white-space: nowrap;
  letter-spacing: 0.15em;
  animation: typing 8s steps(80, end), blink-caret 1s step-end infinite;
}

.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.navbar--scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

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

/* Brand/Logo */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
  transition: color 0.3s ease;
  background: var(--primary-color);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

/* Mobile toggle button */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.menu-icon {
  height: 100%;
  width: 100;
  font-size: 30px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.navbar-toggle--open .menu-icon:nth-child(1) {
  transform: rotate(90deg) translateY(0px);
}

.navbar-toggle--open .menu-icon:nth-child(2) {
  opacity: 0;
}

.navbar-toggle--open .menu-icon:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* Navigation */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.nav-item {
  margin: 0;
  white-space: nowrap;
}

.nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

/* Language selector in navbar */
.navbar-language {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.lang-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 2px solid rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.lang-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.lang-btn.active {
  background: linear-gradient(45deg, var(--primary-color), #8b5cf6);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.flag {
  font-size: 1rem;
}

/* Mobile styles */
@media (max-width: 1024px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem 1rem;
    gap: 1rem;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .navbar-nav--open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    background-color: white;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.05);
    margin-bottom: 0.5rem;
  }

  .navbar-language {
    margin-left: 0;
    margin-top: 1rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .lang-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

.nav-link .skeleton {
  width: 80px;
  height: 16px;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar {
  animation: slideDown 0.5s ease-out;
}

.navbar-brand:focus,
.nav-link:focus,
.lang-btn:focus,
.navbar-toggle:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .navbar,
  .nav-link,
  .lang-btn,
  .menu-icon {
    transition: none;
    animation: none;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
