/* ============================================
   Story Overlay – full‑screen viewer (polished video)
   ============================================ */

.story-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.story-overlay[aria-hidden="false"] {
    display: flex;
}

.story-overlay-close {
    position: absolute;
    top: var(--gap-lg);
    right: var(--gap-lg);
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.story-overlay-close:hover {
    opacity: 1;
}

/* Image view */
.story-overlay-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

/* Video container */
.story-video-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: #000;
}

.story-overlay-video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 90vh;
    object-fit: contain;
    outline: none;
}

/* Custom controls bar */
.story-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--padding-sm) var(--padding-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-video-container:hover .story-video-controls {
    opacity: 1;
}

.story-video-playpause {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.9;
}

.story-video-playpause:hover {
    opacity: 1;
}

.story-video-playpause svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Progress bar */
.story-video-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.story-video-progress-filled {
    height: 100%;
    width: 0%;
    background: var(--color-primary-500);
    border-radius: 2px;
    transition: width 0.1s linear;
}