/* Full-screen story viewer modal */
.story-viewer-overlay {
    position: fixed;
    inset: var(--s-0);
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.story-viewer-overlay.hidden {
    display: none;
}

.story-viewer {
    position: relative;
    width: min(420px, 100vw);
    height: min(90vh, 760px);
    background: var(--text-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top progress bars */
.story-viewer__bars {
    position: absolute;
    top: var(--s-2);
    left: var(--s-3);
    right: var(--s-3);
    display: flex;
    gap: var(--s-1);
    z-index: 5;
}

.story-viewer__bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xs);
    overflow: hidden;
}

.story-viewer__bar-fill {
    width: 0;
    height: 100%;
    background: var(--surface-1);
    transition: width linear;
}

.story-viewer__bar.past .story-viewer__bar-fill {
    width: 100%;
    transition: none;
}

/* Header */
.story-viewer__header {
    position: absolute;
    top: 22px;
    left: var(--s-3);
    right: var(--s-3);
    display: flex;
    align-items: center;
    gap: var(--s-2);
    z-index: 5;
}

.story-viewer__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.story-viewer__name {
    flex: 1;
    color: var(--surface-1);
    font-weight: 600;
    font-size: var(--t-body-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-viewer__close,
.story-viewer__delete {
    background: transparent;
    border: none;
    color: var(--surface-1);
    font-size: var(--t-title-lg);
    cursor: pointer;
    line-height: 1;
    padding: var(--s-1) var(--s-2);
}

/* Media area */
.story-viewer__media {
    position: absolute;
    inset: var(--s-0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.story-viewer__media img,
.story-viewer__media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tap zones (left/right halves of the media for navigation) */
.story-viewer__tap-zones {
    position: absolute;
    inset: 60px var(--s-0) var(--s-11) var(--s-0);
    display: flex;
    z-index: 4;
}

.story-viewer__tap-prev,
.story-viewer__tap-next {
    flex: 1;
    cursor: pointer;
}

/* Footer (caption + view count) */
.story-viewer__footer {
    position: absolute;
    bottom: var(--s-3);
    left: var(--s-3);
    right: var(--s-3);
    z-index: 5;
}

.story-viewer__caption {
    color: var(--surface-1);
    font-size: var(--t-body-sm);
    font-weight: 500;
    padding: var(--s-3);
    background: linear-gradient(to bottom, rgba(0,0,0,0.0), rgba(0,0,0,0.55));
    border-radius: var(--radius-sm);
}

.story-viewer__views {
    margin-top: var(--s-2);
    color: var(--surface-1);
    font-size: var(--t-caption);
    display: flex;
    align-items: center;
    gap: var(--s-1);
    opacity: 0.85;
}
