/* Стили для адаптивного интерфейса с fixed header и mobile footer */

/* ========== DESKTOP STYLES (≥1024px) ========== */

/* Основной header - fixed позиционирование */
.main-header {
  background: linear-gradient(to top, transparent, rgba(26, 26, 26, 0.8));
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

.header-inner {
  display: flex;
  flex-direction: row;
  width: 100%;
  padding: 0;
}

/* ВЕРХНИЙ ЭТАЖ - основные элементы */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  flex-wrap: nowrap;
  max-width: 1400px;
  width: 96%;
  margin: 0 auto;
  padding: 15px 20px;
  z-index: 1001;
  transition: all 0.3s ease;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.header-stats {
  display: flex;
  gap: 20px;
  align-items: center;
  transition: opacity 0.3s ease;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #fff;
}

/* Скрываем счетчики при уменьшении окна для предотвращения переполнения */
@media (max-width: 1200px) {
  .header-stats {
    display: none;
  }
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}



/* ========== MOBILE FOOTER STYLES (≤768px) ========== */

/* Footer с вкладками для мобильных устройств */
.mobile-tabs-footer {
  display: block; /* Показываем на всех устройствах */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, transparent, rgba(26, 26, 26, 0.8));
  border-top: 1px solid #333;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  z-index: 1000;
  padding: 8px 0;
}

.mobile-tabs-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 10px;
}

.mobile-tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 60px;
  font-size: 12px;
  font-weight: 600;
  flex: 1;
  touch-action: manipulation; /* Оптимизация для touch */
}

.mobile-tab-button:hover {
  color: #fff;
  background: rgba(255, 51, 51, 0.1);
}

.mobile-tab-button.active {
  color: #ff3333;
  background: rgba(255, 51, 51, 0.1);
}

.mobile-tab-button.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: #ff3333;
  border-radius: 0 0 2px 2px;
}

/* ========== RESPONSIVE ADAPTATION ========== */

/* Средние экраны (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
  .header-inner {
    padding: 0 12px;
  }
 
  .header-top {
    padding: 10px 0;
    gap: 10px;
  }
 
  .header-left {
    gap: 12px;
  }
 
  .logo-img {
    height: 30px;
  }
 
  .header-stats {
    gap: 10px;
  }
 
  .stat-item {
    font-size: 12px;
    padding: 4px 8px;
  }
 
  .header-actions {
    gap: 8px;
  }
 
  .header-actions .btn {
    padding: 6px 8px;
    font-size: 11px;
    height: 30px;
  }
 
  /* Адаптируем footer для средних экранов */
  .mobile-tab-button {
    padding: 10px 6px;
    font-size: 11px;
    min-width: 55px;
  }
 
  body {
    padding-bottom: 68px;
  }
 
  .section {
    margin-top: 78px;
    margin-bottom: 78px;
    padding: 20px 18px;
  }
}

/* Средние экраны (900px - 1023px) */
@media (min-width: 900px) and (max-width: 1023px) {
  .header-stats {
    display: none;
  }

  .header-inner {
    padding: 0 15px;
  }

  .header-top {
    padding: 12px 0;
  }
}

/* Планшеты (769px - 899px) */
@media (min-width: 769px) and (max-width: 899px) {
  .header-stats {
    display: none;
  }

  .header-inner {
    padding: 0 12px;
  }

  .header-top {
    padding: 10px 0;
    gap: 12px;
  }

  .header-left {
    gap: 12px;
  }

  .logo-img {
    height: 30px;
  }

  .header-actions {
    gap: 8px;
  }
}

/* Мобильные устройства (≤768px) */
@media (max-width: 768px) {
  /* Показываем footer с вкладками */
  .mobile-tabs-footer {
    display: block;
 }

  /* Адаптируем header-top для мобильных - сохраняем горизонтальное расположение */
  .header-top {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    min-height: auto;
    justify-content: space-between;
  }

  .header-left {
    gap: 8px;
    flex-shrink: 1;
    min-width: 0;
  }

  .logo-img {
    height: 28px;
    flex-shrink: 0;
  }

  .header-stats {
    display: none; /* Полностью скрываем счетчики на мобильных для экономии места */
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .header-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    height: 28px;
  }
  
  /* Добавляем отступ для body, чтобы контент не перекрывался footer */
  body {
    padding-bottom: 70px; /* Высота footer + отступ */
  }
  
  /* Адаптируем секции для мобильных */
  .section {
    margin-top: 80px; /* Уменьшаем отступ сверху */
    margin-bottom: 80px; /* Добавляем отступ снизу */
  }
}

/* Маленькие мобильные устройства (≤480px) */
@media (max-width: 480px) {
 .header-inner {
    padding: 0 10px;
 }
 
  .header-top {
    padding: 10px 15px;
    gap: 8px;
  }
 
  .header-left {
    gap: 10px;
    justify-content: center;
    width: 100%;
  }
 
  .logo-img {
    height: 28px;
  }
 
  .header-stats {
    gap: 8px;
    justify-content: center;
    width: 100%;
    order: 2;
  }
 
  .stat-item {
    font-size: 12px;
 }
 
  .header-actions {
    gap: 6px;
    justify-content: center;
    width: 100%;
    order: 3;
  }
 
  .header-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    height: 30px;
  }
 
  /* Адаптируем footer для маленьких экранов */
  .mobile-tab-button {
    padding: 8px 6px;
    font-size: 10px;
    min-width: 50px;
  }
 
  body {
    padding-bottom: 65px;
 }
 
  .section {
    margin-top: 75px;
    margin-bottom: 75px;
    padding: 20px 15px;
  }
}

/* Очень маленькие экраны (≤360px) */
@media (max-width: 360px) {
  .header-inner {
    padding: 0 8px;
  }
 
  .header-top {
    padding: 8px 12px;
    gap: 6px;
    min-height: auto;
  }
 
  .header-left {
    gap: 8px;
    justify-content: center;
    width: 100%;
  }
 
  .logo-img {
    height: 24px;
    max-width: 100px;
  }
 
  .header-stats {
    display: none; /* Скрываем статистику на очень маленьких экранах */
  }
 
  .stat-item {
    font-size: 11px;
 }
 
  .header-actions {
    gap: 5px;
    justify-content: center;
    width: 100%;
    order: 3;
  }
 
  .header-actions .btn {
    padding: 4px 6px;
    font-size: 10px;
    height: 28px;
  }
 
  /* Адаптируем footer для очень маленьких экранов */
  .mobile-tab-button {
    padding: 6px 4px;
    font-size: 9px;
    min-width: 45px;
  }
 
  body {
    padding-bottom: 60px;
  }
 
  .section {
    margin-top: 70px;
    margin-bottom: 70px;
    padding: 15px 10px;
  }
}

/* ========== ANIMATIONS ========== */

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

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

.mobile-tabs-footer {
  animation: slideUp 0.3s ease-out;
}

/* ========== ACCESSIBILITY ========== */

/* Focus styles для доступности */
.mobile-tab-button:focus-visible {
  outline: 2px solid #ff3333;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .main-header,
  .mobile-tabs-footer {
    border-bottom: 2px solid #fff;
    border-top: 2px solid #fff;
  }

  .mobile-tab-button {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .mobile-tab-button,
  .mobile-tabs-footer {
    transition: none;
    animation: none;
  }
}
