/* Endernet hub (index) — layout on top of site.css tokens */

html,
body.hub-app {
    height: 100%;
}

body.hub-app {
    margin: 0;
    min-height: 100%;
    height: 100%;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow: hidden;
}

.hub-app .site-bg {
    z-index: 0;
}

.hub-preloader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    z-index: 9999;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.hub-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hub-preloader video {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    object-fit: cover;
}

.hub-auth {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.94);
    z-index: 8000;
}

.hub-auth.is-open {
    display: flex;
}

.hub-auth__card {
    max-width: 380px;
    width: min(90%, 380px);
    padding: 2rem 2.25rem;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow:
        0 0 60px rgba(0, 232, 255, 0.08),
        0 24px 80px rgba(0, 0, 0, 0.5);
}

.hub-auth__logo {
    width: 55px;
    height: 55px;
    margin: 0 auto 1.25rem;
    border-radius: 12px;
}

.hub-auth__title {
    margin: 0 0 1.25rem;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hub-menu-toggle {
    position: fixed;
    top: 1.15rem;
    left: 1.15rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-elevated);
    cursor: pointer;
    color: var(--color-text);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hub-menu-toggle:hover {
    border-color: rgba(0, 232, 255, 0.35);
    box-shadow: 0 0 20px rgba(0, 232, 255, 0.12);
}

.hub-menu-toggle:focus-visible {
    outline: 2px solid var(--neon-green);
    outline-offset: 2px;
}

.hub-menu-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.35s ease, opacity 0.25s ease;
}

.hub-menu-toggle[aria-expanded="true"] .hub-menu-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(-45deg);
}

.hub-menu-toggle[aria-expanded="true"] .hub-menu-toggle__bar:nth-child(2) {
    opacity: 0;
}

.hub-menu-toggle[aria-expanded="true"] .hub-menu-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(45deg);
}

.hub-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1500;
    width: min(300px, 92vw);
    height: 100%;
    padding: 5rem 1.15rem 1.5rem;
    box-sizing: border-box;
    overflow-y: auto;
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border);
    transform: translateX(-105%);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
}

.hub-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.45);
}

.hub-sidebar__label {
    display: block;
    margin: 1.5rem 0 0.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.hub-sidebar__label:first-child {
    margin-top: 0;
}

.hub-nav__link {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.75rem;
    box-sizing: border-box;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

a.hub-nav__link {
    color: inherit;
}

.hub-nav__link:hover {
    background: linear-gradient(
        135deg,
        var(--color-accent-soft-blue),
        var(--color-accent-soft)
    );
    color: var(--neon-blue);
}

.hub-nav__link--danger {
    color: #ff6b7a !important;
    font-size: 0.8rem;
}

.hub-nav__link--danger:hover {
    color: #ff8a96 !important;
}

.hub-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.hub-nav__chevron {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.hub-nav__toggle[aria-expanded="true"] .hub-nav__chevron {
    transform: rotate(-180deg);
}

.hub-sub {
    display: none;
    margin: 0.15rem 0 0.35rem 0.75rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--color-border);
}

.hub-sub.is-open {
    display: block;
}

.hub-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4.5rem 1.25rem 6.5rem;
    text-align: center;
    overflow-y: auto;
    box-sizing: border-box;
}

.hub-content {
    position: relative;
    max-width: 750px;
    width: 100%;
    padding-bottom: 2rem;
    animation: hubFadeUp 0.55s ease forwards;
}

@keyframes hubFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub-preloader,
    .hub-sidebar,
    .hub-menu-toggle__bar,
    .hub-content {
        animation: none !important;
        transition: none !important;
    }
}

.hub-content.is-animating {
    animation: hubFadeUp 0.55s ease forwards;
}

.hub-curtain-ad {
    position: absolute;
    right: -180px;
    top: 100px;
    width: 160px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1100px) {
    .hub-curtain-ad {
        display: none;
    }
}

.hub-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 15px;
    filter: drop-shadow(0 0 22px rgba(0, 232, 255, 0.25));
    object-fit: contain;
}

.hub-view-title {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hub-view-body {
    margin: 0;
    padding: 1.75rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-text-muted);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: rgba(8, 14, 22, 0.55);
}

.hub-view-body b,
.hub-view-body strong {
    color: var(--neon-blue);
    font-weight: 600;
}

.hub-bottom-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    background: var(--color-bg-elevated);
    border-top: 1px solid var(--color-border);
}
