/* Контейнер статьи */
.wiki-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.wiki-article {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.wiki-meta {
    display: flex;
    gap: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
    margin: 1rem 0 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

/* Секция комментариев */
.comments-section {
    background: white;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
}

.comments-count {
    background: #f97316;
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.9rem;
}

/* Форма комментария */
.comment-form-container {
    background: #f8fafc;
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    border: 1px solid #e2e8f0;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.comment-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    resize: vertical;
    min-height: 100px;
}

.comment-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-comment-submit {
    background: linear-gradient(120deg, #f97316, #fb923c);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.btn-comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.btn-comment-submit:active {
    transform: translateY(0);
}

/* Карточка комментария */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    position: relative;
}

.comment-card:hover {
    border-color: #f97316;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

/* Заголовок комментария */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #f97316, #fb923c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.comment-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Действия с комментарием */
.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.action-btn:hover {
    opacity: 1;
    background: #f1f5f9;
    transform: scale(1.1);
}

.edit-btn:hover {
    background: #dbeafe;
    color: #2563eb;
}

.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Текст комментария */
.comment-content {
    color: #334155;
    line-height: 1.6;
    font-size: 1rem;
    padding: 0.5rem 0 0 4rem; /* Отступ под аватар */
    white-space: pre-wrap;
}

/* Форма редактирования */
.edit-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 20px;
}

.edit-comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edit-input {
    min-height: 80px;
}

.edit-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.save-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: #059669;
    transform: translateY(-2px);
}

.cancel-btn {
    background: #e2e8f0;
    color: #64748b;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #cbd5e1;
    color: #475569;
}

/* Пустые комментарии */
.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8fafc;
    border-radius: 24px;
    color: #64748b;
    font-size: 1.1rem;
    border: 2px dashed #e2e8f0;
}

/* Приглашение к входу */
.comment-login-prompt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 2rem;
}

.comment-login-prompt a {
    color: white;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .comment-header {
        flex-direction: column;
        gap: 1rem;
    }

    .comment-content {
        padding-left: 0;
    }

    .comment-author {
        width: 100%;
    }

    .comment-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-footer {
        justify-content: stretch;
    }

    .btn-comment-submit {
        width: 100%;
        justify-content: center;
    }
}