/* OpenVibe shared UI theme — used across openvibe-network surfaces. */

:root {
    --ov-bg: #0b0d12;
    --ov-bg-elev: #131722;
    --ov-bg-elev-2: #1a2030;
    --ov-text: #e7e9ee;
    --ov-text-dim: #9aa3b2;
    --ov-text-faint: #5b6473;
    --ov-accent: #7c5cff;
    --ov-accent-2: #2dd4bf;
    --ov-warn: #f5a524;
    --ov-danger: #f85149;
    --ov-ok: #3fb950;
    --ov-border: #232b3b;
    --ov-radius: 12px;
    --ov-radius-sm: 8px;
    --ov-shadow: 0 4px 24px rgba(0, 0, 0, .35);
    --ov-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
    --ov-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ov-bg);
    color: var(--ov-text);
    font-family: var(--ov-font);
    line-height: 1.55;
    min-height: 100vh;
}

a { color: var(--ov-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.ov-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.ov-nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 13, 18, .85);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--ov-border);
}
.ov-nav-inner {
    max-width: 1280px; margin: 0 auto; padding: .75rem 1.25rem;
    display: flex; align-items: center; gap: 1rem;
}
.ov-brand {
    display: flex; align-items: center; gap: .5rem;
    font-weight: 700; letter-spacing: .02em;
    color: var(--ov-text);
}
.ov-brand b { background: linear-gradient(90deg, var(--ov-accent), var(--ov-accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ov-nav-links { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
.ov-nav-links a {
    color: var(--ov-text-dim);
    padding: .35rem .65rem;
    border-radius: var(--ov-radius-sm);
}
.ov-nav-links a:hover { background: var(--ov-bg-elev); color: var(--ov-text); text-decoration: none; }

.ov-hero {
    padding: 3.5rem 0 2rem;
    text-align: center;
}
.ov-hero h1 {
    font-size: clamp(2rem, 4vw + 1rem, 3.4rem);
    margin: 0 0 .75rem;
    background: linear-gradient(120deg, var(--ov-text) 30%, var(--ov-accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ov-hero p { color: var(--ov-text-dim); font-size: 1.1rem; max-width: 720px; margin: 0 auto 1.5rem; }
.ov-cta-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.ov-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .6rem 1rem;
    border-radius: var(--ov-radius-sm);
    background: var(--ov-bg-elev);
    color: var(--ov-text);
    border: 1px solid var(--ov-border);
    font-weight: 500;
    cursor: pointer;
}
.ov-btn:hover { background: var(--ov-bg-elev-2); text-decoration: none; }
.ov-btn-primary { background: linear-gradient(135deg, var(--ov-accent), #5b3df0); border-color: transparent; color: #fff; }
.ov-btn-primary:hover { filter: brightness(1.05); }

.ov-section { margin-top: 3rem; }
.ov-section h2 { margin: 0 0 .25rem; font-size: 1.4rem; }
.ov-section .ov-section-sub { color: var(--ov-text-dim); margin: 0 0 1rem; }

.ov-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ov-card {
    background: var(--ov-bg-elev);
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius);
    padding: 1rem 1.1rem;
    transition: transform .15s ease, border-color .15s ease;
    display: flex; flex-direction: column; gap: .35rem;
    color: var(--ov-text);
}
.ov-card:hover { border-color: var(--ov-accent); transform: translateY(-2px); text-decoration: none; }
.ov-card .title { font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: .35rem; }
.ov-card .desc { color: var(--ov-text-dim); font-size: .92rem; }
.ov-card .meta { color: var(--ov-text-faint); font-size: .8rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.ov-tag {
    background: var(--ov-bg-elev-2);
    color: var(--ov-text-dim);
    padding: 0 .45rem;
    border-radius: 999px;
    font-size: .72rem;
    border: 1px solid var(--ov-border);
}
.ov-tag.ok { color: var(--ov-ok); }
.ov-tag.warn { color: var(--ov-warn); }
.ov-tag.danger { color: var(--ov-danger); }

.ov-stat-strip { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 2rem 0; }
.ov-stat { background: var(--ov-bg-elev); border: 1px solid var(--ov-border); border-radius: var(--ov-radius); padding: 1rem; text-align: center; }
.ov-stat .n { font-size: 1.6rem; font-weight: 700; }
.ov-stat .l { color: var(--ov-text-dim); font-size: .85rem; margin-top: .25rem; }

.ov-input {
    background: var(--ov-bg-elev);
    border: 1px solid var(--ov-border);
    color: var(--ov-text);
    padding: .55rem .8rem;
    border-radius: var(--ov-radius-sm);
    font-size: 1rem;
    width: 100%;
}
.ov-input:focus { outline: 2px solid var(--ov-accent); }

.ov-table { width: 100%; border-collapse: collapse; }
.ov-table th, .ov-table td { padding: .5rem .65rem; border-bottom: 1px solid var(--ov-border); text-align: left; vertical-align: top; }
.ov-table th { color: var(--ov-text-dim); font-weight: 500; font-size: .85rem; }
.ov-table tr:hover td { background: rgba(255, 255, 255, .02); }

.ov-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--ov-border); margin-bottom: 1rem; flex-wrap: wrap; }
.ov-tab { padding: .5rem .9rem; cursor: pointer; color: var(--ov-text-dim); border-bottom: 2px solid transparent; }
.ov-tab.active { color: var(--ov-text); border-color: var(--ov-accent); }

.ov-footer { color: var(--ov-text-faint); font-size: .85rem; text-align: center; padding: 3rem 1rem 1rem; border-top: 1px solid var(--ov-border); margin-top: 4rem; }
.ov-footer a { color: var(--ov-text-dim); margin: 0 .5rem; }

.ov-banner {
    background: var(--ov-bg-elev);
    border: 1px solid var(--ov-border);
    border-radius: var(--ov-radius);
    padding: .75rem 1rem;
    margin: 1rem 0;
    color: var(--ov-text-dim);
}
.ov-banner.warn { border-color: var(--ov-warn); }
.ov-banner.ok { border-color: var(--ov-ok); }

code { background: var(--ov-bg-elev); padding: 0 .3rem; border-radius: 4px; font-family: var(--ov-mono); font-size: .9em; }
pre { background: var(--ov-bg-elev); padding: 1rem; border-radius: var(--ov-radius); overflow-x: auto; }

.ov-launcher { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 100; }
.ov-launcher.open { display: flex; }
.ov-launcher-box { width: min(640px, 92vw); background: var(--ov-bg-elev); border: 1px solid var(--ov-border); border-radius: var(--ov-radius); box-shadow: var(--ov-shadow); padding: 1rem; }
.ov-launcher-results { max-height: 60vh; overflow-y: auto; margin-top: .75rem; }
.ov-launcher-results .ov-card { padding: .55rem .8rem; border-radius: var(--ov-radius-sm); }

/* ── Anonymous buddy menu ── */
.ov-anon-menu {
    position: relative;
}
.ov-anon-trigger {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 34px;
    height: 34px;
    padding: 0 0.55rem;
    border-radius: 17px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--ov-text-dim, #94a3b8);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ov-anon-trigger:hover {
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.1);
    color: var(--ov-text, #f1f5f9);
}
.ov-anon-trigger-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ov-anon-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--ov-nav-bg, #0e1018);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
    z-index: 9999;
}
.ov-anon-dropdown-name {
    padding: 0.65rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ov-text-dim, #64748b);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ov-anon-dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--ov-text, #f1f5f9);
    text-decoration: none;
    transition: background 0.12s;
}
.ov-anon-dropdown-item:hover {
    background: rgba(255,255,255,0.06);
}
.ov-anon-dropdown-item--danger {
    color: #f87171;
}
.ov-anon-dropdown-item--danger:hover {
    background: rgba(248,113,113,0.08);
}

/* ── Nav end wrapper ── */
.ov-nav-end {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Theme picker button + popup ── */
.ov-theme-btn-wrap { position: relative; }
.ov-theme-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--ov-text-dim, #94a3b8);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ov-theme-btn:hover,
.ov-theme-btn[aria-expanded="true"] {
    border-color: var(--ov-accent, rgba(99,102,241,0.5));
    background: rgba(99,102,241,0.1);
    color: var(--ov-text, #f1f5f9);
}
.ov-theme-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: var(--ov-bg, #0b0d12);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    padding: 0.75rem;
    z-index: 9999;
}
.ov-theme-swatches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.ov-theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.ov-theme-swatch:hover {
    border-color: var(--ov-accent, #7c5cff);
    background: rgba(255,255,255,0.04);
}
.ov-theme-swatch--active {
    border-color: var(--ov-accent, #7c5cff);
    background: rgba(124,92,255,0.1);
}
.ov-theme-swatch-preview {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding: 0 4px 4px;
    width: 100%;
    height: 44px;
    border-radius: 5px;
}
.ov-theme-swatch-accent {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,0.25);
}
.ov-theme-swatch-name {
    font-size: 0.72rem;
    color: var(--ov-text-dim, #9aa3b2);
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.ov-theme-swatch--active .ov-theme-swatch-name { color: var(--ov-text, #e7e9ee); }
.ov-theme-explore {
    display: block;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ov-accent, #7c5cff);
    text-decoration: none;
    padding: 0.3rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: color 0.12s;
}
.ov-theme-explore:hover { color: var(--ov-accent-2, #2dd4bf); text-decoration: underline; }
