/* Страница профиля */
.community-page {
    min-height: calc(100vh - 72px);
    background: var(--body-bg);
    padding-bottom: 3rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Приватный профиль */
.community-private {
    max-width: 500px;
    margin: 4rem auto;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--post-bg);
    border-radius: 24px;
    border: 1px solid var(--post-border);
}

.private-icon {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.community-private h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.community-private p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.community-private-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.community-private-actions .btn {
    min-width: 150px;
}

/* Основной блок профиля */
.community-header {
    background: var(--post-bg);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--post-border);
}

/* Обложка профиля */
.community-cover {
    position: relative;
    height: 400px;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
}

.btn-change-cover {
    z-index: 10 !important;
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-change-cover:hover {
    background: var(--sidebar-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Информация профиля */
.community-info {
    padding: 0 2rem 2rem;
}

.community-avatar-section {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-top: -5rem;
    position: relative;
    flex-wrap: wrap;
}

/* Аватар */
.community-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.community-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 6px solid var(--post-bg);
    object-fit: cover;
    background: var(--post-bg);
}

.community-avatar-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 6px solid var(--post-bg);
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--button-primary-text);
}

.btn-change-avatar {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--post-bg);
    border: 2px solid var(--post-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    z-index: 5;
}

.btn-change-avatar:hover {
    background: var(--sidebar-bg);
    transform: scale(1.1);
}

.online-indicator {
    position: absolute;
    bottom: 1.5px;
    right: 1.5px;
    width: 12px;
    height: 12px;
    background: #44b700;
    border: 3px solid var(--post-bg);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(68, 183, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(68, 183, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(68, 183, 0, 0.8);
    }
}

/* Бейдж верификации */
.community-badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.community-badge.verified {
    background: var(--accent-color);
    color: var(--button-primary-text);
}

.community-badge svg {
    width: 14px;
    height: 14px;
}

/* Детали профиля */
.community-details {
    flex: 1;
    padding-top: 5.5rem;
}

.community-type {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.community-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-all;
    flex-wrap: wrap;
}

.community-description {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
}

.community-username {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Статус онлайн */
.community-status {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.status-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-text.online {
    color: #44b700;
    font-weight: 500;
}

.status-text.online::before {
    content: '';
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-text.offline {
    color: var(--text-secondary);
}

/* Мета информация */
.community-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-item svg {
    flex-shrink: 0;
}

.meta-item a {
    color: var(--link-color);
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.meta-item a:hover {
    text-decoration: underline;
}

/* Действия профиля */
.community-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 5.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

/* Кнопка меню действий профиля */
.community-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    border: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.community-menu-btn:hover {
    background: var(--button-secondary-bg);
    transform: scale(1.1);
}

/* Выпадающее меню профиля */
.community-dropdown-menu {
    position: absolute;
    top: 100%;
    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);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
}

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

.community-menu-item:hover {
    background: var(--sidebar-bg);
}

.community-menu-item.text-danger {
    color: var(--error-color);
}

/* Статистика профиля */
.community-stats {
    display: flex;
    gap: 3rem;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--post-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Медиа-галерея профиля */
.community-media-gallery {
    margin-bottom: 2rem;
    background: var(--post-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--post-border);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

.gallery-tabs {
    display: flex;
    gap: 1rem;
}

.gallery-tab {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.gallery-tab.active {
    background: var(--accent-color);
    color: white;
}

.gallery-tab:hover:not(.active) {
    background: var(--sidebar-bg);
}

.gallery-content {
    position: relative;
}

.gallery-carousel {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.gallery-carousel::-webkit-scrollbar {
    height: 6px;
}

.gallery-carousel::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
    border-radius: 3px;
}

.gallery-carousel::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.gallery-carousel::-webkit-scrollbar-thumb:hover {
    background: var(--button-primary-bg);
}

.gallery-item {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

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

.gallery-item.vertical-image {
    width: clamp(80px, 18vw, 160px);
    height: auto;
    aspect-ratio: var(--gallery-media-aspect-ratio, 9 / 16);
    max-height: 284px;
    background: #050505;
}

.gallery-item.vertical-image img {
    object-fit: contain;
    background: #050505;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

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

/* Стрелки навигации галереи */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.gallery-nav:hover {
    background: var(--sidebar-bg);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav svg {
    color: var(--text-primary);
}

.gallery-prev {
    left: -12px;
}

.gallery-next {
    right: -12px;
}

/* Пустая галерея */
.gallery-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.view-all-media {
    display: block;
    text-align: center;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--sidebar-bg);
    color: var(--accent-color);
    font-weight: 500;
    margin-top: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.view-all-media:hover {
    background: var(--input-bg);
    transform: translateY(-2px);
}

/* Лейаут контента под профилем */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

/* Секция постов */
.community-content {
    min-width: 0;
}

.community-posts-section {
    width: 100%;
}

/* Блок подписчиков */
.subscribers-widget {
    background: var(--post-bg);
    border-radius: 16px;
    border: 1px solid var(--post-border);
    overflow: visible;
}

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

.widget-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subscribers-count {
    background: var(--sidebar-bg);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.subscribers-list {
    padding: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.subscribers-list::-webkit-scrollbar {
    width: 4px;
}

.subscribers-list::-webkit-scrollbar-track {
    background: transparent;
}

.subscribers-list::-webkit-scrollbar-thumb {
    background: var(--post-border);
    border-radius: 2px;
}

.subscriber-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    border-radius: 12px;
    transition: background 0.2s ease;
    position: relative;
}

.subscriber-item:hover {
    background: var(--sidebar-bg);
}

.subscriber-avatar-wrapper {
    position: relative;
    margin-right: 0.75rem;
}

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

.subscriber-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;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--button-primary-text);
}

.subscriber-info {
    flex: 1;
    min-width: 0;
}

.subscriber-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subscriber-name:hover {
    text-decoration: underline;
}

.subscriber-username {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subscriber-role {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.subscriber-role.admin {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.subscriber-role.moderator {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

.show-all-subscribers-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-subscribers-btn:hover {
    background: var(--sidebar-bg);
}

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

.no-subscribers {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--button-primary-bg), var(--accent-color));
    color: var(--button-primary-text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--sidebar-bg);
    color: var(--text-primary);
    border: 1px solid var(--post-border);
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
    background: var(--error-color);
    color: var(--button-primary-text);
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-outline-danger {
    background: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.btn-outline-danger:hover {
    background: var(--error-color);
    color: var(--button-primary-text);
}

/* Форма создания поста */
.create-post-card {
    background: var(--post-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--post-border);
}

.create-post-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.post-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    resize: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    min-height: 48px;
    transition: all 0.2s ease;
}

.post-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color), 0.1);
}

/* Счетчик символов */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--warning-color);
}

.char-counter.error {
    color: var(--error-color);
}

/* Превью вложений */
.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.attachments-preview:empty {
    display: none;
}

.attachment-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-preview-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    text-align: center;
}

.attachment-preview-inner.audio {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
}

.attachment-preview-inner.file {
    background: var(--sidebar-bg);
}

.attachment-preview-inner svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.attachment-preview-inner .file-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    max-width: 100%;
}

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

.attachment-preview-file {
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    border-radius: 12px;
    padding: 1rem;
}

.attachment-preview-file svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.attachment-preview-file span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    word-break: break-word;
}

.post-draft-preview {
    margin-bottom: 0.875rem;
}

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

.post-draft-preview-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-draft-preview-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0.625rem;
    white-space: normal;
    word-break: break-word;
}

.post-draft-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.post-draft-preview-grid > .post-draft-preview-item:only-child {
    grid-column: 1 / -1;
    min-height: 220px;
}

.post-draft-preview-item {
    position: relative;
    min-height: 132px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--post-border);
}

.post-draft-preview-item img,
.post-draft-preview-item video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.post-draft-preview-item.is-video::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent 55%);
    pointer-events: none;
}

.post-draft-preview-type,
.post-draft-preview-more {
    position: absolute;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
}

.post-draft-preview-type {
    left: 0.5rem;
    bottom: 0.5rem;
}

.post-draft-preview-more {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.post-draft-preview-item.is-file {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.75rem;
    gap: 0.5rem;
    background:
        radial-gradient(circle at top right, rgba(0, 201, 167, 0.16), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08));
}

.post-draft-preview-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.post-draft-preview-file-name {
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-word;
}

.post-draft-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.post-draft-preview-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(35, 209, 139, 0.14);
    color: var(--accent-color);
    border: 1px solid rgba(35, 209, 139, 0.22);
}

.remove-attachment {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s ease;
}

.remove-attachment:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Расширенные опции создания поста */
.post-create-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--post-border);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-option-item:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.post-option-item.active {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

.post-option-item svg {
    width: 18px;
    height: 18px;
}

.post-option-panel {
    background: var(--sidebar-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

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

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.poll-option-input {
    flex: 1;
}

.remove-poll-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--error-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-poll-option:hover {
    opacity: 0.8;
}

.btn-add-option {
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px dashed var(--post-border);
    border-radius: 12px;
    color: var(--accent-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-add-option:hover {
    background: var(--sidebar-bg);
    border-color: var(--accent-color);
}

.poll-settings {
    margin-top: 0.75rem;
}

.poll-settings-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.poll-settings label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.poll-question {
    margin-bottom: 0.75rem;
}

.selected-coauthors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.selected-coauthor {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    font-size: 0.8125rem;
}

/* Действия поста */
.create-post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--post-border);
}

.post-attachments {
    display: flex;
    gap: 0.5rem;
}

.attachment-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.attachment-btn:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

.post-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Селектор приватности */
.visibility-dropdown {
    position: relative;
}

.visibility-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;
    min-width: 140px;
}

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

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

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

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

.visibility-menu {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 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);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    display: none;
}

.visibility-menu.show {
    display: block;
}

.visibility-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;
}

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

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

.visibility-option svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

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

.visibility-option-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Контейнер постов */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Карточка поста */
.post-card {
    background: var(--post-bg);
    border-radius: 16px;
    border: 1px solid var(--post-border);
    overflow: hidden;
    transition: all 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Заголовок поста */
.post-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
}

.post-author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.post-author-avatar:hover {
    transform: scale(1.05);
}

.post-author-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--button-primary-text);
    font-size: 0.875rem;
    flex-shrink: 0;
    cursor: pointer;
}

.post-author-info {
    flex: 1;
    min-width: 0;
}

.post-author-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    display: block;
    margin-bottom: 0.125rem;
}

.post-author-name:hover {
    text-decoration: underline;
}

.post-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.post-edited {
    font-style: italic;
}

.post-location {
    color: var(--accent-color);
}

.post-menu {
    position: relative;
}

.post-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.post-menu-btn:hover:not(.active) {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}

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

/* Выпадающее меню поста */
.post-dropdown-menu {
    position: fixed;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.5rem;
}

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

.post-menu-item:hover {
    background: var(--sidebar-bg);
}

.post-menu-item.text-danger {
    color: var(--error-color);
}

/* Контент поста */
.post-content {
    padding: 0 1.25rem 1rem;
}

.post-text {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9375rem;
    margin-top: 0.75rem;
}

.post-text:first-child {
    margin-top: 0;
}

.post-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.post-text a:hover {
    text-decoration: underline;
}

.post-card.shared-post .post-content > .post-text:last-child {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--post-border);
}

/* Контейнер репоста */
.shared-post-container {
    border: 1px solid var(--post-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--sidebar-bg);
}

.shared-post-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--post-border);
}

.shared-post-header svg {
    width: 14px;
    height: 14px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.shared-post-header span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.shared-post-header a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.25rem;
}

.shared-post-header a:hover {
    text-decoration: underline;
    color: var(--accent-color);
}

.shared-post-container .post-text {
    padding: 1rem;
    margin: 0;
    background: var(--post-bg);
}

/* Опрос в посте */
.post-poll {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--sidebar-bg);
    border-radius: 12px;
}

.poll-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.poll-option {
    position: relative;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    min-height: 44px;
}

.poll-option:hover:not(.voted) {
    background: var(--post-bg);
    border-color: var(--accent-color);
}

.poll-option.voted {
    cursor: default;
}

.poll-option-text {
    position: relative;
    z-index: 2;
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    padding-right: 0.5rem; 
}

.poll-option.show-results .poll-option-text {
    padding-right: 4rem;
}

.poll-option-result {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    pointer-events: none;
}

.poll-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.poll-percentage {
    position: relative;
    z-index: 2;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.poll-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Форма редактирования поста */
.post-edit-form {
    width: 100%;
}

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

.post-edit-input:focus {
    border-color: var(--accent-color);
}

.post-edit-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.media-item.vertical-video {
    background: #000;
    max-height: 450px; 
}

.media-item.vertical-video video {
    object-fit: contain;
    max-height: 100%;
    width: auto;
    max-width: 100%;
}

.post-media.media-2 {
    grid-template-columns: repeat(2, 1fr);
    max-height: 400px;
}

.post-media.media-2 .media-item {
    height: 400px;
}

.post-media.media-3 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 200px);
    max-height: 400px;
}

.post-media.media-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 200px);
    max-height: 400px;
}

.media-item:hover img {
    transform: scale(1.05);
}

/* Файлы в постах */
.post-files {
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border: 1px solid var(--post-border);
    position: relative;
}

.file-item:hover {
    background: var(--button-secondary-bg);
    transform: translateX(4px);
}

.file-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), var(--button-primary-bg));
    border-radius: 8px;
    color: var(--button-primary-text);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Панель взаимодействий */
.post-interaction-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    border-top: 1px solid var(--post-border);
    background: var(--sidebar-bg);
}

.post-interaction-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-interaction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.post-interaction-item:hover:not([data-disabled="true"]) {
    background-color: rgba(0, 0, 0, 0.05);
}

.post-interaction-item[data-disabled="true"] {
    opacity: 0.6;
    cursor: default;
}

.interaction-like {
    color: #e74c3c;
}

.interaction-like.active {
    color: #e74c3c;
    font-weight: 500;
}

.interaction-comment {
    color: #3498db;
}

.interaction-comment.active {
    color: #3498db;
    font-weight: 500;
}

.interaction-share {
    color: #2ecc71;
}

.interaction-share.active {
    color: #2ecc71;
    font-weight: 500;
}

.interaction-count {
    font-size: 0.875rem;
    font-weight: 500;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.post-interaction-item svg {
    width: 20px;
    height: 20px;
}

/* Комментарии */
.post-comments {
    padding: 0.75rem 1.25rem 1rem;
    background: var(--sidebar-bg);
    border-top: none;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.comments-list:empty {
    display: none;
}

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

.comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--post-border);
    border-radius: 2px;
}

.comment {
    display: flex;
    gap: 0.625rem;
    padding: 0.625rem;
    border-radius: 8px;
    transition: background 0.2s ease;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.comment:hover {
    background: var(--post-bg);
}

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

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

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-author:hover {
    color: var(--accent-color);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comment-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.comment-text.editing {
    display: none;
}

.comment-edit-input {
    width: 100%;
    padding: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    resize: none;
    outline: none;
}

.comment-edit-input:focus {
    border-color: var(--accent-color);
}

/* Действия комментария */
.comment-actions {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    display: none;
    gap: 0.25rem;
}

.comment:hover .comment-actions {
    display: flex;
}

.comment-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--post-bg);
    border: 1px solid var(--post-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.comment-action-btn:hover {
    background: var(--sidebar-bg);
    color: var(--text-primary);
}
