/* ---------- Feeds tab: the advanced module feed viewer (wwwroot/js/feeds.js) ---------- */

.feed-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.feed-help {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
}

/* ---------- Module picker ---------- */
.feed-module-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.feed-module {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
    width: 100%;
    text-align: left;
    padding: 0.55em 0.8em;
    font-family: inherit;
    font-size: 1rem;
    color: #cfeef2;
    background-color: #10565e;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

    .feed-module:hover {
        background-color: #0a3d44;
        color: #ffffff;
    }

    .feed-module:focus-visible {
        outline: 2px solid var(--yellow);
        outline-offset: 1px;
    }

    .feed-module.active {
        border-color: var(--yellow);
        color: #ffffff;
    }

.feed-module-id {
    flex: none;
    font-size: 0.8em;
    opacity: 0.65;
    font-variant-numeric: tabular-nums;
}

.feed-module.active .feed-module-id {
    color: var(--yellow);
    opacity: 1;
}

/* An id typed by hand, for a module newer than the list above. */
.feed-other {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

    .feed-other label {
        display: block;
        margin-bottom: 0.4em;
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.75);
    }

.feed-other-row {
    display: flex;
    gap: 0.4rem;
}

#feed-other-id {
    flex: 1;
    min-width: 0;
    padding: 0.45em 0.6em;
    font-size: 1rem;
    font-family: inherit;
    color: #ffffff;
    background-color: #0a3d44;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
}

    #feed-other-id::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

    #feed-other-id:focus {
        outline: none;
        border-color: var(--yellow);
    }

/* ---------- Viewer ---------- */
.feed-viewer-head h3 {
    margin-bottom: 0.25rem;
}

/* The exact URL that produced what is below it -- so it can be pasted into a client, a curl, or a bug
   report without working it out from the module name. */
.feed-url {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    word-break: break-all;
    user-select: text;
    -webkit-user-select: text;
}

.feed-meta {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--yellow);
    font-variant-numeric: tabular-nums;
}

.feed-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.9rem 0;
}

.feed-btn {
    padding: 0.45em 1em;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    color: #cfeef2;
    background-color: #006975;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .feed-btn:hover:not(:disabled) {
        background-color: #00808e;
        color: #ffffff;
    }

    .feed-btn:focus-visible {
        outline: 2px solid var(--yellow);
        outline-offset: 1px;
    }

    .feed-btn:disabled {
        opacity: 0.45;
        cursor: default;
    }

/* Formatted / Raw sit together as one control, so they are joined rather than spaced. */
.feed-view-toggle {
    display: flex;
    margin-left: auto;
}

    .feed-view-toggle .feed-btn {
        border-radius: 0;
    }

        .feed-view-toggle .feed-btn:first-child {
            border-radius: 8px 0 0 8px;
        }

        .feed-view-toggle .feed-btn:last-child {
            border-radius: 0 8px 8px 0;
        }

        .feed-view-toggle .feed-btn.active {
            background-color: var(--yellow);
            color: #10565e;
        }

.feed-error {
    margin: 0 0 0.75rem 0;
    padding: 0.6em 0.85em;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #ffe3e3;
    background-color: #8a1c1c;
    border-radius: 8px;
}

.feed-json {
    margin: 0;
    padding: 1em;
    max-height: 60vh;
    overflow: auto;
    background-color: #072b30;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #d7ecef;
    /* Wrapped, not scrolled sideways: these feeds carry long authored copy, and one paragraph would
       otherwise push every line out of view. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    /* body sets user-select: none for the kiosk/tablet pages this stylesheet family is shared with;
       selecting the JSON is the whole point here. */
    user-select: text;
    -webkit-user-select: text;
}

/* Token colours from feeds.js (appendHighlightedJson). */
.feed-json .j-key {
    color: var(--yellow);
}

.feed-json .j-str {
    color: #9fe6c4;
}

.feed-json .j-num {
    color: #ffc98a;
}

.feed-json .j-lit {
    color: #7fd4ff;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .feed-grid {
        grid-template-columns: 1fr;
    }

    .feed-view-toggle {
        margin-left: 0;
    }
}
