/* =========================
   HEADER
   ========================= */

/* Базовые сбросы */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #fff;
  background: #0b0b0b;
  padding-top: 70px; /* совпадает с высотой .nav-container */
}

/* ---------- ХЕДЕР ---------- */
.samp-header {
  position: fixed; inset: 0 0 auto 0;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(6px);
  z-index: 9999;
  transform: translateY(0);
  transition: transform 0.4s ease, background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.header-hidden { box-shadow: none; }
.samp-header.scrolled {
  background: rgba(15,15,15,0.95);
  box-shadow: 0 6px 22px rgba(0,0,0,0.45);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Лого */
.nav-logo {
  display: inline-flex; align-items: baseline; gap: 6px;
  text-decoration: none; color: #fff;
  font-weight: 800; letter-spacing: .2px;
}
.nav-logo .logo-accent { color: #e50914; font-size: 1.2rem; }
.nav-logo .logo-suffix { font-size: 1.1rem; }

/* Меню */
.nav-menu {
  display: flex; align-items: center; gap: 24px; flex-wrap: nowrap;
}
.nav-link {
  color: #fff; text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  transition: color .25s ease, background .25s ease;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: #e50914; }

/* Авторизация */
.nav-auth { display: flex; gap: 10px; }
.nav-auth .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; text-decoration: none;
  font-weight: 700; transition: background .25s ease, transform .2s ease;
}
.btn-secondary { background: #404040; color: #fff; }
.btn-secondary:hover { background: #505050; }
.btn-primary { background: #e50914; color: #fff; }
.btn-primary:hover { background: #ff1b1b; }

/* Бургер */
.mobile-menu-toggle {
  display: none;
  flex-direction: column; justify-content: center;
  width: 36px; height: 36px; cursor: pointer; border: 0; background: transparent;
}
.mobile-menu-toggle .burger-line {
  width: 24px; height: 3px; background: #fff; margin: 4px 0; border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}
.mobile-menu-toggle.open .top-line { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.open .middle-line { opacity: 0; transform: scaleX(0); }
.mobile-menu-toggle.open .bottom-line { transform: translateY(-7px) rotate(-45deg); }

.no-scroll { overflow: hidden; }

/* ---------- СТАТИСТИКА: ПК (server-statuspc) ---------- */
.server-statuspc {
  background: #0e0e0e;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative; z-index: 1;
}
.server-statuspc .status-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 24px;
}
.server-statuspc .status-item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  color: #f0f0f0; font-size: 1.05rem; font-weight: 600;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.server-statuspc .status-item i { color: #e50914; font-size: 1.25rem; }
.server-statuspc .status-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.15);
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
}

/* ---------- СТАТИСТИКА: МОБИЛЬНЫЙ (server-status внутри меню) ---------- */
/* По умолчанию не показываем мобильный блок на десктопе */
.samp-header .nav-menu .server-status { display: none; }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 992px) {
  body { padding-top: 64px; }

  /* Меню разворачивается вниз */
  .nav-menu {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: #111;
    overflow: hidden;
    max-height: 0; opacity: 0;
    transition: max-height .35s ease, opacity .25s ease;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .nav-menu.active { opacity: 1; }

  .nav-auth { flex-direction: column; padding: 10px 20px; gap: 8px; }
  .mobile-menu-toggle { display: flex; }

  /* ПК-блок статистики скрываем на мобилке */
  .server-statuspc { display: none; }

  /* Мобильный блок статистики (внутри меню) — показываем и оформляем */
  .samp-header .nav-menu .server-status {
    display: flex; flex-direction: column; gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: #0f0f0f;
  }
  .samp-header .nav-menu .server-status .status-container {
    display: flex; flex-direction: column; gap: 12px;
    padding: 0; margin: 0;
  }
  .samp-header .nav-menu .server-status .status-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    font-size: .98rem; color: #eee;
  }
  .samp-header .nav-menu .server-status .status-item i { color: #e50914; font-size: 1.05rem; }

  /* плавное открытие меню через max-height */
  .nav-menu.active { max-height: 100vh; }
}

/* Предпочтение пользователем отключённых анимаций */
@media (prefers-reduced-motion: reduce) {
  .samp-header, .nav-link, .nav-auth .btn, .server-statuspc .status-item {
    transition: none !important;
  }
}

/* Анимации меню */
@keyframes slideDown {
  from { max-height: 0; opacity: 0; }
  to   { max-height: 100vh; opacity: 1; }
}
@keyframes slideUp {
  from { max-height: 100vh; opacity: 1; }
  to   { max-height: 0; opacity: 0; }
}

.nav-menu.animating.slide-down {
  animation: slideDown 0.35s ease forwards;
  overflow-y: auto; /* внутри меню можно скроллить */
}
.nav-menu.animating.slide-up {
  animation: slideUp 0.3s ease forwards;
}
