/* Основная навигация */
.main-nav {
  background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 30%, #f3f9ff 100%),
    radial-gradient(
      circle at 20% 30%,
      rgba(33, 150, 243, 0.1) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(25, 118, 210, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      circle at 40% 50%,
      rgba(13, 71, 161, 0.06) 0%,
      transparent 70%
    );
  padding: 0 40px 10px 40px;
  border-top: 1px solid #e3f2fd;
  border-bottom: 1px solid #bbdefb;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(33, 150, 243, 0.08);
}

/* Плавающие частицы фона в новой палитре */
.main-nav .nav-particle {
  position: absolute;
  border-radius: 50%;
  animation: floatParticle 8s ease-in-out infinite;
  z-index: 0;
}

.main-nav .nav-particle:nth-child(1) {
  width: 12px;
  height: 12px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  background: rgba(77, 208, 225, 0.15);
}

.main-nav .nav-particle:nth-child(2) {
  width: 8px;
  height: 8px;
  top: 60%;
  left: 80%;
  animation-delay: -2s;
  background: rgba(38, 166, 154, 0.2);
}

.main-nav .nav-particle:nth-child(3) {
  width: 15px;
  height: 15px;
  top: 80%;
  left: 30%;
  animation-delay: -4s;
  background: rgba(41, 182, 246, 0.12);
}

.main-nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: center;
  margin: 0;
  padding: 15px 0;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease-in-out;
}

.main-nav ul li a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center; /* центрируем текст */
  width: fit-content; /* чтобы не растягивались */
  transition: all 0.3s ease;
  padding: 10px 20px;
  border-radius: 6px;
  display: block;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(33, 150, 243, 0.15);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.main-nav ul li a:hover {
  color: #1976d2;
  background: rgba(255, 255, 255, 1);
  border-color: rgba(33, 150, 243, 0.3);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
  transform: translateY(-1px);
}

/* Анимации */
@keyframes floatParticle {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translate(10px, -8px) scale(1.1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-5px, 5px) scale(0.9);
    opacity: 0.4;
  }
  75% {
    transform: translate(8px, 3px) scale(1.05);
    opacity: 0.7;
  }
}

/* Адаптивность */
@media (max-width: 1024px) {
  .main-nav ul {
    gap: 8px 15px;
  }

  .main-nav ul li a {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}

@media (max-width: 900px) {
  .main-nav {
    padding: 0 15px 8px 15px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
    align-items: center;
  }

  .main-nav ul li a {
    font-size: 0.9rem;
    padding: 12px 20px;
    text-align: center;
    margin: 0 5px;
    width: fit-content;
    min-width: 200px;
  }

  .main-nav ul li:last-child a {
    border-bottom: none;
  }

  .nav-particle {
    display: none;
  }
}

@media (max-width: 480px) {
  .main-nav {
    padding: 15px;
    border-top-width: 1px;
    border-bottom-width: 1px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
    align-items: center;
  }

  .main-nav ul li a {
    font-size: 0.8rem;
    padding: 10px 5px;
    text-align: center;
    margin: 0 5px;
  }
}

/* Плавное появление при загрузке */
.main-nav {
  animation: navEntrance 0.8s ease-out;
}

@keyframes navEntrance {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
