﻿/* Comments style */

.comment-item {
    max-width: 100% !important;
    align-self: flex-start;
}

.comment-item-reply {
    max-width: 100%;
}

/* Comments sort menu — replicate the MudSelect dropdown panel & items
   (.select-popover styling) while keeping the original text-button header. */
.comments-sort-popover:not(:empty) {
    box-shadow: 0px 4px 15px 0px var(--mud-palette-medium-gray-20O) !important;
}

.comments-sort-popover .mud-menu-list {
    padding: 0.5rem;
    background-color: var(--mud-palette-primary-surface-light);
}

.comments-sort-popover .mud-menu-item {
    border-radius: 0.4rem !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    gap: 0.4rem;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.comments-sort-popover .mud-menu-item:not(:last-child) {
    margin-bottom: 0.3rem !important;
}

.comments-sort-popover .mud-menu-item:hover {
    background-color: var(--mud-palette-secondary-blue-80O);
}

.comments-sort-popover .mud-menu-item:hover,
.comments-sort-popover .mud-menu-item:hover .mud-menu-item-text {
    color: var(--mud-palette-primary-surface-light) !important;
}

.comments-sort-popover .mud-selected-item,
.comments-sort-popover .mud-selected-item:hover {
    background-color: var(--mud-palette-secondary-blue) !important;
}

.comments-sort-popover .mud-selected-item,
.comments-sort-popover .mud-selected-item:hover,
.comments-sort-popover .mud-selected-item .mud-menu-item-text,
.comments-sort-popover .mud-selected-item:hover .mud-menu-item-text {
    color: var(--mud-palette-primary-surface-light) !important;
}

.text-comment-author {
    font-size: 0.8rem !important;
}

.text-comment-time {
    font-size: 0.7rem !important;
}

.text-comment-content {
    text-align: justify;
}

.text-reply-author {
    font-size: 0.75rem !important;
}


.comment-reply-button {
    margin-top: 0.4rem !important;
}

/* Comment action row: Like, Reply, Delete aligned left below the comment content */
.comment-actions {
    margin-top: 0.4rem !important;
    gap: 1.25rem;
}

/* Each action group: count sits to the left of its icon */
.comment-action {
    gap: 0.25rem;
}

    /* Smooth, consistent transition for the reply & delete icons */
    .comment-action .reply-btn,
    .comment-action .delete-btn {
        transition: transform 0.2s ease, color 0.2s ease !important;
    }

    /* Reply: mirror the default left-facing icon so the arrow points to the right */
    .comment-action .reply-btn {
        transform: scaleX(-1);
    }

    /* Reply: subtle lift on hover (keep the mirror, no color change) */
    .comment-action .reply-btn:hover {
        transform: scaleX(-1) scale(1.12);
    }

    /* Delete: turns red on hover */
    .comment-action .delete-btn:hover {
        color: var(--mud-palette-danger-red) !important;
        transform: scale(1.12);
    }

.avatar-comment {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
}

.avatar-reply {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.7rem !important;
}

.loading-comment {
    display: flex !important;
    align-items: center;
    flex-direction: row;
}

.comment-animated-grid {
    display: grid !important;
    grid-template-columns: 0fr 1fr;
    align-items: center;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

    .comment-animated-grid.loading-visible {
        grid-template-columns: 40px 1fr;
    }

    .comment-animated-grid.error-visible {
        grid-template-columns: 40px 1fr;
    }

.comment-loader {
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 1;
}

.comment-animated-grid:not(.loading-visible):not(.error-visible) .comment-loader {
    opacity: 0;
}

.comment-content {
    display: flex;
    align-items: center;
    flex-direction: row;
    width: 100%;
}

.comment-content .mud-container {
    width: auto;
}

.comment-flash-success {
    background-color: color-mix(in srgb, var(--mud-palette-success-green) 20%, white 80%) !important;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 0.5rem;
}

.replies-container {
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

    .replies-container.replies-open {
        height: auto;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        padding-left: 1rem;
    }

