/* mobile.css - Современные стили для мобильных устройств Auction Game */

/* =============================================
   БАЗОВЫЕ НАСТРОЙКИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================= */

/* Предотвращение горизонтального скролла */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Улучшенная типографика для мобильных */
body {
    font-size: 16px; /* Предотвращает зум на iOS */
    line-height: 1.5;
    -webkit-text-size-adjust: 100%; /* Предотвращает изменение размера текста */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* =============================================
   СОВРЕМЕННОЕ БУРГЕР-МЕНЮ
   ============================================= */

/* Бургер-меню */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.burger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--primary-gold);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger-menu:hover {
    transform: scale(1.1);
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Мобильное меню оверлей */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Мобильная навигация */
.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 300px;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    background: linear-gradient(135deg, var(--bg-card) 0%, #2d1b0e 100%);
    border-right: 3px solid var(--primary-gold);
    z-index: 1002;
    transition: left 0.3s ease;
    /* Контейнер без скролла, скролл только внутри контента */
    overflow: hidden;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav-scroll {
    position: static;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
}

.mobile-nav-title {
    color: var(--bg-dark);
    font-weight: 800;
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-nav-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-gold);
    border-color: var(--primary-gold);
    transform: translateX(5px);
}

.mobile-nav-actions {
    padding: 1.5rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.mobile-nav-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
    text-align: center;
    justify-content: center;
}

.mobile-nav-action.primary {
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
    color: var(--bg-dark);
    font-weight: 700;
}

.mobile-nav-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* =============================================
   АДАПТИВНЫЕ СЕТКИ ДЛЯ МОБИЛЬНЫХ
   ============================================= */

.mobile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mobile-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mobile-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* =============================================
   TOUCH-FRIENDLY ЭЛЕМЕНТЫ
   ============================================= */

/* Увеличенные области касания */
.touch-btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

/* Улучшенные кнопки для мобильных */
.mobile-btn {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 50px;
}

.mobile-btn-primary {
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.mobile-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.mobile-btn-outline {
    background: transparent;
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
}

.mobile-btn-outline:hover {
    background: var(--primary-gold);
    color: var(--bg-dark);
}

/* =============================================
   АДАПТИВНЫЕ КАРТОЧКИ
   ============================================= */

.mobile-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #2d1b0e 100%);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mobile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--gold-light));
}

.mobile-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

/* =============================================
   МОБИЛЬНАЯ СТАТИСТИКА
   ============================================= */

.mobile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.mobile-stat {
    background: linear-gradient(135deg, var(--bg-card) 0%, #2d1b0e 100%);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-stat:hover {
    border-color: var(--primary-gold);
    transform: scale(1.05);
}

.mobile-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.mobile-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-gold);
    margin-bottom: 0.25rem;
}

.mobile-stat-label {
    color: var(--text-gray);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* =============================================
   АДАПТИВНЫЕ ФОРМЫ
   ============================================= */

.mobile-form {
    width: 100%;
}

.mobile-form-group {
    margin-bottom: 1.5rem;
}

.mobile-form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
}

.mobile-form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #333;
    border-radius: 8px;
    background: var(--bg-darker);
    color: var(--text-light);
    font-size: 16px; /* Предотвращает зум на iOS */
    transition: border-color 0.3s ease;
}

.mobile-form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
}

/* =============================================
   МОБИЛЬНЫЙ ЧАТ
   ============================================= */

.mobile-chat-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
    color: var(--bg-dark);
}

.mobile-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.6);
}

.mobile-chat-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border-left: 3px solid var(--primary-gold);
    transition: right 0.3s ease;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.mobile-chat-sidebar.active {
    right: 0;
}

/* =============================================
   АНИМАЦИИ ДЛЯ МОБИЛЬНЫХ
   ============================================= */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-fade-in-up {
    animation: slideInUp 0.6s ease-out;
}

.mobile-fade-in-down {
    animation: slideInDown 0.6s ease-out;
}

.mobile-fade-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.mobile-fade-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* =============================================
   УТИЛИТЫ ДЛЯ МОБИЛЬНЫХ
   ============================================= */

/* Скрытие элементов на мобильных */
.mobile-hidden {
    display: none !important;
}

.mobile-visible {
    display: block !important;
}

/* Отступы для мобильных */
.mobile-p-1 { padding: 0.5rem; }
.mobile-p-2 { padding: 1rem; }
.mobile-p-3 { padding: 1.5rem; }
.mobile-p-4 { padding: 2rem; }

.mobile-m-1 { margin: 0.5rem; }
.mobile-m-2 { margin: 1rem; }
.mobile-m-3 { margin: 1.5rem; }
.mobile-m-4 { margin: 2rem; }

/* Выравнивание текста для мобильных */
.mobile-text-center { text-align: center; }
.mobile-text-left { text-align: left; }
.mobile-text-right { text-align: right; }

/* =============================================
   МЕДИА-ЗАПРОСЫ ДЛЯ РАЗНЫХ РАЗРЕШЕНИЙ
   ============================================= */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .tablet-hidden {
        display: none !important;
    }
    
    .tablet-visible {
        display: block !important;
    }
}

/* Мобильные устройства (320px - 768px) */
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Бургер-меню становится видимым */
    .burger-menu {
        display: flex;
    }
    
    /* Основная навигация скрывается на мобильных */
    .main-nav {
        display: none !important;
    }
    
    /* Улучшенный контейнер навигации для мобильных */
    .nav-container {
        padding: 0.8rem 1rem;
        gap: 0.5rem;
    }
}

/* Маленькие мобильные устройства (320px - 480px) */
@media (max-width: 480px) {
    .small-mobile-hidden {
        display: none !important;
    }
    
    .mobile-stats {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav {
        width: 90%;
    }
}

/* Ориентация landscape для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-nav {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .mobile-nav-content {
        padding: 1rem;
    }
    
    .mobile-nav-link {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
    
    .mobile-nav-action {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

/* Стилизация скроллбара только на прокручиваемой области */
.mobile-nav-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-nav-content::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 3px;
}

.mobile-nav-content::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

.mobile-nav-content::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

/* =============================================
   ОПТИМИЗАЦИЯ ПРОИЗВОДИТЕЛЬНОСТИ ДЛЯ МОБИЛЬНЫХ
   ============================================= */

/* Отключение анимаций для пользователей, предпочитающих уменьшенное движение */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Улучшенная прокрутка для iOS */
.mobile-smooth-scroll {
    -webkit-overflow-scrolling: touch;
}

/* Предотвращение выделения текста на мобильных */
.mobile-no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =============================================
   ПОДДЕРЖКА SAFE AREA (ВЫРЕЗЫ И ДАЙНАМИК АЙЛЕНД)
   ============================================= */

@supports (padding: max(0px)) {
    .mobile-safe-area {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .mobile-safe-area-top {
        padding-top: max(1rem, env(safe-area-inset-top));
    }
    
    .mobile-safe-area-bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* =============================================
   ТЕМЫ ДЛЯ МОБИЛЬНЫХ
   ============================================= */

/* Темная тема по умолчанию */
:root {
    --mobile-bg-primary: #0f0f0f;
    --mobile-bg-secondary: #1a1a1a;
    --mobile-text-primary: #ffffff;
    --mobile-text-secondary: #b0b0b0;
    --mobile-accent: #d4af37;
    --mobile-border: #333;
}

/* Светлая тема для мобильных */
@media (prefers-color-scheme: light) {
    :root {
        --mobile-bg-primary: #ffffff;
        --mobile-bg-secondary: #f5f5f5;
        --mobile-text-primary: #333333;
        --mobile-text-secondary: #666666;
        --mobile-accent: #d4af37;
        --mobile-border: #dddddd;
    }
}
