/* Share popup module (see share.js). Dark "glass" language carried over
   from the marzipano popups it replaced: translucent surface, backdrop
   blur, hairline border, rounded corners, system font. All selectors are
   namespaced share-* so the module can sit in any viewer. */

.share-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    margin: 0;
    box-sizing: border-box;
    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);
}

.share-popup__msg {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.85);
}

/* Private-project warning. Deliberately loud (amber on the dark glass):
   the link works only for the project's owners and its users / groups,
   not for everyone. share.js unhides it when the page provides the
   privateNotice string (see _share_init.html). */
.share-popup__notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 14px;
    padding: 10px 12px;
    text-align: left;
    font-size: 12.5px;
    line-height: 1.45;
    color: #ffd27f;
    background: rgba(255, 174, 32, 0.14);
    border: 1px solid rgba(255, 174, 32, 0.5);
    border-radius: 9px;
}
.share-popup__notice svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.share-popup__url {
    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;
    /* URLs are one long token: fill each line fully and break at any
       character instead of at word-break opportunities (-, etc.), which
       leaves ragged short lines. */
    word-break: break-all;
    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;
}
.share-popup__url:focus-visible {
    outline: none;
    border-color: #e8e8ec;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

/* Optional alternate-URL checkbox (e.g. "Start at 1:23"); share.js shows it
   only when the caller passes opts.toggle to SharePopup.open(). */
.share-popup__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.share-popup__toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #e8e8ec;
    cursor: pointer;
}

/* Action icons (copy / QR) — square hover chips. */
.share-popup__btn {
    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;
}
.share-popup__btn: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. */
.share-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    box-sizing: content-box;
    width: 16px;
    height: 16px;
    padding: 6px;
    border-radius: 9px;
    cursor: pointer;
    opacity: 0.65;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}
.share-popup__close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Lazily-loaded QR code, toggled by the qr-code chip. White backing pad
   keeps the code scannable on the dark glass even before the PNG loads. */
.share-popup__qr {
    display: none;
    margin: 4px auto 10px;
}
.share-popup__qr img {
    display: block;
    box-sizing: content-box;
    width: 200px;
    height: 200px;
    margin: 0 auto;
    padding: 8px;
    background: #fff;
    border-radius: 10px;
}

/* Share channels (email / WhatsApp / Telegram) — same chips, hairline
   divider above. */
.share-popup__channels {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.share-popup__channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    margin: 0 3px;
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.share-popup__channel:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}
.share-popup__channel img {
    width: 22px;
    height: 22px;
    display: block;
}

/* Transient toast ("Copied to clipboard") — bottom-centre. */
.share-toast {
    position: fixed;
    left: 50%;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) translateY(8px);
    z-index: 10010;
    max-width: 90vw;
    padding: 10px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: #e8e8ec;
    white-space: nowrap;
    background: rgba(24, 24, 27, 0.9);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
}
.share-toast--show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0s;
}
/* Marzipano only: while its mobile action menu is open the bottom tray sits
   at ~70–112px; lift the toast above it (no-op in other viewers, where the
   body class never appears). */
.action-menu-open .share-toast {
    bottom: calc(124px + env(safe-area-inset-bottom, 0px));
}
