/* ========================================
   COMMENTS SIDEBAR
   ======================================== */

.comments-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.2s ease;
}

.comments-overlay.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.comments-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90%;
    height: 100%;
    background: var(--puna-bg);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--puna-muted);
    position: sticky;
    top: 0;
    background: var(--puna-bg);
    z-index: 10;
}

.comments-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--puna-text);
    margin: 0;
}

.close-comments-btn {
    background: none;
    border: none;
    color: var(--puna-text);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.close-comments-btn:hover {
    opacity: 0.7;
}

.close-comments-btn .icon-svg,
.close-comments-btn .icon-img {
    width: 18px;
    height: 18px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.close-comments-btn:hover .icon-svg,
.close-comments-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
    background: #d8d8d8;
    border-radius: 2px;
}

.comment-item {
    display: flex;
    padding: 12px 24px;
    gap: 12px;
    transition: background-color 0.2s;
    align-items: flex-start;
    position: relative;
}

.comment-item.comment-reply {
    padding-left: 52px; /* 24px base + 28px indent */
}

.comment-replies {
    margin-left: 0;
}

.show-more-replies-btn {
    background: none;
    border: none;
    color: rgba(22, 24, 35, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 24px;
    margin-left: 52px;
    transition: color 0.2s;
    text-align: left;
}

.show-more-replies-btn:hover {
    color: var(--puna-text);
}

.more-replies-container {
    display: none;
}

.more-replies-container.show {
    display: block;
}

.reply-input-container {
    padding: 12px 0;
    margin-top: 8px;
}

.reply-input-container .comment-input-container {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    position: relative;
}

.reply-input-container .comment-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--puna-muted);
    border-radius: 8px;
    background: var(--puna-muted);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.reply-input-container .comment-input:focus {
    background: var(--puna-bg);
    border-color: var(--puna-primary);
}

.reply-input-container .comment-input-actions {
    margin-top: 8px;
}

.cancel-reply-btn {
    padding: 8px 16px;
    background: none;
    color: rgba(22, 24, 35, 0.5);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-reply-btn:hover {
    background: var(--puna-muted);
    color: var(--puna-text);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--puna-bg);
    padding: 3px;
    border-radius: 50%;
    border: 2px solid var(--puna-primary);
}

.comment-content {
    flex: 1;
}

.comment-header {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--puna-text);
}

/* Comment Author Wrapper */
.comment-author-wrapper {
    display: inline-block;
    color: inherit;
}

/* Comment Avatar Wrapper */
.comment-avatar-wrapper {
    flex-shrink: 0;
    display: inline-block;
}

/* Comment Follow Button */
.comment-follow-btn {
    margin-left: 8px;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--puna-primary) 0%, color-mix(in srgb, var(--puna-primary) 80%, white) 100%);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    vertical-align: middle;
}

.comment-follow-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.comment-follow-btn.following {
    background: var(--puna-muted);
    color: var(--puna-text);
}


.comment-text {
    font-size: 14px;
    color: var(--puna-text);
    margin: 4px 0;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.comment-date {
    font-size: 14px;
    color: rgba(22, 24, 35, 0.5);
}

.reply-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--puna-text);
    text-decoration: none;
    transition: color 0.2s;
}

.reply-link:hover {
    color: var(--puna-primary);
}

.comment-likes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    contain: layout style paint;
}

.comment-likes.liking {
    animation: likePulse 0.3s ease;
}

@keyframes likePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.comment-likes .icon-svg,
.comment-likes .icon-img {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: var(--puna-text);
    cursor: pointer;
    transition: color 0.2s, opacity 0.2s ease, filter 0.2s ease;
}

.comment-likes:hover .icon-svg,
.comment-likes:hover .icon-img {
    color: var(--puna-primary);
}

.comment-likes.liked .icon-svg,
.comment-likes.liked .icon-img {
    color: var(--puna-primary);
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

/* Comment Action Buttons */
.comment-options-btn .icon-svg,
.comment-options-btn .icon-img {
    width: 16px;
    height: 16px;
    color: inherit;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.comment-options-btn:hover .icon-svg,
.comment-options-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.close-comments-btn .icon-svg {
    width: 18px;
    height: 18px;
    color: inherit;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.close-comments-btn:hover .icon-svg,
.close-comments-btn:active .icon-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
}

.comment-likes span {
    font-size: 12px;
    color: rgba(22, 24, 35, 0.5);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.comment-likes.liked span {
    color: var(--puna-primary);
}

.comment-right-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    align-self: flex-start;
}

.comment-actions {
    position: relative;
}

.comment-options-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(22, 24, 35, 0.75);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-options-btn:hover {
    background-color: rgba(22, 24, 35, 0.06);
    color: var(--puna-text);
}

.comment-options-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--puna-bg);
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.comment-options-dropdown.show {
    display: block;
}

.comment-action-delete,
.comment-action-report {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--puna-text);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.comment-action-delete:hover,
.comment-action-report:hover {
    background-color: var(--puna-muted);
}


.comment-action-delete {
    color: var(--puna-primary);
}

.comment-action-delete .icon-svg,
.comment-action-delete .icon-img {
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
    color: var(--puna-primary);
}

.comment-action-delete:hover {
    background-color: rgba(6, 83, 159, 0.08);
    color: var(--puna-primary);
}

.comment-action-report:hover {
    background-color: var(--puna-muted);
    color: var(--puna-text);
}

.comment-action-report .icon-svg,
.comment-action-report .icon-img {
    filter: none;
    color: currentColor;
    transition: filter 0.2s ease, color 0.2s ease;
}

.comment-action-report:hover .icon-svg,
.comment-action-report:hover .icon-img {
    filter: brightness(0) saturate(100%) invert(31%) sepia(98%) saturate(2479%) hue-rotate(202deg) brightness(97%) contrast(90%);
    color: var(--puna-primary);
}

.comment-action-report:hover {
    color: var(--puna-primary);
}

.no-comments {
    padding: 48px 24px;
    text-align: center;
    color: rgba(22, 24, 35, 0.5);
    font-size: 16px;
}

.comment-input-container {
    padding: 16px 24px;
    border-top: 1px solid var(--puna-muted);
    background: var(--puna-bg);
    position: sticky;
    bottom: 0;
}

.comment-input {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--puna-muted);
    font-size: 14px;
    outline: none;
    transition: background-color 0.2s;
}

.comment-input::placeholder {
    color: rgba(17, 24, 35, 0.5);
}

.comment-input:focus {
    background: var(--puna-muted);
}

.comment-input-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
    gap: 8px;
}

.comment-submit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.submit-comment-btn {
    padding: 8px 20px;
    background: #ffffff;
    color: var(--puna-primary);
    border: 1px solid var(--puna-primary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-comment-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--puna-primary) 0%, color-mix(in srgb, var(--puna-primary) 80%, white) 100%);
    color: #ffffff;
}

.submit-comment-btn:disabled {
    cursor: not-allowed;
}
