/* StreamClipper — shared design tokens, base reset, and shared components. */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a26;
    --border: #1e1e2e;
    --text: #e4e4eb;
    --text-muted: #8888a0;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --green: #00b894;
    --red: #e74c3c;
    --yellow: #fdcb6e;
    --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ─── Floating top nav pill ──────────────────────────────────────────── */

nav.app-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 1100px;
    z-index: 100;
    background: rgba(18, 18, 26, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-nav .logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
    text-decoration: none;
}

.app-nav .nav-back {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.app-nav .nav-back:hover { color: var(--text); }

@media (max-width: 640px) {
    nav.app-nav { width: calc(100% - 32px); padding: 10px 16px; }
}

/* ─── Vertical sidebar (used by /dashboard and /account) ─────────────── */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 50;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-light);
    text-decoration: none;
    padding: 0 12px 24px;
    display: block;
}

.sidebar-user {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-plan {
    font-size: 11px;
    color: var(--accent-light);
    margin-top: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--text);
    background: rgba(108, 92, 231, 0.12);
    border-color: rgba(108, 92, 231, 0.25);
}

.sidebar-link svg { flex-shrink: 0; opacity: 0.8; }
.sidebar-link.active svg { opacity: 1; color: var(--accent-light); }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-footer .sidebar-link { font-size: 13px; }

/* Sidebar pages share an .app-main container that offsets to the right of the sidebar. */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 48px 48px 60px;
}

@media (max-width: 860px) {
    .app-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 16px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
    }
    .sidebar-logo { padding: 0 8px; }
    .sidebar-user { display: none; }
    .sidebar-nav { flex-direction: row; flex: 0 0 auto; }
    .sidebar-link { white-space: nowrap; }
    .sidebar-footer {
        border: none;
        padding: 0;
        flex-direction: row;
        margin-left: auto;
    }
    .app-main { margin-left: 0; padding: 28px 20px 48px; }
}

/* Per-page templates keep their own .btn / .btn-primary etc. — they vary just
   enough (padding, shadow) that one shared definition would cause subtle layout
   shifts. Re-shareable buttons can be migrated here later when designs stabilise. */
