/* ==========================================================================
   NOSVAY HOUSE — Design System & Base Styles
   Minimalist Dark Cyberpunk Gaming Theme — Sidebar Layout
   ========================================================================== */

:root {
    --bg-base: #090807;
    --bg-surface: #111009;
    --bg-surface-2: #16140e;
    --gold: #d4920a;
    --gold-bright: #f0a80c;
    --gold-glow: rgba(212, 146, 10, 0.32);
    --gold-dim: rgba(212, 146, 10, 0.09);
    --gold-border: rgba(212, 146, 10, 0.2);
    --text-main: #f5f0e8;
    --text-sub: #918b82;
    --text-muted: #5e5851;
    --border-line: rgba(255, 255, 255, 0.07);
    --font-display: 'Syne', system-ui, sans-serif;
    --font-main: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'DM Mono', monospace;
    --sidebar-w: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 146, 10, 0.35) #0d0c0a;
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0d0c0a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 146, 10, 0.35);
    border-radius: 4px;
    border: 1px solid rgba(212, 146, 10, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(240, 168, 12, 0.7);
    border-color: rgba(240, 168, 12, 0.5);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

html, body {
    min-height: 100%;
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ─────────────────────────────────────────────
   Background Atmosphere
───────────────────────────────────────────── */

.ambient-viewport {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 28px 28px;
    animation: fadeIn 1.4s ease backwards;
}

.ambient-glow-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(ellipse at center, rgba(212, 146, 10, 0.09) 0%, rgba(212, 146, 10, 0.015) 50%, transparent 70%);
    filter: blur(120px);
    pointer-events: none;
    animation: glowBloom 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

.ambient-mouse-blob {
    position: absolute;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 146, 10, 0.07) 0%, transparent 68%);
    filter: blur(80px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

@keyframes glowBloom {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ─────────────────────────────────────────────
   Container
───────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─────────────────────────────────────────────
   Side Navigation
───────────────────────────────────────────── */

.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(9, 8, 7, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-line);
    display: flex;
    flex-direction: column;
    padding: 26px 16px;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    animation: sideNavIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

/* subtle gold line at top of sidebar */
.side-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.3;
}

@keyframes sideNavIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Brand logo */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--text-main);
    padding: 6px 8px;
    border-radius: 8px;
    margin-bottom: 26px;
    transition: background 0.18s ease;
}

.brand-logo:hover {
    background: rgba(255, 255, 255, 0.04);
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--gold-border);
    object-fit: cover;
    flex-shrink: 0;
}

.brand-logo span {
    color: var(--gold);
}

/* Section labels */
.side-nav-section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 8px;
}

/* Nav links container */
.side-nav-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    margin-bottom: 24px;
}

/* Nav link items */
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: 16.5px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link svg {
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: var(--gold-bright);
    background: var(--gold-dim);
    border-color: var(--gold-border);
    box-shadow: 0 0 16px rgba(212, 146, 10, 0.14), inset 0 0 8px rgba(212, 146, 10, 0.08);
}

/* Active left-edge accent bar */
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 3px;
    background: var(--gold-bright);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--gold-bright);
    animation: accentBarGrow 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes accentBarGrow {
    from { opacity: 0; transform: scaleY(0.2); }
    to   { opacity: 1; transform: scaleY(1); }
}

/* ─────────────────────────────────────────────
   Sidebar Bottom Area
───────────────────────────────────────────── */

.side-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Action buttons (Discord, user profile) */
.side-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 18px;
    border-radius: 9px;
    font-family: var(--font-mono);
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text-sub);
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
}

.side-action-user {
    color: var(--gold);
}

.side-action-user:hover {
    color: var(--gold-bright);
    background: var(--gold-dim);
    border-color: var(--gold-border);
}

.side-action-discord {
    color: #7983f5;
}

.side-action-discord:hover {
    color: #fff;
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.3);
}

.side-nav-divider {
    height: 1px;
    background: var(--border-line);
    margin: 8px 0;
}

/* Footer row with Home + Lang toggle */
.side-nav-footer-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.side-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    padding: 8px 12px;
    border-radius: 7px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub);
    border: 1px solid transparent;
    transition: all 0.18s ease;
    cursor: pointer;
    background: transparent;
    text-decoration: none;
    justify-content: center;
}

.side-footer-link:hover {
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-line);
}

.lang-toggle-btn {
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   Main App Layout (offset from sidebar)
───────────────────────────────────────────── */

.app-layout {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* ─────────────────────────────────────────────
   Buttons
───────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-main);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: #080604;
}

.btn-primary:hover {
    background: var(--gold-bright);
    box-shadow: 0 0 0 3px rgba(212, 146, 10, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border-line);
}

.btn-secondary:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.btn-discord {
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.25);
    color: #7983f5;
}

.btn-discord:hover {
    background: #5865F2;
    color: #fff;
    border-color: #5865F2;
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-line);
    padding: 24px 0;
    text-align: center;
    position: relative;
    z-index: 10;
    background: rgba(8, 8, 10, 0.6);
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────
   Page Transitions & Tab Animations
───────────────────────────────────────────── */

@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: 0.2s cubic-bezier(0.4, 0, 1, 1) both fadeOutPage;
}

::view-transition-new(root) {
    animation: 0.25s cubic-bezier(0, 0, 0.2, 1) both fadeInPage;
}

@keyframes fadeOutPage {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback page entrance animation */
.app-main-container {
    animation: contentFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth HTMX element swap transitions */
.htmx-swapping {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.htmx-settling {
    opacity: 0;
}

.htmx-added {
    animation: fadeInElement 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInElement {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─────────────────────────────────────────────
   Home page lang+login overlay (fixed, top-right)
   Only used in apps/home/index.html which does NOT extend base.html
───────────────────────────────────────────── */

.lang-switch-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch-btn {
    background: rgba(9, 8, 7, 0.75);
    border: 1px solid var(--border-line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-sub);
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    font-family: var(--font-mono);
}

.lang-switch-btn:hover {
    color: var(--text-main);
    background: rgba(212, 146, 10, 0.08);
    border-color: var(--gold-border);
}

/* ─────────────────────────────────────────────
   Responsive — collapse sidebar on small screens
───────────────────────────────────────────── */

@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
    }

    .side-nav {
        width: 64px;
        padding: 16px 10px;
    }

    .brand-logo div,
    .nav-link span,
    .side-nav-section-label,
    .side-action-btn span,
    .side-footer-link span {
        display: none;
    }

    .brand-logo {
        justify-content: center;
    }

    .nav-link {
        justify-content: center;
        padding: 10px;
        gap: 0;
    }

    .side-action-btn {
        justify-content: center;
        padding: 10px;
        gap: 0;
    }

    .app-layout {
        margin-left: 64px;
    }
}
