/* ========== ПРОСМОТРЩИК ИСТОРИЙ ========== */
.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(0px);
}

.story-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 450px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Прогресс-бары */
.story-progress-bars {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 25;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 0.1s linear;
}

/* Верхняя панель */
.story-header {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 25;
    color: white;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}

.story-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.story-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.3);
}

.story-username {
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.story-time {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 8px;
}

.story-close-btn {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    pointer-events: auto;
}

.story-close-btn:hover {
    background: rgba(0,0,0,0.7);
}

/* Контент медиа */
.story-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.story-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
}

.story-audio-container {
    text-align: center;
    padding: 20px;
    background: rgba(0,0,0,0.6);
    border-radius: 20px;
    margin: 20px;
}

.story-audio-container audio {
    width: 280px;
    max-width: 80vw;
}

.story-caption {
    margin-top: 16px;
    color: white;
    font-size: 16px;
    text-shadow: 0 1px 2px black;
}

.story-caption-overlay {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.6);
    padding: 12px 16px;
    border-radius: 20px;
    color: white;
    text-align: center;
    backdrop-filter: blur(8px);
    font-size: 14px;
}

/* Навигационные зоны (свайп) */
.story-nav-left,
.story-nav-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25%;
    z-index: 20;
    cursor: pointer;
    background: transparent;
}

.story-nav-left {
    left: 0;
}

.story-nav-right {
    right: 0;
}

/* Мобильная адаптация просмотрщика */
@media (max-width: 600px) {
    .story-viewer-container {
        max-width: 100%;
        border-radius: 0;
    }
    .story-progress-bars {
        top: 10px;
        left: 10px;
        right: 10px;
    }
    .story-user-info {
        gap: 8px;
    }
    .story-username {
        font-size: 14px;
    }
    .story-time {
        font-size: 11px;
    }
}

/* === СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ПРОСМОТРЩИКА (через Bootstrap-модалку) === */
.story-viewer-modal-content {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    height: 100%;
}

.story-viewer-modal-overlay {
    background: #000000 !important;
    z-index: 30000 !important;
}