/* ================================================================
   PROJECT MEMORY — theme-clean-media-scroll.css
   Full-screen vertical media scroll viewer and fullscreen photo overlay.
   Extracted from theme-clean-memory-view.css for size management.
   Depends on: theme-clean.css (tokens)
   ================================================================ */

/* === MEDIA SCROLL VIEWER === */

/**
 * @pm-registry
 * @type css
 * @name pm-media-scroll-viewer
 * @description Full-screen vertical scroll overlay for viewing all memory media.
 *   Photos and videos stack top-to-bottom; X button pinned at top-right.
 * @called-by  none found
 * @depends-on none
 * @tags        TODO
 * @updated 2026-04-26
 */
#pm-media-scroll-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--pm-z-modal, 700) + 20);
    background: var(--pm-text-1);
    flex-direction: column;
}

#pm-media-scroll-viewer.pm-active {
    display: flex;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-media-scroll-close
 * @tags        themes
 * @description Styles a circular, top-right close button for the media scroller, with a semi-transparent and blurred background.
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-media-scroll-close {
    position: absolute;
    top: calc(14px + var(--pm-safe-top, 10px));
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--pm-overlay-white-faint);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--pm-panel-surface);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.pm-media-scroll-close:hover {
    background: var(--pm-overlay-white-soft);
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-media-scroll-body
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-media-scroll-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 56px;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-media-scroll-item
 * @tags        themes
 * @description Styles an individual item within the media scroller, ensuring it has full width and consistent horizontal padding.
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-media-scroll-item {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-photo-wrap
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-scroll-photo-wrap {
    position: relative;
    display: block;
    cursor: zoom-in;
}

.pm-scroll-photo-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--pm-radius-small);
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-photo-expand
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-scroll-photo-expand {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: var(--pm-radius-xsmall);
    border: none;
    background: var(--pm-overlay-dark-mid);
    color: var(--pm-panel-surface);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.pm-media-scroll-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--pm-radius-small);
}

.pm-media-scroll-item video {
    width: 100%;
    height: auto;
    display: block;
    background: var(--pm-text-1);
    max-height: 80vh;
    border-radius: var(--pm-radius-small);
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-video-wrap
 * @tags        themes
 * @description Wrapper for inline scroll-viewer videos. Displays a tap-to-play poster with play button
 *              instead of native controls — prevents Android WebView native overlay (GSOA).
 * @called-by   pmMemoryViewComponent.js (pmViewOpenLightbox)
 * @depends-on  none
 * @updated     2026-05-24
 */
.pm-scroll-video-wrap {
    position: relative;
    background: #000;
    border-radius: var(--pm-radius-small);
    overflow: hidden;
    cursor: pointer;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-scroll-video-wrap video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    display: block;
    border-radius: var(--pm-radius-small);
}

.pm-scroll-video-play {
    position: absolute;
    font-size: 3rem;
    color: rgba(255,255,255,0.85);
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-media-scroll-item-doc
 * @tags        themes
 * @description Styles a document item within the media scroller, applying padding and a pointer cursor to indicate it is clickable.
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-media-scroll-item-doc {
    padding: 10px 20px;
    cursor: pointer;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-doc-card
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-scroll-doc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    background: var(--pm-overlay-white-faint);
    border-radius: var(--pm-radius-small);
    transition: background 0.15s;
}

.pm-media-scroll-item-doc:active .pm-scroll-doc-card {
    background: var(--pm-overlay-white-faint);
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-doc-icon
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-scroll-doc-icon {
    font-size: 52px;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-scroll-doc-name
 * @tags        themes
 * @description Styles the name of a document within the media scroller with specific font size, color, weight, and text alignment.
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-scroll-doc-name {
    font-size: 0.9rem;
    color: var(--pm-overlay-white-strong);
    font-weight: 500;
    text-align: center;
    word-break: break-all;
}

/**
 * @pm-registry
 * @prefix      pm
 * @type        css-class
 * @name        pm-media-scroll-label
 * @tags        themes
 * @description TODO
 * @called-by  none found
 * @depends-on none
 * @updated     2026-05-03
 */
.pm-media-scroll-label {
    padding: 6px 12px 8px;
    font-size: 0.75rem;
    color: var(--pm-overlay-white-mid);
    background: var(--pm-dark-bg);
}

/* === SCROLL VIEWER — FULLSCREEN PHOTO === */

/**
 * @pm-registry
 * @type css
 * @name pm-scroll-image-fs
 * @description Fullscreen photo overlay that sits on top of the scroll viewer. Tap outside or X to close.
 * @called-by  none found
 * @depends-on --pm-z-modal
 * @tags        TODO
 * @updated 2026-04-26
 */
#pm-scroll-image-fs {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--pm-z-modal) + 50);
    background: var(--pm-text-1);
    align-items: center;
    justify-content: center;
}

#pm-scroll-image-fs.pm-active {
    display: flex;
}

#pm-scroll-image-fs img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
}

/**
 * @pm-registry
 * @type css
 * @name pm-scroll-image-fs-close
 * @description Small X close button pinned to top-right of the fullscreen photo overlay.
 * @called-by  none found
 * @depends-on none
 * @tags        TODO
 * @updated 2026-04-26
 */
.pm-scroll-image-fs-close {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 32px);
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--pm-overlay-white-soft);
    color: var(--pm-panel-surface);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1;
}


/* === DOCUMENT PREVIEW POPUP === */

#pm-doc-popup {
    display: none;
    position: absolute;
    inset: 0;
    z-index: calc(var(--pm-z-modal, 700) + 10);
    align-items: flex-end;
}

#pm-doc-popup.pm-active {
    display: flex;
}

.pm-doc-popup-card {
    width: 100%;
    background: var(--pm-panel-surface);
    border-radius: var(--pm-radius-medium) var(--pm-radius-medium) 0 0;
    padding: 24px 20px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
}

.pm-doc-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--pm-text-3);
    cursor: pointer;
    padding: 4px 8px;
}

.pm-doc-popup-icon {
    font-size: 3rem;
    line-height: 1;
}

.pm-doc-popup-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pm-text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pm-doc-popup-label {
    font-size: 0.95rem;
    color: var(--pm-text-1);
    font-weight: 500;
    text-align: center;
    word-break: break-all;
    max-height: 3em;
    overflow: hidden;
}

.pm-doc-popup-caption {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid var(--pm-border, #e0e0e0);
    border-radius: var(--pm-radius-small);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--pm-text-1);
    background: var(--pm-input-bg, #f7f7f7);
    resize: none;
    outline: none;
}

.pm-doc-popup-caption:focus {
    border-color: var(--pm-brand);
}

.pm-doc-popup-save {
    padding: 8px 24px;
    background: var(--pm-surface-2, #f0f0f0);
    color: var(--pm-text-1);
    border: 1px solid var(--pm-border, #e0e0e0);
    border-radius: var(--pm-radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.pm-doc-popup-save:disabled {
    opacity: 0.6;
    cursor: default;
}

.pm-doc-popup-open {
    margin-top: 4px;
    padding: 10px 32px;
    background: var(--pm-brand);
    color: #fff;
    border: none;
    border-radius: var(--pm-radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

