/* ============================================
   Modern Footer Styles - Satellinus 2024
   ============================================ */

/* Сброс старых стилей футера (кроме основных контейнеров) */
.footer-nav-title,
.footer-nav-list,
.footer-nav-link,
.Widget {
    all: unset;
}

/* Восстанавливаем box-sizing после all: unset */
.footer *,
.footer *::before,
.footer *::after,
.telegram-widget *,
.telegram-widget *::before,
.telegram-widget *::after {
    box-sizing: border-box;
}

:root {
    --footer-bg-primary: #0f141f;
    --footer-bg-secondary: #1a2332;
    --footer-text-primary: #ffffff;
    --footer-text-secondary: #a0aec0;
    --footer-text-muted: #718096;
    --footer-accent: #0071b8;
    --footer-accent-hover: #0089d9;
    --footer-border: rgba(255, 255, 255, 0.08);
    --footer-hover-bg: rgba(255, 255, 255, 0.05);
    --footer-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --footer-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Основной контейнер футера */
.footer {
    background: linear-gradient(180deg, var(--footer-bg-secondary) 0%, var(--footer-bg-primary) 100%);
    color: var(--footer-text-secondary);
    position: relative;
    margin-top: 80px;
    overflow: hidden;
}

.footer-wrap {
    padding: 60px 0 40px;
    position: relative;
}

/* Современная CSS Grid сетка */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px 30px;
    align-items: start;
}

@media (min-width: 1200px) {
    .footer-grid {
        grid-template-columns: 1fr repeat(4, 1fr) 1fr;
    }
}

/* ============================================
   Брендинг (логотип + описание)
   ============================================ */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    display: inline-block;
    transition: var(--footer-transition);
    filter: brightness(1) opacity(0.95);
}

.footer-logo:hover {
    filter: brightness(1.1) opacity(1);
    transform: translateY(-2px);
}

.footer-logo img {
    max-width: 160px;
    height: auto;
    display: block;
}

.footer-brand-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--footer-text-muted);
    margin: 0;
    max-width: 280px;
}

/* Социальные иконки в бренде */
.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--footer-hover-bg);
    color: var(--footer-text-secondary);
    transition: var(--footer-transition);
    border: 1px solid var(--footer-border);
}

.footer-social-link:hover {
    background: var(--footer-accent);
    color: var(--footer-text-primary);
    border-color: var(--footer-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 113, 184, 0.3);
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Навигационные секции
   ============================================ */
.footer-nav-section {
    display: flex;
    flex-direction: column;
}

.footer-nav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--footer-text-primary);
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 5px;
    cursor: pointer;
    transition: var(--footer-transition);
    text-align: left;
    width: 100%;
    gap: 8px;
}

.footer-nav-title:hover {
    color: var(--footer-accent);
}

.footer-nav-title span {
    flex: 1;
}

.footer-nav-arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--footer-text-muted);
}

.footer-nav-title[aria-expanded="true"] .footer-nav-arrow {
    transform: rotate(180deg);
    color: var(--footer-accent);
}

/* Списки навигации */
.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    opacity: 0;
}

/* Desktop - всегда показываем */
@media (min-width: 992px) {
    .footer-nav-list {
        max-height: 500px;
        opacity: 1;
    }
    
    .footer-nav-title {
        cursor: default;
        pointer-events: none;
    }
    
    .footer-nav-title:hover {
        color: var(--footer-text-primary);
    }
    
    .footer-nav-arrow {
        display: none;
    }
}

.footer-nav-item {
    margin: 0;
    cursor: pointer;
}

.footer-nav-link {
    display: block;
    color: var(--footer-text-muted);
    font-size: 14px;
    padding: 6px 0;
    transition: var(--footer-transition);
    position: relative;
    text-decoration: none !important;
}

.footer-nav-link:hover {
    color: var(--footer-accent-hover);
}

.footer-nav-text {
    color: var(--footer-text-muted);
    font-size: 14px;
    display: block;
    padding: 6px 0;
}

/* ============================================
   Контакты и реквизиты
   ============================================ */
.footer-contacts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-requisites-title,
.footer-contact-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--footer-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 12px 0;
}

.footer-requisites-list,
.footer-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-requisite-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--footer-text-muted);
}

.requisite-label {
    font-weight: 600;
    color: var(--footer-text-secondary);
    flex-shrink: 0;
    min-width: 45px;
}

.requisite-value {
    color: var(--footer-text-primary);
    font-weight: 500;
}

.footer-contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--footer-text-muted);
    font-size: 14px;
    transition: var(--footer-transition);
    text-decoration: none !important;
}

.footer-contact-link:hover {
    color: var(--footer-accent-hover);
}

.footer-contact-link svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--footer-accent);
}

/* ============================================
   Нижняя полоса (footer bottom)
   ============================================ */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--footer-border);
    padding: 20px 0;
}

.footer-bottom-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.footer-copyright {
    margin: 0;
    font-size: 13px;
    color: var(--footer-text-muted);
}

.footer-legal {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-legal-link {
    font-size: 13px;
    color: var(--footer-text-muted);
    transition: var(--footer-transition);
    text-decoration: none !important;
}

.footer-legal-link:hover {
    color: var(--footer-accent-hover);
}

.footer-powered {
    margin: 0;
    font-size: 12px;
    color: var(--footer-text-muted);
}

.footer-powered-link {
    color: var(--footer-text-muted);
    transition: var(--footer-transition);
    text-decoration: none !important;
}

.footer-powered-link:hover {
    color: var(--footer-accent);
}

/* ============================================
   Telegram Widget Button (обновлённый)
   ============================================ */
.telegram-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
    transition: var(--footer-transition);
    z-index: 1000;
    padding: 0;
}

.telegram-widget:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.6);
    background: linear-gradient(135deg, #0099e6 0%, #0077bb 100%);
}

.telegram-widget:active {
    transform: translateY(-2px) scale(1.02);
}

.telegram-widget svg {
    width: 28px;
    height: 28px;
    transition: var(--footer-transition);
}

/* Tooltip */
.telegram-tooltip {
    position: absolute;
    right: 70px;
    background: var(--footer-bg-primary);
    color: var(--footer-text-primary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: var(--footer-transition);
    box-shadow: var(--footer-shadow);
    border: 1px solid var(--footer-border);
}

.telegram-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--footer-bg-primary);
}

.telegram-widget:hover .telegram-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Анимация пульсации */
.telegram-widget::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 136, 204, 0.4);
    z-index: -1;
    animation: telegramPulse 2s infinite;
}

@keyframes telegramPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 1199px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    
    .footer-brand-desc {
        max-width: none;
    }
    
    .footer-contacts {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991px) {
    .footer-wrap {
        padding: 40px 0 30px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .footer-brand {
        flex-direction: column;
        text-align: center;
        padding-bottom: 30px;
        border-bottom: 1px solid var(--footer-border);
    }
    
    .footer-socials {
        justify-content: center;
    }
    
    .footer-nav-section {
        border-bottom: 1px solid var(--footer-border);
        padding: 16px 0;
    }
    
    .footer-nav-section:last-child {
        border-bottom: none;
    }
    
    .footer-nav-title {
        pointer-events: auto;
        cursor: pointer;
    }
    
    .footer-nav-list {
        padding-top: 12px;
    }
    
    .footer-nav-list.show {
        max-height: 500px;
        opacity: 1;
    }
    
    .footer-contacts {
        padding-top: 30px;
        border-top: 1px solid var(--footer-border);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .footer {
        margin-top: 60px;
    }
    
    .footer-wrap {
        padding: 30px 0 20px;
    }
    
    .footer-logo img {
        max-width: 140px;
    }
    
    .telegram-widget {
        width: 54px;
        height: 54px;
        bottom: 20px;
        right: 20px;
    }
    
    .telegram-widget svg {
        width: 24px;
        height: 24px;
    }
    
    .telegram-tooltip {
        display: none;
    }
}

/* ============================================
   Accessibility (доступность)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .footer-nav-list,
    .footer-nav-link,
    .footer-nav-link::before,
    .footer-social-link,
    .footer-legal-link,
    .footer-powered-link,
    .footer-contact-link,
    .telegram-widget,
    .telegram-widget::before,
    .telegram-tooltip {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus states для клавиатурной навигации */
.footer-nav-title:focus-visible,
.footer-nav-link:focus-visible,
.footer-social-link:focus-visible,
.footer-legal-link:focus-visible,
.footer-powered-link:focus-visible,
.footer-contact-link:focus-visible,
.telegram-widget:focus-visible {
    outline: 2px solid var(--footer-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .footer-nav-link,
    .footer-legal-link,
    .footer-powered-link,
    .footer-contact-link {
        text-decoration: underline !important;
    }
    
    .footer-social-link,
    .telegram-widget {
        border: 2px solid var(--footer-text-primary);
    }
}
