/* Shared license UI: footer validity pill, first-run overlay, admin manager.
   Loaded by /user-sessions (recordings.html) and /picker (picker.html). Themed
   to work under [data-theme="light|dark"] and prefers-color-scheme. */

/* ---- Footer validity pill ---------------------------------------------- */
.license-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-secondary, #6b7280);
}
.license-status.is-clickable { cursor: pointer; }
.license-status.is-clickable:hover { text-decoration: underline; }
.license-status .lic-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: var(--lic-color, #6b7280);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lic-color, #6b7280) 22%, transparent);
}
.license-status[data-level="green"]  { --lic-color: #1f9d57; }
.license-status[data-level="yellow"] { --lic-color: #d98a00; color: #b87400; }
.license-status[data-level="red"]    { --lic-color: #d6336c; color: #c81e5b; }
/* "none" = limited mode (unlicensed / expired / invalid): neutral gray, not an
   error red — it's a degraded-but-running state, signalled plainly. */
.license-status[data-level="none"]   { --lic-color: #8a909c; color: var(--text-secondary, #6b7280); }
[data-theme="dark"] .license-status[data-level="yellow"] { color: #f0b429; }
[data-theme="dark"] .license-status[data-level="red"]    { color: #ff7ea2; }
[data-theme="dark"] .license-status[data-level="none"]   { --lic-color: #8b93a3; color: var(--text-secondary, #9aa3b2); }

/* ---- Overlay + card (first-run and manager share this shell) ----------- */
.lic-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 25, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10000;
}
.lic-card {
    background: #ffffff;
    color: #1a1d24;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    overflow: auto;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .lic-card { background: #1d2027; color: #e7e9ee; border-color: rgba(255, 255, 255, 0.08); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lic-card { background: #1d2027; color: #e7e9ee; border-color: rgba(255, 255, 255, 0.08); }
}
.lic-card h2 { margin: 0 0 6px; font-size: 19px; }
.lic-card .lic-sub { margin: 0 0 18px; font-size: 13px; color: var(--text-secondary, #6b7280); }
.lic-card label { display: block; font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.lic-card textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
    font-size: 12px;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(0, 0, 0, 0.02);
    color: inherit;
    box-sizing: border-box;
}
[data-theme="dark"] .lic-card textarea { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04); }

.lic-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.lic-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.lic-btn-primary { background: #2f6fed; color: #fff; }
.lic-btn-primary:hover { background: #2860d6; }
.lic-btn-ghost { background: transparent; border-color: rgba(0, 0, 0, 0.18); color: inherit; }
[data-theme="dark"] .lic-btn-ghost { border-color: rgba(255, 255, 255, 0.2); }
.lic-btn-danger { background: transparent; border-color: #d6336c; color: #c81e5b; }
[data-theme="dark"] .lic-btn-danger { color: #ff7ea2; }
.lic-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* status banner inside cards */
.lic-banner { border-radius: 9px; padding: 12px 14px; font-size: 13px; margin: 4px 0 0; }
.lic-banner[data-level="green"]  { background: rgba(31, 157, 87, 0.12); color: #14784a; }
.lic-banner[data-level="yellow"] { background: rgba(217, 138, 0, 0.14); color: #9a6300; }
.lic-banner[data-level="red"], .lic-banner[data-level="none"] { background: rgba(214, 51, 108, 0.12); color: #b21e54; }
[data-theme="dark"] .lic-banner[data-level="green"]  { color: #5bd99a; }
[data-theme="dark"] .lic-banner[data-level="yellow"] { color: #f0b429; }
[data-theme="dark"] .lic-banner[data-level="red"], [data-theme="dark"] .lic-banner[data-level="none"] { color: #ff7ea2; }
.lic-error { color: #c81e5b; font-size: 13px; margin-top: 10px; min-height: 16px; }
[data-theme="dark"] .lic-error { color: #ff7ea2; }

/* license list (manager) */
.lic-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lic-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
[data-theme="dark"] .lic-item { border-color: rgba(255, 255, 255, 0.1); }
.lic-item.is-active { border-color: #1f9d57; background: rgba(31, 157, 87, 0.06); }
.lic-item .lic-meta { flex: 1; min-width: 0; }
.lic-item .lic-meta .lic-id { font-weight: 600; font-size: 13px; word-break: break-all; }
.lic-item .lic-meta .lic-detail { font-size: 12px; color: var(--text-secondary, #6b7280); margin-top: 3px; }
.lic-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.lic-badge.active { background: #1f9d57; color: #fff; }
.lic-badge.inactive { background: rgba(0, 0, 0, 0.08); color: var(--text-secondary, #6b7280); }
[data-theme="dark"] .lic-badge.inactive { background: rgba(255, 255, 255, 0.1); }
.lic-card .lic-close { float: right; cursor: pointer; border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--text-secondary, #6b7280); }
