/* Основные стили и переменные */

/* CSS переменные */
:root {
  /* Основные цвета */
  --primary-purple: #AC4BFF;
  --primary-blue: #1e3a8a;
  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --dark-bg: #0f0f23;
  --text-light: #ffffff;
  --text-muted: #a1a1aa;
  
  /* Градиенты */
  --main-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 25%, #1e3a8a 50%, #1e40af 75%, #1d4ed8 100%);
  --dark-gradient: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 30%, #2d1b69 60%, #1e3a8a 100%);
  --purple-gradient: linear-gradient(135deg, #4c1d95 0%, #7c3aed 50%, #a855f7 100%);
  
  /* Фон с картинкой */
  --background-image: url('../images/background.svg');
  --background-color: #AC4BFF;
  
  /* Размеры */
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Тени */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Базовые стили */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background-color);
  background-image: 
    var(--background-image),
    linear-gradient(135deg, #AC4BFF 0%, #8B5CF6 50%, #7C3AED 100%);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  min-height: 100vh;
  color: var(--text-light);
  line-height: 1.6;
}

/* Контейнер */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

@media (min-width: 1440px) {
  .container {
    padding: 0 80px;
  }
}

/* Шапка */
.header {
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: clamp(60px, 9vh, 100px);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 80px); /* Динамичный отступ: 16px → 80px */
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  height: 100%;
}

@media (min-height: 960px) {
  .header {
    height: 100px;
  }
}

/* Логотип */
.logo {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
  text-decoration: none;
  color: white;
}

/* Выбор языка - Кастомный селектор */
.language-selector {
  position: absolute;
  left: clamp(165px, 19vw, 320px); /* Чуть правее */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

.custom-language-select {
  position: relative;
  cursor: pointer;
}

.language-display {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  color: white;
  font-size: clamp(12px, 1.5vw, 16px); /* Адаптивный размер шрифта */
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  min-width: 60px;
}

.language-text {
  color: white;
}

.language-arrow {
  color: white;
  transition: transform 0.2s ease;
}

.custom-language-select:hover .language-text {
  color: #b230cc;
}

.custom-language-select:hover .language-arrow {
  color: #b230cc;
}

.custom-language-select.open .language-arrow {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  left: 50%; /* Центрирование по горизонтали */
  transform: translateX(-50%) translateY(-10px); /* Центрирование и анимация */
  background: #b230cc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  margin-top: 4px;
  width: 35px; /* Уменьшена ширина */
  min-width: 35px;
}

.custom-language-select.open .language-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important; /* Центрирование и анимация */
  background: #b230cc !important;
  display: block !important;
}

.language-option {
  padding: 2px 3px; /* Значительно уменьшен padding */
  color: white;
  font-size: clamp(12px, 1.8vh, 16px);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 4px; /* Уменьшен border-radius */
  margin: 1px; /* Уменьшен margin между опциями */
  text-align: center; /* Центрирование текста */
}

.language-option:hover {
  background: #b230cc;
}

.language-option.selected {
  background: #b230cc;
  font-weight: 600;
}

.logo-icon {
  width: clamp(40px, 1.5vw, 56px); /* Адаптивный размер по ширине окна */
  height: clamp(40px, 1.5vw, 56px); /* Адаптивный размер по ширине окна */
  background: linear-gradient(135deg, #AC4BFF 0%, #8B5CF6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: clamp(18px, 1.5vw, 24px); /* Адаптивный размер шрифта */
  color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.logo-text {
  font-size: clamp(16px, 1.8vw, 24px); /* Адаптивный размер шрифта как у навигации */
  font-weight: 600;
  color: white;
  font-family: 'Inter', sans-serif;
}

/* Навигация */
.nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin-left: 40px; /* Сдвиг вправо, чтобы центр был между селектором языка и кнопкой войти */
  display: flex;
  gap: clamp(10px, 1vw, 70px); /* Динамичное расстояние между пунктами: 20px → 70px */
  align-items: center;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px , 1.3vw, 20px); /* Динамичный размер шрифта: 14px → 24px */
  padding: clamp(6px, 1vh, 12px) clamp(12px, 1.5vw, 20px); /* Динамичный padding */
  border-radius: 12px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #AC4BFF;
}

/* Кнопка входа */
.login-btn {
  background: transparent;
  border: 2px solid #AC4BFF; /* Уменьшенная обводка */
  color: white;
  padding: clamp(2px, 0.3vh, 6px) clamp(6px, 4vw, 60px); /* Уменьшенный padding */
  border-radius: 43px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.3vw, 20px); /* Адаптивный размер шрифта как у навигации */
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  min-width: clamp(80px, 5vw, 120px); /* Уменьшенная минимальная ширина */
  text-align: center;
}

.login-btn:hover {
  background: #AC4BFF;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Мобильное меню */
.mobile-menu-overlay {
  display: none; /* Убираем затемнение */
}

.mobile-menu-dropdown {
  position: fixed;
  top: clamp(60px, 9vh, 100px); /* Под хедером */
  left: 0;
  width: 100%;
  height: clamp(50px, 7vh, 80px); /* Адаптивная высота, как у хедера */
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1001; /* Поверх контента */
  transform: translateY(-100%); /* Скрыто сверху */
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  border-bottom: 1px solid rgba(172, 75, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex; /* Всегда показываем для анимации */
  align-items: center;
  opacity: 0; /* Прозрачное когда закрыто */
  visibility: hidden; /* Скрыто от взаимодействия */
}

.mobile-menu-dropdown.open {
  transform: translateY(0); /* Выезжает вниз */
  opacity: 1; /* Полностью видимое */
  visibility: visible; /* Доступно для взаимодействия */
  z-index: 1001; /* Поверх всего контента когда открыто */
}

.mobile-menu-header {
  display: none; /* Убираем заголовок и крестик */
}

.mobile-menu-close {
  display: none;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: row; /* Горизонтально */
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 1440px; /* Ограничение ширины, как у header */
  margin: 0 auto; /* Центрирование */
  padding: 0 clamp(16px, 5vw, 80px); /* Такие же отступы как у хедера */
  gap: clamp(4px, 1vw, 12px); /* Адаптивный gap */
}

.mobile-nav-link {
  font-family: 'Inter', sans-serif;
  font-size: clamp(12px, 1.5vw, 18px); /* Адаптивный размер шрифта, как у nav-link */
  font-weight: 500;
  color: white;
  text-decoration: none;
  padding: clamp(6px, 1vh, 10px) clamp(8px, 1.5vw, 16px); /* Адаптивный padding */
  transition: all 0.3s ease;
  border-radius: clamp(6px, 1vh, 10px); /* Адаптивный border-radius */
  white-space: nowrap;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(172, 75, 255, 0.2);
  color: #AC4BFF;
}

/* Основной контент */
.main-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Нижнее меню */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  justify-content: center;
  width: 100%;
}

@media (min-height: 960px) {
  .bottom-nav-container {
    height: 100px;
  }
}

.is-telegram-miniapp .bottom-nav {
  bottom: 0 !important; /* при скрытом копирайте меню прижато к низу */
}

.bottom-nav-container {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px 16px 0 0;
  padding: clamp(8px, 1.8vh, 12px) clamp(16px, 2.5vw, 20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 850px;
  height: clamp(60px, 9vh, 100px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--bottom-nav-item-width, clamp(100px, 20vw, 120px));
  text-align: center;
  gap: clamp(1px, 0.2vh, 2px);
  text-decoration: none;
  color: white;
  padding: clamp(4px, 1vh, 7px) clamp(8px, 1vw, 10px);
  border-radius: clamp(8px, 1.5vh, 12px);
  transition: all 0.3s ease;
  position: relative;
}

.nav-item:first-child {
  margin-left: 0;
}

.nav-item:last-child {
  margin-right: 0;
}

.nav-item.active {
  background: #B230CC;
  color: white;
  box-shadow: 0 2px 8px rgba(172, 75, 255, 0.3);
  border: 1px solid white;
}

.nav-item:hover:not(.active) {
  transform: translateY(-2px);
}

.nav-icon {
  width: clamp(16px, 2.5vh, 24px);
  height: clamp(16px, 2.5vh, 24px);
  filter: brightness(0) invert(1);
}

.nav-item.active .nav-icon {
  filter: none;
}

.nav-label {
  font-size: clamp(10px, 4.5vw, 16px);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  margin-bottom: 0;
  line-height: 1.2;
}



/* Планшеты и тд версия */
@media (max-width: 780px) {
  .nav-link {
    padding: clamp(6px, 1vh, 12px) clamp(2px, 0.3vw, 20px);
  }
}


/* Мобильная иконка меню - скрыта по умолчанию */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto; /* Сдвигаем иконку правее */
  margin-right: 8px; /* Уменьшенный отступ - иконка правее */
}

.mobile-menu-btn img {
  width: 24px;
  height: 24px;
  filter: none; /* Убираем фильтр - розовая иконка */
}

/* Мобильная версия */
@media (max-width: 640px) {
  /* Скрыть навигационное меню на мобильных */
  .nav {
    display: none;
  }
  
  /* Показать мобильную иконку меню */
  .mobile-menu-btn {
    display: block;
  }
}

.tab-btn {
  font-size: 14px;
  padding: 10px 16px;
}

/* Мобильная версия */
@media (max-width: 340px) {
  /* Скрыть навигационное меню на мобильных */
.language-selector {
  position: absolute;
  left: clamp(130px, 43vw, 320px); /* Чуть правее */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}
}

/* Черная полоска с копирайтом */
.copyright-bar {
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.copyright-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 80px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.copyright-text {
  font-size: clamp(11px, 1.2vw, 14px);
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.copyright-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copyright-link {
  font-size: clamp(11px, 1.2vw, 14px);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  transition: color 0.3s ease;
}

.copyright-link:hover {
  color: #AC4BFF;
}

.copyright-separator {
  color: rgba(255, 255, 255, 0.3);
  font-size: clamp(11px, 1.2vw, 14px);
}

/* Адаптация для мобильных устройств */
@media (max-width: 640px) {
  /* На узких экранах копирайт располагается под нижним меню */
  .copyright-bar {
    bottom: 0; /* внизу экрана */
    z-index: 1000;
  }
  /* Нижнее меню поднимаем над копирайтом */
  .bottom-nav {
    bottom: 35px;
    z-index: 1002;
  }
  
  .copyright-container {
    flex-direction: column;
    gap: 0px;
    text-align: center;
  }
}


/* На десктопах поднимем нижнее меню выше полосы и увеличим z-index меню */
@media (min-width: 641px) {
  .bottom-nav {
    bottom: 18px; /* поднимаем меню над полосой */
    z-index: 1002; /* выше чем у полосы */
  }
  .copyright-bar {
    z-index: 1000;
  }
}