/* src/css/stories.css – стили для историй */

/* Оверлей просмотра историй */
.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;
    }
}

/* Модалки для загрузки историй */
.story-uploader-modal {
    background: #fff;
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 35px rgba(0,0,0,0.3);
}

.story-uploader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.story-uploader-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.story-uploader-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.story-uploader-body {
    padding: 24px;
    min-height: 300px;
}

.story-upload-area {
    border: 2px dashed #ccc;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.story-upload-area:hover {
    background: #f9f9f9;
}

.story-upload-area i {
    font-size: 48px;
    color: #0d6efd;
    margin-bottom: 12px;
    display: inline-block;
}

.story-upload-area span {
    display: block;
    color: #555;
    font-size: 14px;
}

.story-preview {
    text-align: center;
}

.story-preview img,
.story-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.story-caption-input {
    width: 100%;
    padding: 12px;
    border-radius: 24px;
    border: 1px solid #ddd;
    margin: 12px 0;
    font-size: 14px;
}

.story-uploader-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.story-uploader-actions button {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background: #0d6efd;
    color: white;
    cursor: pointer;
}

.story-uploader-actions button:first-child {
    background: #e9ecef;
    color: #333;
}

/* Адаптация модалок предпросмотра */
.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: #000;
}
/* Общие стили для модальных окон (если отсутствуют в modals-menus.css) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: transparent;
    border: none;
    outline: none;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}
/* Секция историй в профиле */
.profile-stories-section {
    margin: 20px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.profile-stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.profile-stories-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.profile-add-story-btn {
    background: var(--primary);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-stories-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
}

.profile-story-item {
    flex-shrink: 0;
    width: 100px;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: transform 0.1s;
}

.profile-story-item:hover {
    transform: scale(1.02);
}

.profile-story-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-story-preview img,
.profile-story-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-story-audio-icon,
.profile-story-placeholder {
    font-size: 32px;
    color: #aaa;
}

.profile-story-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.profile-story-item:hover .profile-story-delete {
    opacity: 1;
}

.profile-story-caption {
    font-size: 11px;
    padding: 6px 4px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.profile-stories-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-create-story-btn {
    display: block;
    margin: 12px auto 0;
    background: var(--primary);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 24px;
    cursor: pointer;
}