/* shared.css — common colours, typography and utility classes for all playback pages */

:root {
    --color-bg: #111;
    --color-surface: #1a1a1a;
    --color-border: #2e2e2e;
    --color-text: #ddd;
    --color-text-dim: #b6ced8;
    --color-text-bright: #eee;

    --color-danger: #be2323;
    --color-danger-hover: #d42c2c;
    --color-success: rgba(30, 130, 60, 0.85);
    --color-warning: rgba(160, 80, 0, 0.85);
    --color-disabled-bg: #2a2a2a;
    --color-disabled-fg: #666;

    --color-detect-default: rgba(148, 67, 67, 0.72);
    --color-detect-person: rgba(0, 175, 195, 0.72);
    --color-detect-vehicle: rgba(180, 140, 15, 0.72);

    --dot-person: #00afc3;
    --dot-vehicle: #b48c0f;
    --dot-default: #be2323;

    --radius-sm: 4px;
    --radius-md: 6px;
}

body {
    font-family: Arial, sans-serif;
}

/* ── Shared action button states ── */
.action-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.03em;
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s, opacity 0.15s;
}

.action-btn.state-hidden {
    display: none;
}

.action-btn.state-disabled {
    display: block;
    background: var(--color-disabled-bg);
    color: var(--color-disabled-fg);
    cursor: not-allowed;
}

.action-btn.state-enabled {
    display: block;
    background: var(--color-danger);
    color: #fff;
    cursor: pointer;
}

.action-btn.state-enabled:hover {
    background: var(--color-danger-hover);
}

.action-btn.state-success {
    display: block;
    background: var(--color-success);
    color: #fff;
    cursor: default;
}

.action-btn.state-error {
    display: block;
    background: var(--color-warning);
    color: #fff;
    cursor: pointer;
}

/* ── Detection class colour dots ── */
.detect-icon {
    font-size: 1.1em;
    margin-right: 0.25em;
    vertical-align: middle;
    line-height: 1;
}

.detect-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot-default);
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

.detect-dot.class-person {
    background: var(--dot-person);
}

.detect-dot.class-vehicle {
    background: var(--dot-vehicle);
}

/* ── Fixed live-nav overlay (top-right, prominent) ── */
.live-nav {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    display: none;
    /* shown via JS once JWT is decoded */
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.live-nav.visible {
    display: flex;
}

.live-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
    border: 1.5px solid transparent;
}

.live-nav a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    filter: brightness(1.12);
}

.live-nav a:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* LIVE button — teal */
.live-nav a.nav-live {
    background: rgba(0, 175, 195, 0.18);
    border-color: #00afc3;
    color: #00e5ff;
}

/* LIVE+AI button — purple/indigo gradient */
.live-nav a.nav-live-ai {
    background: linear-gradient(135deg, rgba(120, 60, 220, 0.25), rgba(0, 175, 195, 0.20));
    border-color: #391d77;
    color: #6531c5;
}

/* Pulsing red dot for LIVE button */
.live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b3b;
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    animation: live-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    }

    60% {
        box-shadow: 0 0 0 7px rgba(255, 59, 59, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
    }
}

/* Keep page-nav for live.html back-nav (not removed) */
.page-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    max-width: max(90%, 1280px);
    justify-content: flex-end;
}

.page-nav a,
.page-nav button {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.12s, border-color 0.12s;
}

.page-nav a:hover,
.page-nav button:hover {
    background: #252525;
    border-color: #484848;
}

.page-nav a.nav-live {
    border-color: #00afc3;
    color: #00afc3;
}

.page-nav a.nav-live:hover {
    background: rgba(0, 175, 195, 0.12);
}