/* Dark-first minimal styling shared by all pages. Page-specific styling belongs to the
   page owners; keep this file to layout primitives and the landing page. */

:root {
    color-scheme: dark;
    --bg: #14161a;
    --surface: #1d2026;
    --surface-hover: #23272f;
    --border: #2e333c;
    --text: #e6e8eb;
    --text-dim: #9aa1ab;
    --accent: #4da3ff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

#app { height: 100%; }

h1 { font-weight: 600; }

a { color: var(--accent); }

.boot-splash {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.placeholder, .not-found { color: var(--text-dim); }

/* Landing page */

.landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    text-align: center;
}

.landing-logo {
    width: 88px;
    height: 88px;
    margin-bottom: 0.75rem;
    /* The mark's white canvas corners stand out on the dark theme — round them off. */
    border-radius: 20px;
}
.landing-header h1 { margin: 0 0 0.25rem; font-size: 2.2rem; }
.landing-header .tagline { margin: 0; color: var(--text-dim); }

.cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    display: block;
    width: 20rem;
    max-width: 90vw;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.card:hover { background: var(--surface-hover); border-color: var(--accent); }
.card-icon { font-size: 2rem; }
.card h2 { margin: 0.5rem 0; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.4; }

.landing-footer { color: var(--text-dim); font-size: 0.8rem; }

/* ---------------------------------------------------------------------------
   Application shell (Layout/MainLayout.razor)
   A slim collapsible left sidebar owns navigation, page-injected session controls,
   and the signed-in user. There is no top bar. The content area fills the rest of
   the window; the viewer collapses its padding (body.viewer-active) to go full-bleed.
   --------------------------------------------------------------------------- */

.app-shell {
    display: flex;
    height: 100%;
    min-height: 0;
}

.sidebar {
    flex: 0 0 15rem;
    width: 15rem;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow: hidden;
    transition: flex-basis 0.15s ease, width 0.15s ease;
}

.app-shell.collapsed .sidebar {
    flex-basis: 3.5rem;
    width: 3.5rem;
}

/* Brand / collapse toggle — the ScreenSharePro logo doubles as the show/hide-sidebar control. */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.85rem 0.85rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.sidebar-brand:hover { background: var(--surface-hover); }

.sidebar-logo {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px; /* soften the mark's white canvas corners on dark */
}

.sidebar-wordmark { font-weight: 600; font-size: 1.05rem; white-space: nowrap; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    gap: 0.15rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.95rem;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--surface-hover); color: var(--text); }

.nav-item.active {
    color: var(--text);
    background: var(--surface-hover);
    border-left-color: var(--accent);
}

.nav-icon { flex: 0 0 1.25rem; font-size: 1.1rem; text-align: center; }

/* Page-injected controls (SectionOutlet "SidebarControls"). */
.sidebar-controls:not(:empty) {
    padding: 0.75rem 0.85rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--border);
}

.sidebar-spacer { flex: 1 1 auto; min-height: 0.5rem; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border);
}

.user-avatar {
    flex: 0 0 1.9rem;
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #0d1117;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-email {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.user-signout {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.05rem;
    padding: 0.2rem 0.35rem;
    border-radius: 6px;
}

.user-signout:hover { color: #ff9b96; background: var(--surface-hover); }

/* Collapsed rail: hide every label, keep icons centred, drop injected controls. */
.app-shell.collapsed .sidebar-wordmark,
.app-shell.collapsed .nav-label,
.app-shell.collapsed .sidebar-controls,
.app-shell.collapsed .user-email,
.app-shell.collapsed .user-signout { display: none; }

.app-shell.collapsed .sidebar-brand { justify-content: center; padding: 0.85rem 0; }
.app-shell.collapsed .nav-item { justify-content: center; padding: 0.55rem 0; gap: 0; }
.app-shell.collapsed .sidebar-user { justify-content: center; padding: 0.75rem 0; }

/* Content area — fills the rest of the window; pages provide their own inner layout. */
.shell-content,
.bare-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.shell-content { padding: 1.75rem 1.5rem; }

.bare-content { align-items: center; justify-content: center; padding: 2rem 1.5rem; }

/* Viewer full-bleed: while a session is on screen the content padding collapses so the
   video claims the whole content area (toggled by Viewer.razor via body.viewer-active). */
body.viewer-active .shell-content { padding: 0; overflow: hidden; }

/* Responsive: on narrow screens the sidebar auto-collapses to the icon rail. */
@media (max-width: 640px) {
    .sidebar { flex-basis: 3.5rem; width: 3.5rem; }
    .sidebar-wordmark,
    .nav-label,
    .sidebar-controls,
    .user-email,
    .user-signout { display: none; }
    .shell-content { padding: 1rem; }
}

/* Login page (Pages/Login.razor) */

.login-page {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-intro { color: var(--text-dim); line-height: 1.5; margin: 0; }

.login-error {
    padding: 0.6rem 0.9rem;
    background: #3a2322;
    border: 1px solid #6e3b38;
    border-radius: 8px;
}

.login-form { display: flex; flex-direction: column; gap: 0.9rem; }

.login-field { display: flex; flex-direction: column; gap: 0.3rem; }
.login-field span { font-size: 0.8rem; color: var(--text-dim); }

.login-field input {
    font: inherit;
    padding: 0.5rem 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}

.login-field input:focus { outline: none; border-color: var(--accent); }

.login-form .btn,
.login-actions .btn {
    font: inherit;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.login-form .btn-primary,
.login-actions .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0d1117;
    font-weight: 600;
}

.login-form .btn:disabled { opacity: 0.6; cursor: default; }

.login-switch { color: var(--text-dim); font-size: 0.9rem; }
.login-done p { margin: 0 0 0.6rem; }
.login-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.login-stable-id { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: 0.06em; }

/* Blazor error bar (kept dark) */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    background: #5c2b29;
    color: var(--text);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Admin pages (3.0.16) — the first administrative screen in the product.
   Reuses the existing dark palette variables rather than introducing a second
   theme; an admin screen that looks like a different product is how operators
   end up unsure which environment they are editing.
   --------------------------------------------------------------------------- */
.admin-page { max-width: 1100px; padding: 1.5rem; }
.admin-page h1 { margin: 0 0 0.5rem; }
.admin-page h2 { margin: 2rem 0 0.75rem; font-size: 1.1rem; }
.admin-intro { color: var(--text-dim); margin-bottom: 1.25rem; }
.admin-loading { color: var(--text-dim); }

.admin-notice,
.admin-error,
.admin-status {
    padding: 0.7rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 1rem;
}
.admin-notice p:last-child { margin-bottom: 0; }
/* Amber, not red: a STUN-only fleet is degraded, not broken. */
.admin-notice-warn { background: #3a3322; border-color: #6e5f38; }
.admin-error { background: #3a2322; border-color: #6e3b38; }
.admin-status { background: #223a2a; border-color: #386e47; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.admin-table th { color: var(--text-dim); font-weight: 600; }
.admin-table code { color: var(--accent); }
/* Disabled rows stay legible but obviously inert — they are kept for rollback. */
.admin-row-disabled { opacity: 0.55; }
.admin-row-actions { white-space: nowrap; }

.admin-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}
.admin-tag-ok  { color: #7fd396; border-color: #386e47; }
.admin-tag-bad { color: #ff9b93; border-color: #6e3b38; }

/* Uninstall-feedback star rating (admin/uninstall-feedback). */
.fb-stars { color: #f5b301; letter-spacing: 1px; white-space: nowrap; }

.admin-form { display: flex; flex-direction: column; gap: 0.85rem; max-width: 520px; }
.admin-field { display: flex; flex-direction: column; gap: 0.3rem; }
.admin-field > span { color: var(--text-dim); font-size: 0.9rem; }
.admin-field input,
.admin-field textarea {
    font: inherit;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}
.admin-field textarea { resize: vertical; font-family: ui-monospace, monospace; }
.admin-field-inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.admin-field-inline input { width: auto; }
.admin-hint { color: var(--text-dim); font-style: italic; font-size: 0.85rem; margin-left: 0.4rem; }

.admin-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.admin-page .btn {
    font: inherit;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    text-decoration: none;
}
.admin-page .btn:hover:not(:disabled) { background: var(--surface-hover); }
.admin-page .btn:disabled { opacity: 0.5; cursor: default; }
.admin-page .btn-primary { border-color: var(--accent); color: var(--accent); }
.admin-page .btn-small { padding: 0.25rem 0.55rem; font-size: 0.85rem; }
.admin-page .btn-danger { border-color: #6e3b38; color: #ff9b93; }

.admin-footnote {
    margin-top: 1.75rem;
    color: var(--text-dim);
    font-size: 0.88rem;
    max-width: 70ch;
}
