/**
 * Euromaja hub shell layout.
 * Works with settings.js theme vars on :root / body background.
 */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,700;1,9..144,500&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --hub-wood-deep: #2a1a12;
    --hub-wood-mid: #3d2619;
    --hub-cream: #f3e6d4;
    --hub-gold: #e8a317;
    --hub-gold-dim: rgba(232, 163, 23, 0.35);
    --hub-felt: #142018;
    --hub-ink: rgba(12, 10, 9, 0.92);
    --hub-glass: rgba(14, 18, 24, 0.72);
    --hub-glass-light: rgba(28, 34, 42, 0.55);
    --hub-font: 'Outfit', system-ui, sans-serif;
    --hub-display: 'Fraunces', Georgia, serif;
    --hub-sidebar-w: 248px;
    --hub-top-h: 64px;
    --hub-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html.hub-root {
    height: 100%;
}

body.hub-app {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--hub-font);
    color: var(--hub-cream);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Theme gradient shows behind panels */
body.hub-app::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(232, 163, 23, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, rgba(95, 212, 200, 0.06), transparent 45%);
}

.hub-layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---- Sidebar (wood / landlord booth) ---- */
.hub-sidebar {
    width: var(--hub-sidebar-w);
    flex-shrink: 0;
    background:
        linear-gradient(175deg, rgba(74, 50, 32, 0.97) 0%, var(--hub-wood-deep) 48%, #1a0f0c 100%);
    border-right: 3px solid var(--hub-gold-dim);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    padding: 1.15rem 0.85rem 1.25rem;
    position: relative;
}

.hub-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

.hub-brand {
    padding: 0.35rem 0.5rem 0.85rem;
    border-bottom: 1px dashed rgba(243, 230, 212, 0.15);
    margin-bottom: 0.65rem;
}

.hub-brand-mark {
    font-family: var(--hub-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: var(--hub-cream);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hub-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.hub-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: rgba(243, 230, 212, 0.85);
    font-weight: 500;
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    border: 1px solid transparent;
}

.hub-nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.hub-nav a.hub-nav-active {
    background: rgba(232, 163, 23, 0.12);
    border-color: rgba(232, 163, 23, 0.35);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* ---- Main column ---- */
.hub-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.hub-topbar {
    min-height: var(--hub-top-h);
    padding: 0.65rem 1rem 0.65rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--hub-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hub-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 2px solid rgba(243, 230, 212, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: var(--hub-cream);
    font-family: var(--hub-font);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
}

.hub-search-wrap {
    flex: 1;
    min-width: 140px;
    max-width: 420px;
    position: relative;
}

.hub-search {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 2px solid rgba(243, 230, 212, 0.18);
    background: rgba(8, 10, 14, 0.55);
    color: var(--hub-cream);
    font-family: var(--hub-font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-search::placeholder {
    color: rgba(243, 230, 212, 0.38);
}

.hub-search:focus {
    border-color: var(--hub-gold-dim);
    box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.12);
}

.hub-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.hub-icon-btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 2px solid rgba(243, 230, 212, 0.45);
    background: rgba(0, 0, 0, 0.45);
    color: var(--hub-cream);
    font-family: var(--hub-font);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.hub-icon-btn:hover {
    transform: scale(1.06);
    border-color: var(--theme-accent, var(--hub-gold));
    box-shadow: 0 0 18px var(--theme-glow, rgba(126, 34, 206, 0.35));
}

.hub-scroll {
    flex: 1;
    padding: 1.25rem 1.25rem 3rem;
    overflow-y: auto;
}

.hub-page-head {
    margin-bottom: 1.35rem;
}

.hub-page-title {
    font-family: var(--hub-display);
    font-weight: 700;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

@media (min-width: 1100px) {
    .hub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cards — arcade glass tiles */
.hub-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 132px;
    padding: 1.1rem 1.15rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--hub-cream);
    background: var(--hub-glass-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--hub-shadow);
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s, box-shadow 0.22s;
}

.hub-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%);
    pointer-events: none;
}

.hub-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: var(--hub-shadow), 0 0 28px var(--theme-glow, rgba(126, 34, 206, 0.22));
}

.hub-card:active {
    transform: translateY(-1px);
}

.hub-card-feature {
    border-color: rgba(232, 163, 23, 0.45);
    background: linear-gradient(165deg, rgba(26, 28, 34, 0.88) 0%, rgba(12, 14, 18, 0.92) 100%);
}

.hub-card-feature:hover {
    border-color: var(--hub-gold);
}

.hub-card-home {
    background: linear-gradient(145deg, rgba(252, 248, 240, 0.96) 0%, rgba(230, 220, 208, 0.94) 100%);
    color: var(--hub-ink);
    border-color: rgba(0, 0, 0, 0.08);
}

.hub-card-home:hover {
    border-color: var(--theme-accent, #7e22ce);
}

.hub-card-home .hub-card-title {
    color: var(--hub-ink);
    text-shadow: none;
}

.hub-card-title {
    font-family: var(--hub-display);
    font-weight: 700;
    font-size: 1.22rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hub-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: rgba(243, 230, 212, 0.45);
    font-size: 0.95rem;
}

.hub-version {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(243, 230, 212, 0.28);
    pointer-events: none;
}

@media (hover: none) {
    .hub-card:hover {
        transform: none;
    }
    .hub-card:active {
        transform: scale(0.98);
    }
}

/* Mobile sidebar */
@media (max-width: 900px) {
    .hub-menu-toggle {
        display: flex;
    }

    .hub-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(-102%);
        transition: transform 0.28s ease;
        box-shadow: none;
        max-width: min(var(--hub-sidebar-w), 88vw);
    }

    body.hub-sidebar-open .hub-sidebar {
        transform: translateX(0);
        box-shadow: 16px 0 48px rgba(0, 0, 0, 0.55);
    }

    body.hub-sidebar-open .hub-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .hub-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
    }

    .hub-search-wrap {
        max-width: none;
    }

    .hub-scroll {
        padding: 1rem 1rem 2.5rem;
    }
}

@media (max-width: 900px) {
    .hub-sidebar-backdrop {
        display: block;
    }
}

@media (min-width: 901px) {
    .hub-sidebar-backdrop {
        display: none;
    }
}
