/* Marzipano right sidebar (#info) + scene-list grouping styles.
   The legacy SVG infoMap widget has been removed; everything related to
   it (#infoMapSVG, #infoMap.fullScreen, #mapCloseButton, .mapControls,
   .mapCheckbox, #resize-handle*, fullScreen layout overrides) is gone. */

#infoToggle {
    width: 40px;
    height: 40px;
    padding: 8px;
    color: #fff;
}

#infoToggle .icon {
    display: block;
    width: 24px;
    height: 24px;
}

/* ── Right slide-out panel (#info) ────────────────────────────────────
   Modern dark "glass" surface. The .enabled class (toggled by index-
   single-res.js) drives the slide-in. Width is still overridable via the
   --info-width custom property for any per-project tweaks. */
#info {
    --info-width: 320px;
    --info-accent: #e8e8ec;
    position: absolute;
    right: 0;
    top: 40px;
    width: var(--info-width);
    max-height: calc(100% - 40px);
    max-block-size: -webkit-fill-available;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(calc(var(--info-width) + 24px));
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    /* Above the bottom controls (tray 1000, expanded action menu 1001) so the
       panel covers them wherever they overlap. Stays below the toast (1100)
       and the high modals (jpgPopover 11000). */
    z-index: 1002;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    scrollbar-width: thin;
}
#info.enabled {
    transform: translateX(0);
}

#infos {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 16px 20px;
    background: rgba(24, 24, 27, 0.78);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 14px;
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.35);
    color: #e8e8ec;
}

/* Panel title */
.info-header {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding-bottom: 4px;
}

/* Owner-only hint under the title — pulled up so it reads as a subtitle
   despite the panel's flex gap. */
.info-note {
    margin: -12px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.5);
}

/* Logical group inside the panel */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* A stacked group of controls; direct button children stretch full-width */
.info-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* On mobile the settings panel keeps the desktop card shape (320px-wide,
   cropped to its content, rounded bottom-left corner) instead of a full-screen
   sheet — it holds only a handful of controls, so full-screen would be mostly
   empty. (#sceneList still goes full-screen on mobile: it's a long list.) */

/* Action-bar buttons (#shareButton, #commentButton) come from
   _action_buttons.html. */
#shareButton {
    display: flex;
    align-items: center;
    justify-content: center;
}
#shareButton img {
    width: 32px;
}

/* Centered popups (#sharePopup, #commentPopup, #setNorthPopup) — share the
   dark "glass" language of the right panel (#infos): translucent surface with
   backdrop blur, hairline border, rounded corners, system font. */
.sharePopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    margin: 0;
    box-sizing: border-box;
    max-width: min(92vw, 380px);
    padding: 26px 22px 18px;
    text-align: center;
    color: #e8e8ec;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: rgba(24, 24, 27, 0.82);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sharePopup p {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.85);
}

.sharePopup textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    resize: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    color: #f4f4f6;
    font: inherit;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sharePopup textarea:focus-visible {
    outline: none;
    border-color: #e8e8ec;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

/* Action icons (copy / QR) — square hover chips. */
.sharePopup img {
    box-sizing: content-box;
    width: 24px;
    height: 24px;
    margin: 0 3px;
    padding: 7px;
    border-radius: 9px;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.15s ease;
}
.sharePopup img:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Close (×) — pinned to the top-right corner. */
.sharePopup img[src$="x-lg.svg"] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    padding: 6px;
    opacity: 0.65;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}
.sharePopup img[src$="x-lg.svg"]:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

#commentButton {
    display: flex;
    align-items: center;
    justify-content: center;
}
#commentButton img {
    width: 32px;
}

/* Floating context menu — admin link/disable on link spheres
   (#context-menu). Visually matches AppMap's `.appmap-contextmenu`
   so both menus feel like the same control. */
.context-menu {
    position: absolute;
    display: none;
    z-index: 101;
    min-width: 200px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.10);
    font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}
.context-menu-item {
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 100ms ease;
}
.context-menu-item:hover {
    background: #f1f5f9;
}

.standardButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 14px;
    color: #f4f4f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background-color: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                transform 0.05s ease;
}
.standardButton:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.22);
}
.standardButton:active {
    transform: translateY(1px);
}
/* an icon before the text (the start-view button) */
.standardButton > img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}
.standardButton:focus-visible {
    outline: none;
    border-color: var(--info-accent, #e8e8ec);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}
/* Disabled — the sun-north button when the project has no CRS, plus the
   transient busy state (text swapped to "…") during a standardButton POST. The
   click itself is blocked in JS (guard on the .disabled class); no
   pointer-events:none here so the "why" tooltip still shows on hover. The
   attribute form is the comment form's Create button while a note and its
   attachments are being sent (index-single-res.js: saveCommentToServer). */
.standardButton.disabled,
.standardButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.standardButton.disabled:hover,
.standardButton:disabled:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}
.standardButton.disabled:active,
.standardButton:disabled:active {
    transform: none;
}

/* Set-North row: button + info icon + "show arrow" checkbox on one line. */
.info-setnorth {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.info-setnorth .standardButton {
    flex: 0 0 auto;
}
#setNorthInfoIcon,
#sunNorthInfoIcon {
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}
#setNorthInfoIcon:hover,
#sunNorthInfoIcon:hover {
    opacity: 1;
}

/* The sun-north instructions popup carries a bulleted requirements list, so it
   reads left-aligned and may need to scroll on short viewports. */
#sunNorthPopup {
    text-align: left;
    max-width: min(92vw, 420px);
    max-height: 80vh;
    overflow-y: auto;
}
#sunNorthPopup ul {
    margin: 0 0 14px;
    padding-left: 18px;
    color: rgba(255, 255, 255, 0.85);
}
#sunNorthPopup li {
    margin: 4px 0;
}

/* Custom checkbox label. */
.info-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}
.info-check input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background-color: rgba(255, 255, 255, 0.06);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.info-check input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.5);
}
.info-check input[type="checkbox"]:checked {
    background-color: var(--info-accent, #e8e8ec);
    border-color: var(--info-accent, #e8e8ec);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231a1a1d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.5 3.5L13 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px;
}
.info-check input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
}

/* Scene-list sitemap-group accordion. */
.sitemapName {
    font-weight: bold;
    line-height: 30px;
    padding: 0 0 0 1.5em;
    background-color: rgb(191,67,66);
    background-color: rgba(191,67,66,0.75);
}
div.sitemapList {
    position: relative;
}
summary {
    cursor: pointer;
    position: absolute;
    top: 7px;
    left: 7px;
}
