/* Базовые стили для мобильных устройств */
.x_sidebar_links {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    max-width: 98%;
    z-index: 1000;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.9) 0%, rgba(30, 30, 50, 0.8) 50%, rgba(0, 0, 0, 0.95) 100%);
    background-size: 200% 200%;
    animation: darkSpill 4s ease-in-out infinite;
    border-radius: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(50, 50, 70, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.x_sidebar_links svg {
    width: 48px;
    height: 48px;
    margin: 0 8px;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.x_sidebar_links .text {
    display: inline;
    font-size: 16px;
    margin-left: 8px;
    color: #fff;
    font-weight: 500;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.x_sidebar_links::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 30px;
    z-index: -1;
    transition: all 0.6s ease;
}

/* Состояние рассыпания */
.x_sidebar_links.scatter {
    transform: translateX(-50%) translateY(100px) scale(0.8);
    opacity: 0;
    backdrop-filter: blur(2px);
}

.x_sidebar_links.scatter svg {
    transform: translateY(30px) rotate(45deg) scale(0.5);
    opacity: 0;
}

.x_sidebar_links.scatter .text {
    transform: translateY(20px) scale(0.7);
    opacity: 0;
}

.x_sidebar_links.scatter::before {
    opacity: 0;
    transform: scale(0.8);
}

/* Состояние всплытия */
.x_sidebar_links.rise {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.x_sidebar_links.rise svg {
    transform: translateY(0) rotate(0) scale(1);
    opacity: 1;
}

.x_sidebar_links.rise .text {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Очень компактный размер для ПК с анимациями */
@media (min-width: 1024px) {
    .x_sidebar_links {
        padding: 6px 10px;
        border-radius: 16px;
        max-width: 40%;
        bottom: 15px;
    }
    
    .x_sidebar_links svg {
        width: 28px;
        height: 28px;
        margin: 0 4px;
    }
    
    .x_sidebar_links .text {
        font-size: 12px;
        margin-left: 4px;
        font-weight: 400;
    }
    
    .x_sidebar_links::before {
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-radius: 18px;
    }

    /* Эффект частичного скрытия при скролле вниз */
    .x_sidebar_links.partial-hide {
        transform: translateX(-50%) translateY(50px) scale(0.9);
        opacity: 0.7;
        backdrop-filter: blur(5px);
    }
}

@keyframes darkSpill {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Эффект частиц для рассыпания */
.x_sidebar_links::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 25px;
    pointer-events: none;
}

.x_sidebar_links.scatter::after {
    opacity: 1;
    animation: particleGlow 0.8s ease-out;
}

@keyframes particleGlow {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@media (min-width: 768px) {
    .tooltip-center {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 20, 0.95));
        color: #ffffff;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
        z-index: 2147483647; /* Максимальный z-index для Chromium */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        border: 1px solid rgba(255, 255, 255, 0.1);
        pointer-events: none;
        white-space: nowrap;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        max-width: 250px;
        word-wrap: break-word;
        /* Fallback для старых браузеров без backdrop-filter */
        background-attachment: fixed; /* Имитация размытия через градиент */
    }
    
    /* Упрощенная анимация для Brave */
    .x_side_links[data-title]:hover .tooltip-center {
        opacity: 1;
        visibility: visible;
    }
    
    /* Альтернатива keyframes для лучшей совместимости */
    @keyframes tooltipFadeIn {
        0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
        100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    }
    
    .tooltip-center.show {
        animation: tooltipFadeIn 0.3s ease-out;
    }
    
    /* Для поддержки в старых версиях Chromium */
    @supports not (backdrop-filter: blur(10px)) {
        .tooltip-center {
            background: rgba(0, 0, 0, 0.95); /* Простой фон без фильтра */
        }
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Дополнительные стили для усиления эффекта */
.logo-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(100, 150, 200, 0.1),
        rgba(150, 100, 200, 0.1),
        rgba(100, 200, 150, 0.1),
        rgba(100, 150, 200, 0.1)
    );
    background-size: 400% 400%;
    animation: colorShift 4s ease-in-out infinite;
    z-index: -1;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        #4a5a6a,
        #2a3a4a,
        #5a4a6a,
        #4a5a6a
    );
    background-size: 400% 400%;
    animation: borderFlow 3s ease-in-out infinite;
    z-index: -2;
    filter: blur(1px);
    opacity: 0.6;
}

@keyframes colorShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes borderFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Hover эффект для интерактивности */
.logo-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}