﻿/* ============================================
   СТИЛИ ДЛЯ НИЖНЕГО МЕНЮ И ФУТЕРА
   ============================================ */

/* ============================================
   НИЖНЕЕ НАВИГАЦИОННОЕ МЕНЮ
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(15, 10, 20, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--color-border-default);
    z-index: 1000;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Для iPhone с челкой */
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* Для корректной высоты с safe-area */
    box-sizing: content-box;
}

    /* Класс для скрытия меню при открытой клавиатуре */
    .bottom-nav.keyboard-hidden {
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
    }

    .bottom-nav .nav-menu {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .bottom-nav .nav-btn {
        flex: 1;
        background: transparent;
        border: none;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        padding: 8px 4px;
        height: 100%;
        font-size: 12px;
        font-weight: 600;
        color: var(--color-text-secondary);
        transition: all 0.2s ease;
        cursor: pointer;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border-radius: 0;
        font-family: 'Space Grotesk', sans-serif;
        position: relative;
        overflow: hidden;
    }

        .bottom-nav .nav-btn:last-child {
            border-right: none;
        }

        .bottom-nav .nav-btn::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 107, 157, 0.15);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.4s ease, height 0.4s ease;
        }

        .bottom-nav .nav-btn:active::before {
            width: 200px;
            height: 200px;
        }

        .bottom-nav .nav-btn:hover {
            background: rgba(255, 255, 255, 0.03);
            color: var(--color-text-primary);
        }

        .bottom-nav .nav-btn.active {
            background: rgba(255, 107, 157, 0.1);
            color: var(--color-text-accent);
        }

            .bottom-nav .nav-btn.active::after {
                content: '';
                position: absolute;
                top: 0;
                left: 50%;
                transform: translateX(-50%);
                width: 30px;
                height: 3px;
                background: var(--color-text-accent);
                border-radius: 0 0 3px 3px;
                box-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
            }

/* Иконки для кнопок меню */
.nav-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    object-fit: contain;
    opacity: 0.5;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bottom-nav .nav-btn.active .nav-icon {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.bottom-nav .nav-btn:hover .nav-icon {
    opacity: 0.8;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ============================================
   ФУТЕР С ЮРИДИЧЕСКИМИ ССЫЛКАМИ
   ============================================ */
.legal-footer {
    display: none;
    padding: 16px;
    margin: 20px 0 20px 0;
    text-align: center;
    background: rgba(26, 16, 34, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

/* Показываем футер только когда секция инвентаря активна */
#inventory-section.active ~ .legal-footer {
    display: block;
}

.legal-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.legal-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .legal-link:hover {
        color: var(--color-text-accent);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
        transform: translateY(-1px);
    }

    .legal-link:active {
        transform: translateY(0);
    }

.copyright {
    font-size: 11px;
    color: var(--color-text-placeholder);
    margin-top: 12px;
    opacity: 0.6;
}

/* ============================================
   КНОПКА ПРОКРУТКИ НАВЕРХ (в контексте футера)
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--gradient-button-pink);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    padding: 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

    .scroll-to-top:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
    }

    .scroll-to-top:active {
        transform: translateY(-1px);
    }

    .scroll-to-top.show {
        display: flex;
        animation: fadeInUp 0.3s ease;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scroll-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* ============================================
   ТОСТЫ (уведомления)
   ============================================ */
.custom-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(20, 15, 30, 0.97);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--color-border-default);
    border-radius: 12px;
    padding: 12px 24px;
    color: var(--color-text-primary);
    font-size: 14px;
    z-index: 3000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    white-space: nowrap;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}

    .custom-toast.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

/* ============================================
   МОДАЛЬНЫЕ ОКНА ДЛЯ ДОКУМЕНТОВ
   ============================================ */
.doc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

    .doc-modal.active {
        display: flex;
    }

.doc-modal-content {
    background: var(--color-bg-modal);
    border-radius: var(--border-radius-modal);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px 32px;
    position: relative;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-default);
    color: var(--color-text-primary);
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.doc-modal-content::-webkit-scrollbar {
    width: 6px;
}

.doc-modal-content::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
    border-radius: 10px;
}

.doc-modal-content::-webkit-scrollbar-thumb {
    background: var(--color-border-default);
    border-radius: 10px;
}

    .doc-modal-content::-webkit-scrollbar-thumb:hover {
        background: var(--color-text-accent);
    }

.doc-modal-content h2 {
    margin-top: 0;
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border-accent);
    padding-bottom: 12px;
    font-size: 24px;
    font-weight: 700;
}

.doc-modal-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--color-text-accent);
    font-size: 18px;
    font-weight: 600;
}

.doc-modal-content p {
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.doc-modal-content ul {
    padding-left: 20px;
    margin: 12px 0;
}

.doc-modal-content li {
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.close-doc-modal {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    transition: var(--transition-default);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

    .close-doc-modal:hover {
        color: var(--color-text-accent);
        background: var(--color-bg-hover);
        transform: rotate(90deg);
    }

/* ============================================
   СЕКЦИЯ КОНТАКТОВ (для футера)
   ============================================ */
.contacts-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-default);
}

.contacts-title {
    color: var(--color-text-accent);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-default);
}

    .contacts-title:hover {
        color: var(--color-text-primary);
        transform: translateY(-1px);
    }

.contacts-content {
    background: var(--color-bg-tertiary);
    border-radius: var(--border-radius-card);
    padding: 16px;
    margin-top: 12px;
    text-align: left;
    border: 1px solid var(--color-border-default);
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.contact-item {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

    .contact-item:last-child {
        margin-bottom: 0;
    }

.contact-label {
    color: var(--color-text-accent);
    font-weight: 600;
    margin-right: 8px;
    display: inline-block;
    min-width: 100px;
}

.contact-value {
    color: var(--color-text-secondary);
    word-break: break-word;
}

.contact-email {
    color: var(--color-text-accent);
    text-decoration: none;
    transition: var(--transition-default);
}

    .contact-email:hover {
        text-decoration: underline;
        color: var(--color-text-primary);
    }

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 550px) {
    .bottom-nav {
        height: 65px;
    }

        .bottom-nav .nav-btn {
            padding: 6px 2px;
            font-size: 11px;
            gap: 3px;
        }

    .nav-icon {
        width: 22px;
        height: 22px;
    }

    .nav-label {
        font-size: 10px;
    }

    .scroll-to-top {
        bottom: 80px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .scroll-icon {
        width: 20px;
        height: 20px;
    }

    .custom-toast {
        bottom: 80px;
        font-size: 12px;
        padding: 10px 20px;
    }

    .doc-modal-content {
        padding: 20px 16px;
    }

    .legal-footer {
        padding: 12px;
        margin: 15px 0 85px 0;
    }

    .legal-links {
        gap: 8px;
    }

    .legal-link {
        font-size: 12px;
        padding: 6px 12px;
    }

    .copyright {
        font-size: 10px;
    }

    .contact-label {
        min-width: 85px;
        font-size: 12px;
    }

    .contact-value {
        font-size: 11px;
    }

    .contacts-content {
        padding: 12px;
    }
}

@media (max-width: 380px) {
    .bottom-nav {
        height: 60px;
    }

        .bottom-nav .nav-btn {
            padding: 4px 2px;
            gap: 2px;
        }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .nav-label {
        font-size: 9px;
    }

    .scroll-to-top {
        bottom: 75px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .scroll-icon {
        width: 18px;
        height: 18px;
    }

    .custom-toast {
        bottom: 75px;
        font-size: 11px;
        padding: 8px 16px;
    }

    .legal-footer {
        padding: 10px;
        margin: 10px 0 80px 0;
    }

    .legal-link {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Для устройств с вырезом (iPhone X и новее) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        height: calc(70px + env(safe-area-inset-bottom));
    }

    .scroll-to-top {
        bottom: calc(85px + env(safe-area-inset-bottom));
    }

    .custom-toast {
        bottom: calc(90px + env(safe-area-inset-bottom));
    }

    @media (max-width: 550px) {
        .bottom-nav {
            height: calc(65px + env(safe-area-inset-bottom));
        }

        .scroll-to-top {
            bottom: calc(80px + env(safe-area-inset-bottom));
        }

        .custom-toast {
            bottom: calc(80px + env(safe-area-inset-bottom));
        }
    }

    @media (max-width: 380px) {
        .bottom-nav {
            height: calc(60px + env(safe-area-inset-bottom));
        }

        .scroll-to-top {
            bottom: calc(75px + env(safe-area-inset-bottom));
        }

        .custom-toast {
            bottom: calc(75px + env(safe-area-inset-bottom));
        }
    }
}
