/* Advanced Comments System for Melodesign */

.comments-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

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

.comments-sort {
    display: flex;
    gap: 1rem;
}

.sort-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.sort-btn.active {
    background: var(--color-bg-secondary);
    color: var(--color-progress);
    font-weight: bold;
}

/* Comment Item */
.comment-item {
    margin-bottom: 1.5rem;
    position: relative;
}

.comment-main {
    background: var(--color-bg-secondary);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comment-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--color-shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

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

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.author-name {
    font-weight: 600;
    color: var(--color-text-main);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.comment-text {
    color: var(--color-text-main);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* Actions: Voting & Reply */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
}

.vote-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-bg-main);
    padding: 4px 12px;
    border-radius: 20px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--color-progress);
}

.action-btn.voted-up svg {
    fill: var(--color-success);
    stroke: var(--color-success);
}

.action-btn.voted-down svg {
    fill: var(--color-error);
    stroke: var(--color-error);
}

.vote-count {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--color-text-main);
    display: inline-block;
}

.reply-btn {
    font-weight: 500;
}

/* Nested Comments */
.comment-replies {
    margin-right: 2.5rem;
    margin-top: 1rem;
    padding-right: 1.5rem;
    border-right: 2px solid var(--color-border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comment-replies {
        margin-right: 1rem;
        padding-right: 1rem;
    }
    
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.comment-item {
    animation: slideIn 0.4s ease-out forwards;
}

/* Comment Form Enhancement */
.comment-form-container {
    background: var(--color-bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    margin-bottom: 3rem;
}

.comment-form-container h4 {
    margin-bottom: 1.25rem;
}

.form-group textarea {
    width: 100%;
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--color-text-main);
    resize: vertical;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus {
    border-color: var(--color-progress);
    outline: none;
}
