/* Website demo layer for hype-dispatch. Loaded after the NUI's style.css and only used on hypescripts.net/demo/dispatch. */

:root {
    --demo-bg-base: rgba(10, 10, 10, 0.8);
    --demo-bg-surface: #0f0f0f;
    --demo-bg-muted: #1a1a1a;
    --demo-bg-active: #2a2a2a;
    --demo-border: #1f1f1f;
    --demo-text: #ffffff;
    --demo-muted: #a3a3a3;
    --demo-faint: #8a8a8a;
    --demo-toolbar: 64px;
}

/* In game the UI floats over the game, here it floats over a screenshot */
html,
body {
    height: 100%;
}
body {
    background: #0a0a0a url('/demos/dispatch/backdrop.webp') center / cover no-repeat;
}
body::before {
    /* Slight vignette so the cards read well on any part of the image */
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.05) 40%, rgba(0, 0, 0, 0.35)), linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 30%);
    pointer-events: none;
}

/* Keep the alert column clear of the toolbar */
#alerts {
    top: calc(var(--demo-toolbar) + 4vh);
    z-index: 1;
}
@media (max-width: 400px) {
    #alerts {
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* The respond hint on the newest card is clickable in the demo (Y in game) */
.alert:not(.responding) .respond {
    cursor: pointer;
}
.alert:not(.responding) .respond:hover .key {
    background: rgba(255, 255, 255, 0.16);
}

/* ---------- Toolbar ---------- */
#demo-toolbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--demo-toolbar);
    padding: 0 20px;
    border-bottom: 1px solid var(--demo-border);
    background: var(--demo-bg-base);
    backdrop-filter: blur(4px);
    font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}
#demo-toolbar svg {
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.demo-back {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--demo-muted);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.demo-back svg {
    width: 16px;
    height: 16px;
}
.demo-back:hover {
    background: var(--demo-bg-muted);
    color: var(--demo-text);
}
.demo-tabs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid var(--demo-border);
    border-radius: 6px;
    background: var(--demo-bg-surface);
}
.demo-tab {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--demo-muted);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.demo-tab svg {
    width: 14px;
    height: 14px;
}
.demo-tab:hover {
    background: var(--demo-bg-muted);
    color: var(--demo-text);
}
.demo-tab.active {
    background: var(--demo-bg-active);
    color: var(--demo-text);
}
.demo-name {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--demo-faint);
}
@media (max-width: 767px) {
    #demo-toolbar {
        padding: 0 16px;
    }
    .demo-tab span {
        display: none;
    }
}
@media (max-width: 1023px) {
    .demo-name {
        display: none;
    }
}

/* ---------- Respond view: instruction card ---------- */
#demo-hint {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 420px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
}
#demo-hint[hidden] {
    display: none;
}
#demo-hint .key {
    min-width: 34px;
    height: 34px;
    font-size: 15px;
}
#demo-hint b {
    display: block;
    font-size: 13px;
    font-weight: 700;
}
#demo-hint p {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--muted);
}
@media (max-width: 600px) {
    #demo-hint {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ---------- Respond confirmation (in game this is your notify resource) ---------- */
#demo-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 4px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
#demo-toast.shown {
    opacity: 1;
    transform: translate(-50%, 0);
}
#demo-toast svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #4ade80;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#demo-toast small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}
body.view-respond #demo-toast {
    bottom: 112px;
}
@media (max-width: 600px) {
    #demo-toast {
        white-space: normal;
        width: calc(100% - 32px);
    }
    body.view-respond #demo-toast {
        bottom: 150px;
    }
}

/* ---------- Stage ---------- */
/* Clips the off-screen (entering / leaving) cards, otherwise mobile browsers widen the layout viewport */
#demo-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
}
