.comment-action-btn.delete:hover {
    color: var(--error-color);
}

/* Кнопка показать больше комментариев */
.show-more-comments {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 8px;
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    margin-left: auto;
    margin-right: auto;
    width: 50%; 
    max-width: 300px;
}

.show-more-comments:hover {
    background: var(--sidebar-bg);
}

/* Форма добавления комментария */
.add-comment {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--post-border);
    align-items: center;
}

.comment-input-wrapper {
    flex: 1;
}

.comment-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 20px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    outline: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.comment-input:focus {
    border-color: var(--accent-color);
    background: var(--post-bg);
}

.comment-submit {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: var(--button-primary-text);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-submit:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-submit svg {
    width: 16px;
    height: 16px;
}

/* Лайтбокс для просмотра медиа */
.media-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.media-lightbox.active {
    display: flex;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    color: white;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.lightbox-title {
    font-size: 1.25rem;
    font-weight: 500;
}

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 50px 130px;
}

.lightbox-media-container {
    max-width: min(90vw, 1200px);
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-video {
    max-width: min(90vw, 1200px);
    max-height: 80vh;
    border-radius: 8px;
    background: black;
    object-fit: contain;
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-audio-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.audio-visualization {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.lightbox-audio-player {
    width: 100%;
    max-width: 400px;
}

.audio-file-name {
    color: white;
    font-size: 1rem;
    text-align: center;
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lightbox-counter {
    font-size: 1rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.lightbox-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}


.lightbox-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lightbox-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.lightbox-author-name {
    font-weight: 500;
    color: white;
    text-decoration: none;
}

.lightbox-actions {
    display: flex;
    gap: 0.5rem;
}

.lightbox-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.lightbox-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    z-index: 5;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.lightbox-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem;
    justify-content: center;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.lightbox-thumbnail {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.lightbox-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lightbox-thumbnail.active {
    border-color: var(--accent-color);
    opacity: 1;
}

.lightbox-thumbnail img,
.lightbox-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-audio {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.thumbnail-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Модальное окно репоста */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    position: relative;
    max-width: min(600px, calc(100vw - 2rem));
    margin: 5% auto;
}

.modal-content {
    background: var(--post-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--post-border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.share-input {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    outline: none;
    margin-bottom: 1rem;
}

.share-post-preview {
    border: 1px solid var(--post-border);
    border-radius: 12px;
    padding: 1rem;
    background: var(--sidebar-bg);
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--post-border);
}

/* Загрузка постов */
.posts-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-posts {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Уведомления */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.notification {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    min-width: 320px;
    max-width: 420px;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.notification-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--text-primary);
}

.notification-success .notification-icon {
    color: #44b700;
}

.notification-error .notification-icon {
    color: var(--error-color);
}

.notification-warning .notification-icon {
    color: var(--warning-color);
}

.notification-info .notification-icon {
    color: var(--accent-color);
}

.friend-menu-btn.active,
.post-menu-btn.active {
    background: var(--sidebar-bg);
    color: var(--accent-color);
}

.community-actions .btn {
    transition: all 0.2s ease;
}

.community-actions .btn-secondary {
    background: var(--button-secondary);
    color: var(--text-primary);
}

.community-actions .btn-secondary:hover {
    background: var(--button-secondary-bg);
    color: white;
    transform: translateY(-2px);
}

.post-preview-poll {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--accent-color);
}   

.shared-post-deleted {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--sidebar-bg);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    gap: 0.75rem;
}

.shared-post-deleted svg {
    width: 24px;
    height: 24px;
    color: var(--error-color);
}

.show-all-friends-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    border-top: 1px solid var(--post-border);
    transition: background 0.2s ease;
}

.show-all-friends-btn:hover {
    background: var(--sidebar-bg);
}

.show-all-friends-btn svg {
    width: 16px;
    height: 16px;
}

.poll-duration-dropdown {
    position: relative;
    flex: 1; 
}

.poll-duration-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%; 
}

.poll-duration-button:hover {
    background: var(--sidebar-bg);
    border-color: var(--accent-color);
}

.poll-duration-button svg {
    width: 16px;
    height: 16px;
}

.poll-duration-button .dropdown-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.poll-duration-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.poll-duration-menu {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    right: 0; 
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow: hidden;
    display: none;
}

.poll-duration-menu.show {
    display: block;
}

.poll-duration-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.poll-duration-option:hover {
    background: var(--sidebar-bg);
}

.poll-duration-option.selected {
    background: var(--sidebar-bg);
    color: var(--accent-color);
}

.duration-option-text {
    flex: 1;
}

.duration-option-label {
    font-weight: 500;
    display: block;
}

.more-media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(4px); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; 
}

.more-media-overlay span {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    position: relative;
}

.media-item.more-media::after {
    display: none;
}

.media-item.more-media {
    position: relative;
    cursor: pointer;
}

/* ========== СОВРЕМЕННЫЙ АУДИОПЛЕЕР ========== */
.post-audio-files {
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modern-audio-player {
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.modern-audio-player:hover {
    background: var(--input-bg);
}

.audio-player-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Кнопка Play/Pause */
.audio-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.audio-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-play-btn svg {
    width: 18px;
    height: 18px;
}

.audio-play-btn .play-icon {
    margin-left: 2px;
}

/* Основная секция плеера */
.audio-main-section {
    flex: 1;
    min-width: 0;
}

/* Название трека */
.audio-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Контролы */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* Таймкоды */
.audio-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
    user-select: none;
}

.audio-time.current-time {
    text-align: right;
}

/* Контейнер прогресс-бара */
.audio-progress-container {
    flex: 1;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0 4px;
}

/* Основа прогресс-бара */
.audio-progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: var(--post-border);
    border-radius: 2px;
    overflow: visible;
}

/* Буферизация */
.audio-buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 2px;
    width: 0%;
    z-index: 1;
}

/* Заполнение прогресса */
.audio-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    width: 0%;
    z-index: 2;
}

/* Ручка прогресс-бара */
.audio-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border: 2px solid var(--post-bg);
    border-radius: 50%;
    left: 0%;
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

.audio-progress-handle:active {
    cursor: grabbing;
}

.audio-progress-container:hover .audio-progress-handle,
.audio-progress-container.dragging .audio-progress-handle {
    transform: translate(-50%, -50%) scale(1.2);
}

/* Контроль громкости */
.audio-volume-control {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 0.5rem;
}

/* Кнопка громкости с круглым фоном */
.volume-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    border: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.volume-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

.volume-btn svg {
    width: 16px;
    height: 16px;
}

/* Обертка слайдера громкости с невидимым мостом */
.volume-slider-wrapper {
    position: absolute;
    right: 100%; 
    top: 50%;
    transform: translateY(-50%);
    width: 140px;
    height: 32px;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding-right: 8px;
}

/* Создаем невидимый мост между кнопкой и слайдером */
.volume-slider-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 100%;
    z-index: -1;
}

/* Показываем при наведении на контейнер */
.audio-volume-control:hover .volume-slider-wrapper {
    opacity: 1;
    pointer-events: all;
}

/* Контейнер слайдера */
.volume-slider-container {
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 16px;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: calc(100% - 8px);
}

/* Слайдер громкости */
.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, 
        var(--accent-color) 0%, 
        var(--accent-color) 70%, 
        var(--post-border) 70%, 
        var(--post-border) 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: transparent;
}

.volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: transparent;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--post-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--post-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: none;
}

/* Состояние воспроизведения */
.modern-audio-player.playing {
    background: var(--input-bg);
}

.modern-audio-player.playing .audio-play-btn {
    animation: subtle-pulse 3s infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 2px 12px rgba(52, 152, 219, 0.3);
    }
}

/* Аудиоплеер в лайтбоксе */
.lightbox-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    min-width: 0;
    max-width: min(500px, 90vw);
    width: 100%;
}

.lightbox-audio-container .modern-audio-player {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.lightbox-audio-container .modern-audio-player:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lightbox-audio-container .audio-title {
    color: white;
    font-size: 1rem;
    text-align: center;
}

.lightbox-audio-container .audio-time {
    color: rgba(255, 255, 255, 0.7);
}

.lightbox-audio-container .volume-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.lightbox-audio-container .volume-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.lightbox-audio-container .volume-slider-container {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.audio-visualization {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.lightbox-audio-container.playing .audio-visualization {
    animation: pulse 1s infinite;
}

/* ========== ВЕРТИКАЛЬНЫЕ ВИДЕО ========== */
.post-media {
    margin: 0.75rem 0;
    display: grid;
    gap: 0.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.media-item {
    position: relative;
    background: #000;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.media-item video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Специальные стили для одиночного медиа */
.post-media.media-1 {
    grid-template-columns: 1fr;
    max-height: 500px;
    min-height: 280px;
}

.post-media.media-1 .media-item {
    height: 100%;
    max-height: 500px;
    min-height: 280px;
}

/* Для вертикальных видео */
.post-media.media-1 .media-item.vertical-video {
    max-height: 450px;
    background: #000;
}

.story-item {
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
}

.story-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-avatar.viewed {
    background: var(--post-border);
}

.story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--post-bg);
}

.story-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 2px solid var(--post-bg);
}

.story-username {
    font-size: 0.75rem;
    text-align: center;
    margin-top: 0.375rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
}

.add-story-item {
    position: relative;
}

.add-story-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 2px solid var(--post-bg);
}

/* ========== КНОПКА СОЗДАНИЯ КЛИПА ========== */
.create-clip-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.create-clip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(131, 58, 180, 0.3);
}

.create-clip-btn svg {
    width: 18px;
    height: 18px;
}

.clip-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    z-index: 10;
}

.attachment-preview.clip-preview {
    position: relative;
}

.clip-label {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #833ab4, #fd1d1d);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
}

.story-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.story-dots {
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0 1rem;
}

.story-dot {
    height: 3px;
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.story-dot.active {
    background: white;
}

.stories-container .add-story-item {
    display: none !important;
}

.story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-progress-bars {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 484px;
    display: flex;
    gap: 4px;
    z-index: 1000;
}

.story-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.story-progress-bar.viewed {
    background: rgba(255, 255, 255, 0.3);
}

.story-progress-bar.viewed .story-progress-fill {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.7);
}

.story-progress-bar.active {
    background: rgba(255, 255, 255, 0.3);
}

.story-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: white;
    width: 0%;
    border-radius: 2px;
    transition: none;
}

.story-viewer-header {
    position: absolute;
    top: 20px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.story-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.story-user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.story-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.story-user-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.story-user-name:hover {
    text-decoration: underline;
}

.story-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.story-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.story-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.story-viewer-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-touch-prev,
.story-touch-next {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 5;
    cursor: pointer;
}

.story-touch-prev {
    left: 0;
}

.story-touch-next {
    right: 0;
}

.story-nav-buttons {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.story-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    pointer-events: all;
    transition: all 0.2s ease;
}

.story-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Иконка клипа в галерее */
.gallery-item-play svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.story-main-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.story-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 400;
}

.story-media-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-caption-wrapper {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    max-width: 468px;
    margin: 0 auto;
    z-index: 10;
}

.story-viewer-footer {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    align-items: center; 
    justify-content: space-between;
}

.story-views {
    position: absolute;
    bottom: 14px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 14px;
    white-space: nowrap;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.story-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.story-viewer {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-gradient-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
    z-index: 5;
    pointer-events: none;
}

.story-gradient-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    z-index: 5;
    pointer-events: none;
}

.story-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.story-control-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.story-volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.story-volume-slider-wrapper {
    position: absolute;
    right: calc(100% - 22px); 
    top: calc(50% + 35px); 
    transform: translateY(-50%);
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.story-volume-control:hover .story-volume-slider-wrapper {
    width: 120px;
}

.story-volume-slider {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.story-volume-slider input {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.story-volume-slider input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.story-volume-slider input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.story-volume-slider input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.story-volume-slider input::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.story-play-btn svg {
    transition: opacity 0.2s ease;
}

.story-delete-btn {
    background: rgba(255, 0, 0, 0.3);
}

.story-delete-btn:hover {
    background: rgba(255, 0, 0, 0.5);
}

.story-caption-container {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 14px 16px 14px 16px;
    min-height: 50px;
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 12px; 
}

.story-caption {
    color: white;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
    max-height: 3em;
    overflow: hidden;
    flex: 1;
    margin-right: 0;
}

.story-caption-container:empty + .story-views {
    position: relative;
    bottom: auto;
    right: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.story-actions {
    position: relative;
    bottom: auto;
    right: auto;
    display: flex !important;
    align-items: center;
    gap: 12px;
    z-index: 10;
    flex-shrink: 0;
}

.story-viewer-footer:has(.story-caption-container:empty) {
    justify-content: flex-end;
}

.story-action-btn {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.story-action-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.story-action-btn.liked {
    color: #e74c3c;
}

.story-action-btn svg {
    width: 18px;
    height: 18px;
}

.story-comments-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.story-comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-comments-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.story-comments-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.story-comments-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.story-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.story-comments-list::-webkit-scrollbar {
    width: 6px;
}

.story-comments-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.story-comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.no-comments {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
}

/* Комментарий */
.story-comment {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.story-comment-main {
    display: flex;
    gap: 12px;
}

.story-comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.story-comment-avatar.small {
    width: 28px;
    height: 28px;
}

.story-comment-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.story-comment-avatar-placeholder.small {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.story-comment-content {
    flex: 1;
}

.story-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.story-comment-author {
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.story-comment-author:hover {
    text-decoration: underline;
}

.story-comment-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.story-comment-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.story-comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.story-comment-reply-btn,
.story-comment-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.story-comment-reply-btn:hover {
    color: var(--accent-color);
}

.story-comment-delete-btn:hover {
    color: #e74c3c;
}

.story-comment-delete-btn.small {
    font-size: 11px;
    margin-top: 4px;
}

/* Ответы на комментарии */
.story-comment-replies {
    margin-left: 48px;
    margin-top: 12px;
}

.story-comment-reply {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.story-comment-reply-input {
    margin-left: 48px;
    margin-top: 8px;
}

.story-comment-reply-input input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-size: 13px;
    outline: none;
}

.story-comment-reply-input input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

/* Поле ввода комментария */
.story-comment-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.story-comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    outline: none;
}

.story-comment-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

.story-comment-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.story-comment-submit:hover {
    transform: scale(1.1);
    background: var(--button-primary-bg);
}

/* Поиск соавторов */
.coauthor-suggestions {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.75rem;
    border: 1px solid var(--post-border);
    border-radius: 12px;
    background: var(--post-bg);
}

.coauthor-suggestion {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.coauthor-suggestion:hover {
    background: var(--sidebar-bg);
}

.coauthor-suggestion-avatar img,
.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}
