/* ═══════════════════════════════════════════════════════════════════════════
   footer.css — Стили для футера (PublicLayout + AppLayout)

   [РЕАЛИЗОВАНО В: task-2026-05-31-007]
   [ОБНОВЛЕНО В: task-2026-06-03-002] — CSS-переменные перенесены в base.css
   [ОБНОВЛЕНО В: task-2026-06-11-mobile-footer-fix] — @media (pointer:coarse) ограничен >=641px,
       дублирующий @media (max-width:640px) удалён, .footer-left max-width:300px

   Компактный футер с градиентным фоном, SVG-иконками соцсетей,
   hover-эффектами и mobile-адаптацией.

   CSS-переменные (--footer-*) определены в base.css :root.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Основной footer — градиент + центрирование ────────────────── */
/* [ИЗМЕНЕНО В: task-2026-06-11-mobile-footer-fix] — flex + центрирование */
.nicegui-footer {
    background: var(--footer-gradient) !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

/* ── Footer wrapper — нефиксированный, position: static ────────── */
/* [ДОБАВЛЕНО В: task-2026-06-11-mobile-header-footer-v1] */
/* [ДОБАВЛЕНО В: task-2026-06-11-mobile-header-footer-v2] — margin-top для видимости */
.app-footer-wrapper {
    position: static !important;
    width: 100%;
    margin-top: 2rem;
    padding: 8px 0;
}

/* ── "+N" counter для скрытых social icons ─────────────────────── */
/* [ДОБАВЛЕНО В: task-2026-06-11-mobile-header-footer-v1] */
.footer-social-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    cursor: default;
}

/* ── Ссылки в copyright — underline hover ──────────────────────── */
.footer-link {
    position: relative;
    transition: var(--footer-transition);
    text-decoration: none !important;
}
.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: white;
    transition: width 0.25s ease;
}
.footer-link:hover::after {
    width: 100%;
}
.footer-link:hover {
    opacity: 0.92;
}

/* ── Контейнер для social иконки ───────────────────────────────── */
.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: var(--footer-transition);
    text-decoration: none !important;
}
.footer-social-link:hover {
    transform: scale(1.15);
    box-shadow: var(--footer-hover-glow);
    background: rgba(255, 255, 255, 0.1);
}

/* ── SVG иконка ────────────────────────────────────────────────── */
.footer-social-icon {
    width: var(--footer-icon-size);
    height: var(--footer-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-social-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Mobile: < 640px ───────────────────────────────────────────── */
/* [ОБНОВЛЕНО В: task-2026-06-11-mobile-header-footer-v1] — flex-row для copyright, скрыты dot-разделители */
@media (max-width: 640px) {
    .nicegui-footer {
        padding: 4px !important;
    }
    .footer-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1px !important;
    }
    .footer-left {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 1px 4px !important;
        max-width: 300px;
    }
    /* Скрываем dot-разделители между ссылками на mobile */
    .footer-left > .text-xs.text-white\/50 {
        display: none !important;
    }
    .footer-right {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    .footer-social-icon {
        width: var(--footer-icon-size-mobile) !important;
        height: var(--footer-icon-size-mobile) !important;
    }
    .footer-social-link {
        width: 22px;
        height: 22px;
    }
    /* Компактный padding для wrapper на mobile */
    .app-footer-wrapper {
        padding-top: 6px !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 4px) + 4px) !important;
    }
}

/* ── Desktop touch: touch-target 44×44px для social-ссылок на тач-устройствах ── */
/* [ИСПРАВЛЕНО: task-2026-06-11-mobile-footer-fix] — только для ≥641px */
@media (pointer: coarse) and (min-width: 641px) {
    .footer-social-link {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
    .footer-social-link:hover {
        transform: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .footer-social-link:active {
        transform: scale(0.97) !important;
        transition: transform 0.1s ease !important;
    }
}


/* ── Footer Navigation Bar — перенесён из inline ui.add_css() ─────── */
/* [ПЕРЕНЕСЕНО В: task-2026-06-16-frontend-audit-001 — из app_layout.py и public_layout.py] */
.footer-nav__bar {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-nav__bar > a {
    display: flex !important;
    width: 50% !important;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    align-items: center !important;
    padding: 2px 16px;
    min-height: 40px;
    transition: all 0.2s ease;
}
.footer-nav__bar > a:hover {
    background: rgba(255, 255, 255, 0.08);
}
.footer-nav__bar > a:first-child {
    justify-content: flex-start;
}
.footer-nav__bar > a:last-child {
    justify-content: flex-end;
}
.footer-nav__bar > a:first-child:hover .footer-nav__button {
    transform: translateX(-3px);
    color: white;
}
.footer-nav__bar > a:last-child:hover .footer-nav__button {
    transform: translateX(3px);
    color: white;
}
.footer-nav__label {
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.footer-nav__button {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}
@media (max-width: 640px) {
    .footer-nav__label {
        font-size: 0.9rem;
        max-width: 120px;
    }
    .footer-nav__button {
        font-size: 1.15rem;
    }
    .footer-nav__bar {
        display: flex !important;
    }
    .footer-nav__bar > a {
        min-height: 32px;
        padding: 2px 8px;
    }
}

/* ── Mobile touch для footer-nav ────────────────────────────────── */
@media (pointer: coarse) and (min-width: 641px) {
    .footer-nav__bar > a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ── Уважение к системным настройкам анимации ──────────────────── */
@media (prefers-reduced-motion: reduce) {
    .footer-link,
    .footer-link::after,
    .footer-social-link {
        transition: none;
    }
    .footer-link:hover::after {
        width: 0;
    }
    .footer-link:hover {
        opacity: 1;
    }
    .footer-social-link:hover {
        transform: none;
        box-shadow: none;
    }
}
