/* =====================================================
   Comments Section
   ===================================================== */

.comments-section {
    padding: clamp(16px, 3vw, 24px);
    border-top: 1px solid var(--border-subtle);
}

.comments-header {
    margin-bottom: 16px;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong);
}

.comments-title i {
    color: var(--accent);
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent-strong);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Comment Form - Minimal Design (Upward Expanding) */
.comment-form {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
}

.comment-form__avatar {
    display: none;
}

.comment-form__input-group {
    display: flex;
    align-items: flex-end;
    gap: 0;
    position: relative;
    background: var(--surface);
    border: 2px solid var(--border-subtle);
    border-radius: 24px;
    padding: 0 4px 0 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form__input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(87, 142, 126, 0.15);
}

.comment-form__textarea {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 10px 0;
    margin: 0;
    resize: none;
    min-height: 40px;
    max-height: 130px;
    line-height: 1.5;
    color: var(--text-strong);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.comment-form__textarea::-webkit-scrollbar {
    width: 4px;
}

.comment-form__textarea::-webkit-scrollbar-track {
    background: transparent;
}

.comment-form__textarea::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.comment-form__textarea::placeholder {
    color: var(--text-muted);
}

.comment-form__textarea:focus {
    outline: none;
    box-shadow: none;
}

.comment-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 2px 0;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.comment-form__submit i {
    margin: 0;
}

.comment-form.has-text .comment-form__submit {
    opacity: 1;
    transform: scale(1);
}

.comment-form__submit:hover {
    background: var(--accent-strong);
    transform: scale(1.05);
}

.comment-form__submit:active {
    transform: scale(0.95);
}

/* Comments List */
.comments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Individual Comment */
.comment {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius-medium);
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.comment:hover {
    background: var(--surface-subtle);
    border-color: var(--border-subtle);
}

.comment__avatar {
    flex-shrink: 0;
}

.comment__avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface-subtle);
}

.comment__content {
    flex: 1;
    min-width: 0;
}

.comment__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.comment__author {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-strong);
}

.comment__time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment__text {
    margin: 0 0 10px;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-medium);
}

/* Comment Actions */
.comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.comment-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-action:hover {
    background: var(--surface-subtle);
    border-color: var(--text-muted);
    color: var(--text-medium);
}

.comment-action--like:hover,
.comment-action--like[aria-pressed="true"] {
    background: var(--like-bg);
    border-color: var(--like-color);
    color: var(--like-color);
}

.comment-action--like[aria-pressed="true"] {
    font-weight: 600;
}

.comment-action--reply:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.comment-action--report:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* =====================================================
   Replies
   ===================================================== */

.replies-container {
    margin-top: 10px;
    padding-left: 0;
}

.replies-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--accent-light);
    border: none;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-strong);
    cursor: pointer;
    transition: background 0.2s ease;
}

.replies-toggle:hover {
    background: rgba(37, 99, 235, 0.18);
}

.replies-toggle i {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.replies-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.replies-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: slideDown 0.3s ease;
}

/* Individual Reply */
.reply {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    margin-left: 16px;
    background: rgba(241, 245, 249, 0.6);
    border-radius: var(--radius-small);
    border-left: 3px solid var(--accent-light);
}

.reply__avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
}

.reply__content {
    flex: 1;
    min-width: 0;
}

.reply__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.reply__author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-strong);
}

.reply__time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.reply__text {
    margin: 0 0 6px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-medium);
}

.reply__actions {
    display: flex;
    gap: 5px;
}

.reply__actions .comment-action {
    padding: 3px 8px;
    font-size: 0.7rem;
}

/* Reply Form */
.reply-form {
    display: flex;
    gap: 6px;
    margin: 10px 0 0 16px;
    padding: 8px;
    background: var(--surface);
    border-radius: var(--radius-small);
    border: 1px solid var(--border-subtle);
}

.reply-form__input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 0.8rem;
    transition: border-color 0.2s ease;
}

.reply-form__input:focus {
    outline: none;
    border-color: var(--accent);
}

.reply-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.reply-form__submit:hover {
    background: var(--accent-strong);
    transform: scale(1.05);
}

/* Load More Button */
.comments-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: var(--surface-subtle);
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-medium);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.comments-load-more:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-strong);
}