#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

#main-header.scrolled {
  background: rgba(8, 8, 8, 0.95);
  border-bottom-color: rgba(255, 45, 45, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#main-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 45, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#main-header.scrolled::after {
  opacity: 1;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-logo:hover {
  transform: translateY(-1px);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(135deg, var(--accent-red), var(--deep-red));
  box-shadow: 0 4px 14px rgba(255, 45, 45, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-logo:hover .logo-icon {
  box-shadow: 0 6px 20px rgba(255, 45, 45, 0.5);
  transform: rotate(-6deg);
}

.logo-accent {
  background: linear-gradient(135deg, var(--accent-red), #ff7b7b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-red);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--white);
  background: rgba(255, 45, 45, 0.1);
}

.nav-link.active::after {
  transform: scaleX(1);
}

.nav-search-wrap {
  flex: 1;
  max-width: 420px;
}

.nav-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 42px 10px 16px;
  font-size: 0.85rem;
  color: var(--white);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 45, 45, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 45, 45, 0.08);
  outline: none;
}

.nav-search input::placeholder {
  color: var(--muted);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.search-btn:hover {
  color: var(--accent-red);
  background: rgba(255, 45, 45, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-login {
  background: linear-gradient(135deg, var(--accent-red), var(--deep-red));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 9px 20px;
  border-radius: 11px;
  box-shadow: 0 4px 16px rgba(255, 45, 45, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 45, 45, 0.45);
}

.btn-telegram {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 158, 217, 0.1);
  color: #229ED9;
  border: 1px solid rgba(34, 158, 217, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-telegram:hover {
  background: rgba(34, 158, 217, 0.18);
  transform: translateY(-1px);
}