/* =============================================================================
 * page.css - Voice Studio local overrides.
 *
 * Header / sidebar / status pill blocks are mirrored verbatim from
 * AI_ASR_Server/app/static/asr-page.css. Do not adjust values here without
 * updating the reference too.
 *
 * Rules:
 *  - No hex literals. Colors come from sc-extension-theme.css variables.
 *  - Local additions are namespaced under .vs-* and only style content
 *    inside individual page modules.
 * ===========================================================================*/


/* ============ Header / brand / status pill (mirrors reference) ============ */

.asr-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-input);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--shadow);
}
.asr-status-label   { font-weight: 600; color: var(--text-primary); }
.asr-status-meta    { color: var(--text-muted); }
.asr-status-sep     { display: inline-block; width: 4px; height: 4px;
                      border-radius: 50%; background: var(--text-muted); }
.asr-status-dot--ok   { color: var(--accent-success); font-size: 14px; }
.asr-status-dot--down { color: var(--accent-danger);  font-size: 14px; }

.asr-brand {
    display: flex;
    align-items: center;
    height: 64px;
    padding-left: 16px;
    gap: 12px;
}
.asr-brand-logo { height: 36px; width: 36px; flex: 0 0 36px; }
.asr-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.asr-brand-product {
    font-size: 19px;
    font-weight: 700;
    color: var(--accent-success);
    letter-spacing: 0.2px;
}
.asr-brand-owner {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.3px;
}


/* ============ Sidebar (mirrors reference) ================================= */

.asr-menu-icon {
    display: inline-block;
    width: 24px;
    text-align: center;
    margin-right: 12px;
    color: var(--text-muted);
    font-size: 18px;
    vertical-align: middle;
    transition: color 0.15s ease;
}
.asr-menu-label {
    vertical-align: middle;
    font-size: 14px;
    color: var(--text-primary);
    transition: color 0.15s ease;
}
.asr-sidebar-list .webix_list_item { position: relative; }
.asr-sidebar-list .webix_list_item::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: transparent;
    transition: background 0.15s ease;
}
.asr-sidebar-list .webix_list_item:hover::before,
.asr-sidebar-list .webix_list_item.webix_selected::before {
    background: var(--sc-primary);
}
.asr-sidebar-list .webix_list_item:hover .asr-menu-icon,
.asr-sidebar-list .webix_list_item.webix_selected .asr-menu-icon {
    color: var(--sc-primary) !important;
}
.asr-sidebar-list .webix_list_item:hover .asr-menu-label,
.asr-sidebar-list .webix_list_item.webix_selected .asr-menu-label {
    color: var(--accent-success) !important;
    font-weight: 600;
}


/* ============ Typography (mirrors reference) ============================== */

.asr-h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 8px 0 12px 0;
    color: var(--text-primary);
}
.asr-h2 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    margin: 4px 0 8px 0;
    color: var(--text-primary);
}
.asr-h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin: 16px 0 6px 0;
    color: var(--text-primary);
}
.asr-lead {
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 16px 0;
    color: var(--text-primary);
    max-width: 820px;
}
.asr-body {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    max-width: 820px;
}
.asr-page {
    padding: 24px;
}
.asr-page code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
}
.asr-page a { color: var(--accent-primary); }


/* ============ Voice Studio cards / sections (page-local) ================== */

.vs-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}
.vs-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
}
.vs-section { padding: 0; }
.vs-toolbar-flat {
    background: transparent !important;
    border: none !important;
}
.vs-hint {
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 0 8px 0;
}
.vs-hint code {
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 3px;
}

/* status card on Home */
.vs-status-card .vs-status-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.vs-status-icon { font-size: 28px; }
.vs-status-label { font-size: 16px; font-weight: 600; }
.vs-status-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.vs-state-ok      .vs-status-icon { color: var(--accent-success); }
.vs-state-warming .vs-status-icon { color: var(--accent-info); }
.vs-state-error   .vs-status-icon { color: var(--accent-danger); }
.vs-state-idle    .vs-status-icon { color: var(--text-muted); }

/* key-value details */
.vs-kv {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
.vs-kv td {
    padding: 6px 8px;
    border-bottom: 1px dashed var(--border-color);
}
.vs-kv td:first-child {
    color: var(--text-muted);
    width: 36%;
}


/* ============ Generate page =============================================== */

.vs-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}
.vs-section-title .sci {
    color: var(--accent-success);
    font-size: 18px;
}

.vs-phase {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.vs-phase-running .sci { color: var(--accent-info); }
.vs-phase-done    .sci { color: var(--accent-success); }
.vs-phase-error   .sci { color: var(--accent-danger); }
.vs-phase-idle    { color: var(--text-muted); }

.vs-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}
.vs-result-meta strong {
    color: var(--text-muted);
    margin-right: 4px;
    font-weight: 500;
}

.vs-audio-host { padding: 8px 0; }
.vs-audio-host audio { width: 100%; outline: none; }


/* ============ Voices page ================================================= */

.vs-cache-ok   { color: var(--accent-success); }
.vs-cache-miss { color: var(--text-muted); }


/* ============ Monitor page ================================================ */

.vs-procs {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.vs-procs th, .vs-procs td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}
.vs-procs th {
    color: var(--text-muted);
    font-weight: 500;
}
.vs-tag {
    display: inline-block;
    background: var(--sc-primary);
    color: var(--text-primary);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    margin-left: 4px;
}
.vs-chart-card {
    padding: 8px 12px;
    height: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.vs-chart-canvas {
    width: 100%;
    height: 100%;
    display: block;
}


/* ============ API Reference page ========================================== */

.vs-iframe-host {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-primary);
}


/* ============ Login screen — SoftCreator branded background ================ */

/* The background lives on <body>; Webix root layout renders transparent so
   the body image shows through. SCLoginSkeleton.show() paints a centred
   modal scwindow over this canvas. */

html, body { height: 100%; min-height: 100%; }

/* Body background uses theme variables that auto-switch in dark mode.
   Mirrors .background-login-wrapper from shared sc-extension-theme.css:
   wave PNG layered on top of brand-coloured gradient, no blend-mode. */
body.vs-login-page {
    background-image:
        var(--login-bg-image),
        linear-gradient(135deg, var(--login-bg-gradient-start), var(--login-bg-gradient-end));
    background-size: cover, auto;
    background-position: center center, center center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
    background-color: var(--login-bg-color);
}

body.vs-login-page .webix_view,
body.vs-login-page .webix_layout,
body.vs-login-page .webix_layout_line,
body.vs-login-page .webix_toolbar {
    background: transparent !important;
}
body.vs-login-page .vs-login-header,
body.vs-login-page .vs-login-header * {
    background: transparent !important;
    border: none !important;
}

/* Custom login modal — uses theme bg-secondary so it inverts in dark. */
.webix_window.vs-login-modal {
    border-radius: 12px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35) !important;
    overflow: hidden;
    background: var(--bg-secondary) !important;
}
.webix_window.vs-login-modal .webix_view {
    background: transparent !important;
}

/* Title row inside the modal body. */
.vs-login-title-tpl {
    text-align: center;
    padding: 18px 16px 8px 16px;
}
.vs-login-title-tpl .vs-login-title-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 700;
    color: var(--accent-success);
}
.vs-login-title-tpl .vs-login-title-row img {
    height: 26px;
    width: 26px;
}
