/* ==================== RMRP Helper — «Плавающий» сайдбар (Dock) ====================
   Класс .sidebar-floating на body — sidebar-style.js.
   Классический сайдбар без этого класса не затрагивается.
   ==================================================================================== */

/* Контейнер — нижний центр. Важно: сбросить height:100% / чёрный фон
   из sidebar-base и rmrp-responsive (иначе чёрные «квадратные» края за dock). */
body.sidebar-floating .sidebar {
    position: fixed !important;
    bottom: clamp(12px, 2vh, 20px) !important;
    left: 50% !important;
    top: auto !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    max-width: min(96vw, 920px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
    display: block !important;
    pointer-events: none !important;
    background: transparent !important;
    background-color: transparent !important;
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
}

/* Стеклянная «капсула»-док */
body.sidebar-floating .sidebar-wrapper {
    pointer-events: auto;
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 8px 10px 8px 12px !important;
    gap: 6px;
    max-width: min(96vw, 920px);
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;

    /* clip corners cleanly (no black square under radius) */
    overflow: hidden !important;
    border-radius: 28px !important;

    /* Softer glass — no heavy opaque black that paints square corners */
    background: rgba(36, 36, 44, 0.62) !important;
    background-image:
        linear-gradient(
            155deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.04) 38%,
            rgba(255, 255, 255, 0.02) 100%
        ) !important;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.16) !important;

    /* Outer glow only — avoid hard black inset that reads as «углы» */
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.38),
        0 2px 8px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(230, 57, 57, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;

    animation: none;
}

/* Red ambient glow OUTSIDE capsule (sibling layer, not under overflow:hidden) */
body.sidebar-floating .sidebar::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 70%;
    height: 20px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(230, 57, 57, 0.4) 0%, transparent 72%);
    filter: blur(10px);
    pointer-events: none;
    z-index: -1;
    opacity: 0.9;
}

/* Top highlight line inside capsule */
body.sidebar-floating .sidebar-wrapper::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 1px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 25%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(255, 255, 255, 0.4) 75%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 3;
}

/* Kill leftover ::before from older rules that sat under z-index:-1 */
body.sidebar-floating .sidebar-wrapper::before {
    content: none !important;
    display: none !important;
}

@keyframes rmrpDockIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.sidebar-floating .logo {
    display: none;
}

/* Горизонтальный скролл иконок */
body.sidebar-floating .sidebar-nav-scroll {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

body.sidebar-floating .sidebar-nav-scroll::-webkit-scrollbar {
    display: none;
}

body.sidebar-floating .nav-menu {
    flex-direction: row;
    padding: 0;
    gap: 3px;
    flex-shrink: 0;
    align-items: center;
}

body.sidebar-floating .nav-menu li {
    list-style: none;
}

/* Визуальный разделитель групп (основное меню / настройки) */
body.sidebar-floating .nav-divider {
    display: block;
    width: 1px;
    height: 28px;
    margin: 0 6px;
    flex-shrink: 0;
    align-self: center;
    border: none;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.22) 30%,
        rgba(230, 57, 57, 0.45) 50%,
        rgba(255, 255, 255, 0.22) 70%,
        transparent 100%
    );
}

/* Пункты — «таблетки» с иконкой сверху */
body.sidebar-floating .nav-item {
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-width: 56px;
    padding: 9px 12px 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.15px;
    color: rgba(220, 220, 230, 0.72);
    white-space: nowrap;
    border-left: none !important;
    border-radius: 16px;
    background: transparent;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.22s ease;
}

body.sidebar-floating .nav-item img {
    width: 22px;
    height: 22px;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
    filter: brightness(0.95) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

/* Hover — подъём как macOS dock */
body.sidebar-floating .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

body.sidebar-floating .nav-item:hover img {
    transform: scale(1.12);
    filter: brightness(1.15) drop-shadow(0 2px 6px rgba(230, 57, 57, 0.35));
}

body.sidebar-floating .nav-item:active {
    transform: translateY(-1px) scale(1.02);
}

/* Активный пункт — neon pill */
body.sidebar-floating .nav-item.active,
body.sidebar-floating .sidebar-profile-card.active {
    pointer-events: none;
    cursor: default;
}

body.sidebar-floating .nav-item.active {
    color: #fff;
    border-left: none !important;
    background: linear-gradient(
        160deg,
        rgba(230, 57, 57, 0.55) 0%,
        rgba(180, 30, 40, 0.38) 55%,
        rgba(80, 20, 28, 0.45) 100%
    );
    box-shadow:
        0 0 0 1px rgba(255, 120, 120, 0.35) inset,
        0 6px 18px rgba(230, 57, 57, 0.35),
        0 0 24px rgba(230, 57, 57, 0.18);
    transform: translateY(-2px);
}

body.sidebar-floating .nav-item.active img {
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 100, 100, 0.55));
}

/* Точка-индикатор под активным */
body.sidebar-floating .nav-item.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Отступ контента снизу (JS уточняет динамически) */
body.sidebar-floating .main-content,
body.sidebar-floating .content-area,
body.sidebar-floating .main-wrapper,
body.sidebar-floating .timer-page,
body.sidebar-floating .notes-app,
body.sidebar-floating .profile-page,
body.sidebar-floating .ach-page,
body.sidebar-floating .app-page {
    padding-bottom: 118px;
}

/* Профиль справа — «чип» с аватаром */
body.sidebar-floating .sidebar-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 0 0 2px;
    padding: 8px 12px 7px;
    min-width: 58px;
    border-radius: 18px;
    border-left: none !important;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.2s ease,
        box-shadow 0.22s ease;
}

body.sidebar-floating .sidebar-profile-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 8px 18px rgba(0, 0, 0, 0.3);
}

body.sidebar-floating .sidebar-profile-card.active {
    background: linear-gradient(
        160deg,
        rgba(230, 57, 57, 0.5) 0%,
        rgba(100, 25, 30, 0.4) 100%
    );
    box-shadow:
        0 0 0 1px rgba(255, 120, 120, 0.35) inset,
        0 6px 16px rgba(230, 57, 57, 0.3);
    transform: translateY(-2px);
}

body.sidebar-floating .sidebar-profile-meta {
    text-align: center;
}

body.sidebar-floating .sidebar-profile-name {
    font-size: 10px;
    font-weight: 700;
    max-width: 64px;
    color: rgba(240, 240, 245, 0.9);
}

body.sidebar-floating .sidebar-profile-sub,
body.sidebar-floating .sidebar-helper-badge {
    display: none !important;
}

body.sidebar-floating .sidebar-profile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(230, 57, 57, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.sidebar-floating .sidebar-profile-card:hover .sidebar-profile-avatar {
    box-shadow:
        0 0 0 2px rgba(255, 120, 120, 0.7),
        0 0 12px rgba(230, 57, 57, 0.4);
    transform: scale(1.06);
}

/* Компакт на узких окнах */
@media (max-width: 720px) {
    body.sidebar-floating .sidebar {
        max-width: 96vw;
        bottom: 10px;
    }

    body.sidebar-floating .sidebar-wrapper {
        max-width: 96vw;
        padding: 6px 8px;
        border-radius: 22px;
        gap: 3px;
    }

    body.sidebar-floating .nav-item {
        min-width: 48px;
        padding: 7px 8px 6px;
        font-size: 9.5px;
        gap: 3px;
        border-radius: 14px;
    }

    body.sidebar-floating .nav-item img {
        width: 18px;
        height: 18px;
    }

    body.sidebar-floating .sidebar-profile-card {
        min-width: 48px;
        padding: 6px 8px;
    }

    body.sidebar-floating .sidebar-profile-avatar {
        width: 24px;
        height: 24px;
    }

    body.sidebar-floating .nav-divider {
        height: 22px;
        margin: 0 4px;
    }
}
