﻿/* Global layout rules (NO PAGE SCROLL) */
/* NOTE: This must be in a non-isolated CSS file, because CSS-isolation cannot style html/body. */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* убираем общий скролл страницы */
}

/* Prevent iOS/Chrome bounce and scroll chaining */
body {
    overscroll-behavior: none;
}

/* If the host adds an app root container, keep it pinned to viewport */
#app, #blazor-app, .app-root {
    height: 100%;
    overflow: hidden;
}

/* Sidebar pin state lives on <html>, outside the Interactive Blazor tree. */
html.yapi-sidebar-unpinned .yt-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 250;
    transform: translateX(calc(-100% + 10px));
    box-shadow: 8px 0 22px rgba(0,0,0,0);
}

html.yapi-sidebar-unpinned .yt-sidebar:hover,
html.yapi-sidebar-unpinned .yt-sidebar:focus-within {
    transform: translateX(0);
    box-shadow: 8px 0 22px rgba(0,0,0,.42);
}

html.yapi-sidebar-unpinned .yt-sidebar-pin svg {
    transform: rotate(-45deg);
}

html.yapi-sidebar-unpinned .yt-sidebar-resizer {
    display: none;
}


/* Plugin topbar buttons must remain global: plugin icons are runtime markup. */
.yt-plugin-button {
    position: relative;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 9px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.08) 44%, rgba(8, 10, 14, 0.28) 100%),
        rgba(44, 47, 55, 0.68);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        inset 0 -1px 0 rgba(0, 0, 0, 0.55),
        0 2px 5px rgba(0, 0, 0, 0.40);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(7px) saturate(1.15);
    -webkit-backdrop-filter: blur(7px) saturate(1.15);
    transition:
        transform 0.12s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.yt-plugin-button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.45);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.11) 44%, rgba(8, 10, 14, 0.22) 100%),
        rgba(50, 54, 63, 0.76);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.50),
        inset 0 -1px 0 rgba(0, 0, 0, 0.48),
        0 4px 8px rgba(0, 0, 0, 0.46);
}

.yt-plugin-button:active {
    transform: translateY(1px) scale(0.98);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.40),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18),
        0 1px 2px rgba(0, 0, 0, 0.34);
}

.yt-plugin-button:focus-visible {
    outline: 2px solid #3ea6ff;
    outline-offset: 2px;
}

.yt-plugin-button img {
    display: block;
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    pointer-events: none;
}

.yt-plugin-button .yt-icon-fallback {
    font-size: 24px;
    line-height: 1;
}

/* Studio-like compact scrollbars: a quiet line at rest, clearer on hover. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.16) transparent;
}

*:hover {
    scrollbar-color: rgba(255,255,255,.36) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    min-height: 32px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    background-clip: padding-box;
}

*:hover::-webkit-scrollbar-thumb {
    border: 1px solid transparent;
    background: rgba(255,255,255,.40);
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    border: 1px solid transparent;
    background: rgba(255,255,255,.52);
    background-clip: padding-box;
}