/* ========================================
   MOBILE STYLES & NAVIGATION
   Адаптивная мобильная версия с нижним меню
   ======================================== */

/* ========================================
   MOBILE NAVIGATION OVERLAY
   ======================================== */

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(300px, 80vw);
  max-width: 300px;
  height: 100vh;
  background: var(--bg-dark);
  border-left: 2px solid var(--primary-red);
  z-index: 1001;
  transition: right 0.3s ease;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.mobile-nav-close:hover {
  background: var(--primary-red);
  color: white;
}

.mobile-nav-links {
  list-style: none;
  padding: 20px 0;
}

.mobile-nav-links li {
  margin: 0;
}

.mobile-nav-link {
  display: block;
  padding: 15px 20px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--primary-red);
  background: rgba(255, 68, 68, 0.1);
  border-left-color: var(--primary-red);
}

.mobile-nav-actions {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(3px);
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   MOBILE BOTTOM BAR
   ======================================== */

.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-dark);
  border-top: 2px solid var(--primary-red);
  box-shadow: 0 -4px 20px var(--shadow);
}

/* Конверсионная кнопка бонуса */
.mobile-bonus-button {
  padding: 15px 20px 10px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-secondary) 100%);
}

.btn-mobile-bonus {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--border-radius);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 
    0 4px 15px rgba(255, 68, 68, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-mobile-bonus:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(255, 68, 68, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-mobile-bonus i {
  font-size: 1.3rem;
  animation: bounce 2s ease-in-out infinite;
}

.btn-mobile-bonus .bonus-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  animation: shine 3s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* Нижняя навигация */
.mobile-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 5px;
  background: var(--bg-dark);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  padding: 8px 4px;
  border-radius: var(--border-radius-small);
  min-width: 50px;
  position: relative;
}

.bottom-nav-item i {
  font-size: 1.2rem;
  margin-bottom: 4px;
  transition: var(--transition);
}

.bottom-nav-item span {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--primary-red);
  background: rgba(255, 68, 68, 0.1);
}

.bottom-nav-item.active i {
  transform: scale(1.1);
}

/* Индикатор активной страницы */
.bottom-nav-item.active:before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary-red);
  border-radius: 0 0 3px 3px;
}

/* ========================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  /* Показать мобильное нижнее меню */
  .mobile-bottom-bar {
    display: block;
  }
  
  /* Добавить отступ снизу для контента */
  body {
    padding-bottom: 120px; /* Высота нижней панели + кнопки бонуса */
  }
  
  /* Настройки для мобильного меню */
  .mobile-nav {
    width: 280px;
  }
  
  /* Улучшения для hero секции на мобильных */
  .hero {
    padding: 40px 0 60px;
  }
  
  /* .pin-up-girl размеры теперь контролируются изображением */
  
  /* Улучшения модальных окон на мобильных */
  .modal-content {
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
    max-width: calc(100vw - 40px);
  }
  
  /* Предотвращение переполнения */
  .container {
    width: 100%;
    max-width: 100%;
  }
  
  .age-modal-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .age-modal-content {
    padding: 2rem 1.5rem;
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .age-modal-icon {
    font-size: 3rem;
  }
  
  .casino-chips {
    display: none; /* Скрываем на мобильных */
  }
  
  .age-benefits {
    gap: 0.8rem;
  }
  
  .benefit-item {
    padding: 0.6rem 0.8rem;
  }
  
  /* Cookie notice адаптация */
  .cookie-notice {
    bottom: 140px; /* Над нижней панелью */
    left: 10px;
    right: 10px;
  }
  
  /* Улучшения для карточек бонусов */
  .bonus-card {
    padding: 1.5rem;
  }
  
  .bonus-amount {
    font-size: 2rem;
  }
  
  /* Улучшения для игровых карточек */
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .game-card .game-image {
    height: 120px;
  }
  
  .game-placeholder {
    font-size: 2rem;
  }
  
  .game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Настройки футера */
  .footer {
    margin-bottom: 0;
    padding-bottom: 0;
  }
  
  /* Скрыть некоторые элементы на очень маленьких экранах */
  @media (max-width: 480px) {
    .hero-stats {
      display: none;
    }
    
    .mobile-nav {
      width: 100%;
      right: -100%;
    }
    
    .mobile-nav.open {
      right: 0;
    }
    
    .game-grid {
      grid-template-columns: 1fr;
    }
    
    .btn-mobile-bonus {
      font-size: 1rem;
      padding: 12px 16px;
    }
    
    .bottom-nav-item i {
      font-size: 1.1rem;
    }
    
    .bottom-nav-item span {
      font-size: 0.65rem;
    }
  }
}

/* ========================================
   LANDSCAPE MODE ADJUSTMENTS
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .mobile-bottom-bar {
    display: none;
  }
  
  body {
    padding-bottom: 0;
  }
  
  .cookie-notice {
    bottom: 20px;
  }
  
  .hero {
    padding: 20px 0;
  }
  
  .section {
    padding: 40px 0;
  }
}

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

/* Focus states для мобильной навигации */
.bottom-nav-item:focus,
.mobile-nav-link:focus,
.btn-mobile-bonus:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

/* Увеличение области касания */
.bottom-nav-item {
  min-height: 44px;
  min-width: 44px;
}

.mobile-nav-close {
  min-height: 44px;
  min-width: 44px;
}

/* Анимации загрузки для лучшего UX */
.mobile-bottom-bar {
  animation: slideUp 0.4s ease-out;
}

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

/* Haptic feedback стили */
.btn-mobile-bonus:active,
.bottom-nav-item:active {
  transform: scale(0.95);
}

/* ========================================
   DARK MODE OPTIMIZATIONS
   ======================================== */

/* Улучшения контрастности для мобильных устройств */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    border-top: 1px solid rgba(255, 68, 68, 0.3);
  }
  
  .bottom-nav-item {
    color: var(--text-secondary);
  }
  
  .bottom-nav-item.active {
    color: var(--primary-red);
    background: rgba(255, 68, 68, 0.15);
  }
  
  .mobile-nav {
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  }
  
  .btn-mobile-bonus {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* GPU acceleration для анимаций */
.btn-mobile-bonus,
.bottom-nav-item,
.mobile-nav,
.bonus-glow {
  transform: translateZ(0);
  will-change: transform;
}

/* Smooth scrolling adjustments для мобильных */
@media (max-width: 768px) {
  html {
    scroll-padding-bottom: 120px;
  }
  
  /* Улучшения для прокрутки с нижним меню */
  section[id] {
    scroll-margin-top: 80px;
    scroll-margin-bottom: 120px;
  }
}

/* ========================================
   PWA SUPPORT STYLES
   ======================================== */

/* Поддержка safe areas для iPhone X+ */
@supports (padding: max(0px)) {
  .mobile-bottom-bar {
    padding-bottom: max(5px, env(safe-area-inset-bottom));
  }
  
  .mobile-nav {
    padding-top: max(20px, env(safe-area-inset-top));
  }
}

/* Поддержка notch для современных устройств */
@media (max-width: 768px) and (orientation: portrait) {
  .header {
    padding-top: env(safe-area-inset-top);
  }
}

/* ========================================
   INTERACTION STATES
   ======================================== */

/* Улучшенные hover/active состояния для touch устройств */
@media (hover: none) and (pointer: coarse) {
  .btn-mobile-bonus:hover {
    transform: none;
  }
  
  .bottom-nav-item:hover {
    background: none;
  }
  
  .bottom-nav-item:active {
    background: rgba(255, 68, 68, 0.2);
    transform: scale(0.95);
  }
  
  .btn-mobile-bonus:active {
    transform: scale(0.98);
  }
}

/* Очень маленькие мобильные экраны */
@media (max-width: 360px) {
  .mobile-nav {
    width: 100%;
    right: -100%;
  }
  
  .mobile-bonus-button .btn-mobile-bonus {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  .bottom-nav-item {
    font-size: 0.7rem;
  }
  
  .bottom-nav-item i {
    font-size: 1rem;
  }
  
  .modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }
}