/* publications.css - единый стиль для всех страниц публикаций */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Poppins', 'Arial', sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    color: #e0e0e0;
}

/* Контейнеры */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.user-info {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: right;
}

/* Навбар для страницы статьи */
.navbar {
    display: flex;
    justify-content: flex-end;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a2a3e;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    color: #a8a8ff;
    font-weight: 500;
}

/* Кнопка создания в навбаре */
.create-nav-btn {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.create-nav-btn:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

/* ============================================
   ПЛАВАЮЩАЯ ПЛАШКА С ВКЛАДКАМИ (STICKY)
   ============================================ */

/* Обертка для вкладок и кнопки */
.tabs-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0a0f;
    padding: 10px 0;
}

/* Добавляем прозрачный фон при прокрутке */
.tabs-wrapper.scrolled {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    transition: all 0.3s ease;
}

.tabs {
    display: flex;
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
}

.tab-link {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    color: #8a8aa0;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.tab-link.active {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: white;
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a8a8ff, #667eea);
    border-radius: 3px;
}

.tab-link:hover:not(.active) {
    background: #22223a;
    color: #d0d0e0;
}

/* Кнопка создания внутри плавающей плашки */
.create-sticky-btn {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-sticky-btn:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

.create-sticky-btn:active {
    transform: translateY(0);
}

.create-sticky-btn::before {
    content: "+";
    font-size: 18px;
    font-weight: bold;
}

/* Круглая фиксированная кнопка создания (для мобильных) */
.create-fab-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    font-size: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    z-index: 999;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
}

.create-fab-btn:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.create-fab-btn:active {
    transform: translateY(0) scale(0.98);
}

.create-fab-btn::before {
    content: "+";
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

/* Скрываем FAB на десктопе, показываем на мобильных */
@media (max-width: 768px) {
    .create-sticky-btn {
        display: none;
    }
    
    .create-fab-btn {
        display: flex;
    }
}

@media (min-width: 769px) {
    .create-sticky-btn {
        display: flex;
    }
    
    .create-fab-btn {
        display: none;
    }
}

/* Ссылка назад */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #a8a8ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: white;
    text-decoration: underline;
}

/* ============================================
    СТИЛИ ДЛЯ СТРАНИЦЫ СТАТЬИ
   ============================================ */

.article-page-container {
    max-width: 1200px; /* Широкий для статьи */
    margin: 0 auto;
    padding: 20px;
}


/* Контейнер статьи */
.article-container {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    max-width: 1200px;
    border: 1px solid #2a2a3e;
}

/* Заголовок статьи */
.article-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2a2a3e;
}

.article-type {
    display: inline-block;
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #a8a8ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 32px;
    color: #e0e0e0;
    margin: 15px 0;
    line-height: 1.3;
}

.article-meta {
    color: #8a8aa0;
    font-size: 14px;
}

/* Изображение в статье */
.article-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.article-container img:hover {
    transform: scale(1.02);
}

/* Контент статьи */
.article-content {
    line-height: 1.8;
    font-size: 16px;
    color: #e0e0e0;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content strong {
    color: #a8a8ff;
    font-size: 18px;
    display: block;
    margin-bottom: 10px;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #2a2a3e, transparent);
    margin: 20px 0;
}

/* Футер статьи */
.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #2a2a3e;
    text-align: center;
    color: #8a8aa0;
    font-size: 14px;
}

/* ============================================
   БЛОК КОММЕНТАРИЕВ НА СТРАНИЦЕ СТАТЬИ
   ============================================ */

.article-comments {
    background: #1a1a2e;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #2a2a3e;
}

.article-comments h3 {
    color: #e0e0e0;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Сортировка комментариев */
.sort-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-container label {
    color: #e0e0e0;
    font-weight: 500;
}

#article-comment-sort {
    padding: 8px 12px;
    background: #1f1f30;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
}

#article-comment-sort:hover {
    border-color: #a8a8ff;
}

#article-comment-sort:focus {
    outline: none;
    border-color: #a8a8ff;
}

/* Топ-комментарий */
.top-comment {
    margin: 20px 0;
    background: #1f1f30;
    border-radius: 12px;
    padding: 15px;
    border-left: 4px solid #a8a8ff;
    display: flex;
    gap: 12px;
}

.top-comment img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

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

.top-comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.top-comment-header strong {
    color: #a8a8ff;
}

.top-comment-badge {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #a8a8ff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.top-comment p {
    margin: 8px 0;
    color: #e0e0e0;
    line-height: 1.5;
}

.top-comment-likes {
    color: #8a8aa0;
    font-size: 13px;
}

/* Список комментариев */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: #1f1f30;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.comment-item:hover {
    background: #25253a;
    transform: translateX(2px);
}

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

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-header strong {
    color: #a8a8ff;
}

.comment-date {
    color: #8a8aa0;
    font-size: 12px;
}

.comment-text {
    color: #e0e0e0;
    line-height: 1.5;
    margin: 8px 0;
    word-break: break-word;
}

/* Кнопка лайка комментария */
.like-comment-btn {
    background: none;
    border: none;
    color: #8a8aa0;
    cursor: pointer;
    padding: 5px 10px 5px 0;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.like-comment-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Форма добавления комментария */
.add-comment {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #2a2a3e;
}

.add-comment textarea {
    width: 100%;
    padding: 12px;
    background: #1f1f30;
    border: 1px solid #2a2a3e;
    border-radius: 12px;
    color: #e0e0e0;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.2s ease;
}

.add-comment textarea:focus {
    outline: none;
    border-color: #a8a8ff;
}

.add-comment textarea::placeholder {
    color: #8a8aa0;
}

.submit-article-comment {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.submit-article-comment:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

.submit-article-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Приглашение войти */
.login-prompt {
    margin-top: 20px;
    padding: 15px;
    background: #1f1f30;
    border-radius: 12px;
    text-align: center;
    color: #8a8aa0;
}

.login-prompt a {
    color: #a8a8ff;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.no-comments {
    text-align: center;
    color: #8a8aa0;
    font-style: italic;
    padding: 20px;
}

/* ============================================
   КАРТОЧКИ (ЛЕНТА)
   ============================================ */

.feed-card {
    background: #1a1a2e;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid #2a2a3e;
    transition: transform 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.feed-card:hover {
    transform: translateY(-2px);
}

.card-header {
    padding: 16px 16px 0 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar-link {
    text-decoration: none;
}

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

.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    text-transform: uppercase;
}

.author-details {
    flex: 1;
}

.author-name {
    color: #a8a8ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

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

.post-time {
    color: #8a8aa0;
    font-size: 12px;
}

.card-body {
    padding: 12px 16px;
}

/* Текст поста */
.post-text-container {
    margin-bottom: 12px;
}

.post-text {
    color: #e0e0e0;
    line-height: 1.5;
    font-size: 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-text.collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

/* Текст статьи в ленте */
.article-text {
    color: #e0e0e0;
    line-height: 1.6;
    font-size: 15px;
}

.article-text.collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

/* Описание статьи в ленте */
.article-description-container {
    margin-bottom: 12px;
}

.article-description {
    color: #a0a0b0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.article-description.collapsed {
    max-height: 80px;
    overflow: hidden;
    position: relative;
}

/* Ссылки "читать далее" */
.read-more-link,
.read-more-description-link {
    color: #a8a8ff;
    text-decoration: none;
    font-weight: 500;
    margin-left: 5px;
    cursor: pointer;
}

.read-more-link:hover,
.read-more-description-link:hover {
    text-decoration: underline;
}

/* Заголовок статьи в ленте */
.article-title {
    font-size: 20px;
    color: #e0e0e0;
    margin-bottom: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Фото в ленте */
.article-photo {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.article-photo img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.article-photo img:hover {
    transform: scale(1.02);
}

.article-full-link {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.article-full-link:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

/* Галерея фото в ленте */
.post-photos-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2px;
    margin-top: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background: #2a2a3e;
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.gallery-item:hover img {
    opacity: 0.9;
}

.post-photos-gallery:has(.gallery-item:only-child) {
    grid-template-columns: 1fr;
}

.post-photos-gallery:has(.gallery-item:only-child) .gallery-item {
    aspect-ratio: auto;
    max-height: 500px;
}


.post-photos-gallery:has(.gallery-item:only-child) .gallery-item img {
    object-fit: contain;
    background: #0a0a0f;
}

.card-footer {
    padding: 0 16px 16px 16px;
    border-top: 1px solid #2a2a3e;
    margin-top: 8px;
}

/* Блок комментариев в карточке */
.post-comments-block {
    margin-top: 12px;
}

.top-comment-avatar {
    text-decoration: none;
}

.top-comment-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.top-comment-content strong a {
    color: #a8a8ff;
    text-decoration: none;
}

.top-comment-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #d0d0e0;
}

.top-comment-content span {
    font-size: 12px;
    color: #8a8aa0;
}

.show-comments-btn {
    background: none;
    border: none;
    color: #6c6c8a;
    cursor: pointer;
    padding: 8px 0;
    font-size: 13px;
    transition: color 0.2s ease;
    width: 100%;
    text-align: left;
}

.show-comments-btn:hover {
    color: #a8a8ff;
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-container {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: #1a1a2e;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #2a2a3e;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.modal-content {
    width: 100%;
    background: #1a1a2e;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a3e;
    background: #1a1a2e;
}

.modal-header h2, .modal-header h3 {
    color: #e0e0e0;
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #8a8aa0;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 500;
}

.modal-body .form-group select,
.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: #1f1f30;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-body .form-group select:focus,
.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: #a8a8ff;
}

.modal-body .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.required-field::after {
    content: " *";
    color: #ff6b6b;
}

.photos-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.preview-photo-item {
    position: relative;
    background: #2a2a3e;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.preview-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-photo-btn:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn-primary {
    background: linear-gradient(135deg, #2a2a3e, #3a3a52);
    color: #e0e0e0;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3a3a52, #4a4a6a);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #2a2a3e;
    color: #8a8aa0;
    border: 1px solid #3a3a52;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #2f2f42;
    color: #e0e0e0;
}


.btn-add-photo {
    background: linear-gradient(135deg, #2a5a3e, #3a6a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-add-photo:hover {
    background: linear-gradient(135deg, #3a6a52, #4a7a62);
    transform: translateY(-1px);
}

.file-input-wrapper {
    margin-bottom: 10px;
}

.preview {
    margin-top: 20px;
    padding: 16px;
    background: #1f1f30;
    border-radius: 12px;
    border: 1px solid #2a2a3e;
}

.preview h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #a8a8ff;
}

.hidden {
    display: none !important;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ДЛЯ ПРОСМОТРА ФОТО С НАВИГАЦИЕЙ
   ============================================ */

/* Основное модальное окно */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
}

/* Контейнер с фото */
.photo-modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Само фото */
.photo-modal-content img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: fadeIn 0.3s ease;
}

/* Кнопка закрытия */
.close-photo-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
}

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

/* Стрелки навигации */
.photo-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 48px;
    cursor: pointer;
    padding: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    backdrop-filter: blur(5px);
}

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

.photo-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Левая стрелка */
.photo-nav-prev {
    left: 30px;
}

/* Правая стрелка */
.photo-nav-next {
    right: 30px;
}

/* Счетчик фото */
.photo-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 2001;
    backdrop-filter: blur(5px);
    font-weight: 500;
}

/* Индикатор загрузки фото */
.photo-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   КОММЕНТАРИИ В МОДАЛКЕ
   ============================================ */

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #1f1f30;
    border-radius: 10px;
}

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

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-header strong a {
    color: #a8a8ff;
    text-decoration: none;
}

.comment-header small {
    color: #6c6c8a;
    font-size: 11px;
}

.comment-text {
    margin: 5px 0;
    color: #d0d0e0;
    word-break: break-word;
}

.like-btn {
    background: none;
    border: none;
    color: #8a8aa0;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.like-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Сортировка комментариев */
#comment-sort {
    padding: 8px 12px;
    background: #1f1f30;
    border: 1px solid #2a2a3e;
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
}

/* ============================================
   ИНДИКАТОР ЗАГРУЗКИ
   ============================================ */

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 3px solid #2a2a3e;
    border-top: 3px solid #a8a8ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .post-photos-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .author-avatar, .avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .author-name {
        font-size: 14px;
    }
    
    .article-title {
        font-size: 18px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    .article-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;

    .article-container {
        padding: 20px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .top-comment {
        flex-direction: column;
    }
    
    .tabs-wrapper {
        padding: 8px 0;
    }
    
    .tab-link {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Адаптив для модального окна фото */
    .photo-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 28px;
        padding: 12px;
    }
    
    .photo-nav-prev {
        left: 15px;
    }
    
    .photo-nav-next {
        right: 15px;
    }
    
    .close-photo-modal {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .photo-counter {
        bottom: 20px;
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .photo-modal-content img {
        max-width: 95%;
        max-height: 85%;
    }
}

@media (max-width: 480px) {
    .post-photos-gallery {
        grid-template-columns: 1fr;
    }
    
    .tabs-wrapper {
        flex-direction: column;
    }
    
    .tabs {
        width: 100%;
    }
    
    .create-btn {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    /* Адаптив для стрелок фото на очень маленьких экранах */
    .photo-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
        padding: 10px;
    }
    
    .photo-nav-prev {
        left: 10px;
    }
    
    .photo-nav-next {
        right: 10px;
    }
}
.article-meta a {
    color: #8a8aa0 !important;
    text-decoration: none !important;
    cursor: default !important;
}

.article-meta a:hover {
    color: #8a8aa0 !important;
    text-decoration: none !important;
    cursor: default !important;
}
.article-author-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a2a3e;
}

.article-author-info .author-avatar-link {
    text-decoration: none;
}

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

.article-author-info .avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    text-transform: uppercase;
}

.article-author-info .author-details {
    flex: 1;
}

.article-author-info .author-name {
    color: #a8a8ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.article-author-info .author-name:hover {
    color: white;
    text-decoration: underline;
}

.article-author-info .post-time {
    color: #8a8aa0;
    font-size: 12px;
}

/* Скрываем старый блок meta */
.article-meta {
    display: none;
}
body:has(.photo-modal[style*="display: flex"]) .sidebar-toggle-btn {
    display: none !important;
}
}