/**
 * Comentario NX Avancado - Estilos Avancados
 * Design baseado no frontend React
 */

/* ===== VARIAVEIS ===== */
:root {
    --cnx-bg: #0a0a0a;
    --cnx-bg-card: rgba(24, 24, 27, 0.9);
    --cnx-bg-input: #18181b;
    --cnx-border: rgba(255, 255, 255, 0.05);
    --cnx-border-hover: rgba(255, 255, 255, 0.1);
    --cnx-text: #e5e5e5;
    --cnx-text-muted: #a3a3a3;
    --cnx-text-dim: #71717a;
    --cnx-primary: #6366f1;
    --cnx-green: #22c55e;
    --cnx-red: #ef4444;
    --cnx-yellow: #facc15;
    --cnx-yellow-glow: rgba(234, 179, 8, 0.15);
}

/* ===== RESET BASE ===== */
.cnx-comments-area *,
.cnx-comments-area *::before,
.cnx-comments-area *::after {
    box-sizing: border-box;
}

.cnx-comments-area {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--cnx-text);
    line-height: 1.5;
}

/* ===== SECTION REACTIONS (O QUE VOCE ACHOU?) ===== */
.cnx-chapter-reactions {
    padding: 1.5rem;
    text-align: center;
    background: var(--cnx-bg-card);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.cnx-reactions-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.cnx-reactions-count {
    font-size: 0.875rem;
    color: var(--cnx-text-muted);
    margin-bottom: 1rem;
}

.cnx-reactions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .cnx-reactions-row {
        gap: 2.5rem;
    }
}

.cnx-reaction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnx-reaction-item:hover .cnx-reaction-icon {
    transform: scale(1.05);
}

.cnx-reaction-item.active .cnx-reaction-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.5));
}

.cnx-reaction-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cnx-reaction-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-reaction-icon {
        width: 3rem;
        height: 3rem;
        font-size: 2.5rem;
    }
}

.cnx-reaction-icon svg {
    width: 2rem;
    height: 2rem;
    color: var(--cnx-text-muted);
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-reaction-icon svg {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.cnx-reaction-item:hover .cnx-reaction-icon svg {
    color: white;
}

.cnx-reaction-item.active .cnx-reaction-icon svg {
    color: var(--cnx-yellow);
}

.cnx-reaction-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cnx-text-muted);
    transition: color 0.2s ease;
}

.cnx-reaction-item.active .cnx-reaction-label {
    color: var(--cnx-yellow);
}

.cnx-reaction-num {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cnx-text-muted);
    min-width: 1.5rem;
    text-align: center;
}

.cnx-reaction-item.active .cnx-reaction-num {
    color: var(--cnx-yellow);
}

.cnx-reaction-item:hover .cnx-reaction-num {
    color: white;
}

.cnx-reactions-login-hint {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--cnx-text-dim);
}

/* ===== COMMENTS SECTION ===== */
.cnx-comments-section {
    margin-top: 2rem;
}

/* Header */
.cnx-comments-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 480px) {
    .cnx-comments-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.cnx-comments-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

@media (min-width: 640px) {
    .cnx-comments-title {
        font-size: 1.25rem;
    }
}

.cnx-comments-title svg {
    width: 1rem;
    height: 1rem;
}

@media (min-width: 640px) {
    .cnx-comments-title svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.cnx-sort-select {
    background: var(--cnx-bg-input);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

@media (min-width: 640px) {
    .cnx-sort-select {
        font-size: 0.875rem;
        padding: 0.625rem 2.5rem 0.625rem 1rem;
    }
}

.cnx-sort-select:focus {
    outline: none;
    border-color: var(--cnx-border-hover);
}

/* ===== COMMENT FORM ===== */
.cnx-comment-form-wrapper {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .cnx-comment-form-wrapper {
        gap: 1rem;
    }
}

.cnx-form-avatar {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
}

@media (min-width: 640px) {
    .cnx-form-avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
}

.cnx-form-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--cnx-border);
    background: var(--cnx-bg-input);
}

.cnx-comment-form {
    flex: 1;
    min-width: 0;
}

/* Toolbar de Formatacao */
.cnx-form-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.cnx-toolbar-btn {
    padding: 0.375rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnx-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.cnx-toolbar-btn svg {
    width: 0.875rem;
    height: 0.875rem;
    display: block;
}

@media (min-width: 640px) {
    .cnx-toolbar-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

.cnx-toolbar-divider {
    width: 1px;
    height: 1rem;
    background: var(--cnx-border);
    margin: 0 0.25rem;
}

/* Textarea */
.cnx-comment-textarea {
    width: 100%;
    background: var(--cnx-bg-input);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    color: white;
    resize: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

@media (min-width: 640px) {
    .cnx-comment-textarea {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

.cnx-comment-textarea::placeholder {
    color: var(--cnx-text-dim);
}

.cnx-comment-textarea:focus {
    outline: none;
    border-color: var(--cnx-border-hover);
}

/* Form Footer */
.cnx-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.cnx-form-hints {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cnx-char-count {
    font-size: 0.625rem;
    color: var(--cnx-text-dim);
}

@media (min-width: 640px) {
    .cnx-char-count {
        font-size: 0.75rem;
    }
}

.cnx-format-hints {
    display: none;
    font-size: 0.625rem;
    color: var(--cnx-text-dim);
}

@media (min-width: 640px) {
    .cnx-format-hints {
        display: block;
        font-size: 0.75rem;
    }
}

.cnx-submit-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: black;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-submit-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

.cnx-submit-btn:hover {
    background: #e5e5e5;
}

.cnx-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cnx-submit-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Login Prompt */
.cnx-login-prompt {
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    padding: 1.5rem 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cnx-login-prompt p {
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    margin: 0 0 0.75rem 0;
}

@media (min-width: 640px) {
    .cnx-login-prompt p {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
}

.cnx-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: black;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-login-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

.cnx-login-btn:hover {
    background: #e5e5e5;
}

/* ===== COMMENT LIST ===== */
.cnx-comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cnx-comments-list {
        gap: 1rem;
    }
}

/* Empty State */
.cnx-comments-empty {
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
}

.cnx-comments-empty svg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--cnx-text-dim);
    margin: 0 auto 0.75rem;
}

@media (min-width: 640px) {
    .cnx-comments-empty svg {
        width: 3rem;
        height: 3rem;
    }
}

.cnx-comments-empty p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--cnx-text-muted);
}

.cnx-comments-empty .cnx-empty-subtitle {
    font-size: 0.75rem;
    color: var(--cnx-text-dim);
    margin-top: 0.25rem;
}

/* ===== SINGLE COMMENT ===== */
.cnx-comment {
    position: relative;
}

.cnx-comment-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--cnx-bg-card);
    border: 1px solid var(--cnx-border);
}

.cnx-comment-card.cnx-vip {
    border-color: rgba(234, 179, 8, 0.2);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.12);
}

@media (min-width: 640px) {
    .cnx-comment-card.cnx-vip {
        box-shadow: 0 0 15px rgba(234, 179, 8, 0.15);
    }
}

/* Banner Background */
.cnx-comment-banner {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.cnx-comment-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.75), rgba(0,0,0,0.9));
}

.cnx-comment-inner {
    position: relative;
    z-index: 1;
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .cnx-comment-inner {
        padding: 0.625rem;
    }
}

/* Comment Header */
.cnx-comment-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .cnx-comment-header {
        gap: 0.625rem;
    }
}

/* Avatar Container */
.cnx-avatar-container {
    position: relative;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: block;
}

@media (min-width: 640px) {
    .cnx-avatar-container {
        width: 2.25rem;
        height: 2.25rem;
    }
}

.cnx-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--cnx-border);
    background: var(--cnx-bg-input);
}

.cnx-avatar-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    object-fit: contain;
    pointer-events: none;
}

@media (min-width: 640px) {
    .cnx-avatar-frame {
        width: 64px;
        height: 64px;
    }
}

/* User Info */
.cnx-comment-body {
    flex: 1;
    min-width: 0;
}

.cnx-user-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.cnx-rank-icon {
    width: 1rem;
    height: 1rem;
}

@media (min-width: 640px) {
    .cnx-rank-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.cnx-username {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .cnx-username {
        font-size: 0.875rem;
        max-width: none;
    }
}

.cnx-username:hover {
    opacity: 0.8;
}

/* Badges */
.cnx-badge {
    padding: 0.125rem 0.375rem;
    font-size: 0.5rem;
    font-weight: 700;
    border-radius: 0.25rem;
}

@media (min-width: 640px) {
    .cnx-badge {
        padding: 0.125rem 0.5rem;
        font-size: 0.625rem;
    }
}

.cnx-badge-vip {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.cnx-badge-staff {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.cnx-badge-custom {
    padding: 0.125rem 0.375rem;
    font-size: 0.5rem;
    font-weight: 700;
    border-radius: 0.25rem;
}

/* Time */
.cnx-comment-time {
    font-size: 0.625rem;
    color: var(--cnx-text-dim);
    margin-left: auto;
}

@media (min-width: 640px) {
    .cnx-comment-time {
        font-size: 0.75rem;
        margin-left: 0;
    }
}

.cnx-edited-flag {
    margin-left: 0.25rem;
    color: var(--cnx-text-dim);
    display: none;
}

@media (min-width: 640px) {
    .cnx-edited-flag {
        display: inline;
    }
}

/* Reply To */
.cnx-reply-to {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: rgba(24, 24, 27, 0.8);
    border-radius: 0.25rem;
    font-size: 0.625rem;
    color: var(--cnx-text-muted);
}

@media (min-width: 640px) {
    .cnx-reply-to {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
}

.cnx-reply-to svg {
    width: 0.625rem;
    height: 0.625rem;
}

@media (min-width: 640px) {
    .cnx-reply-to svg {
        width: 0.75rem;
        height: 0.75rem;
    }
}

.cnx-reply-to-user {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.cnx-reply-to-user:hover {
    text-decoration: underline;
}

.cnx-reply-to-avatar {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    object-fit: cover;
}

@media (min-width: 640px) {
    .cnx-reply-to-avatar {
        width: 1.125rem;
        height: 1.125rem;
    }
}

/* Comment Content */
.cnx-comment-content {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--cnx-text);
    line-height: 1.5;
    word-wrap: break-word;
}

.cnx-comment-content p {
    margin: 0;
    padding: 0;
}

@media (min-width: 640px) {
    .cnx-comment-content {
        font-size: 0.875rem;
    }
}

/* Spoiler Text */
.cnx-spoiler {
    padding: 0 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #52525b;
    color: transparent;
}

.cnx-spoiler:hover {
    background: #71717a;
}

.cnx-spoiler.revealed {
    background: rgba(82, 82, 91, 0.5);
    color: var(--cnx-text);
}

/* Comment Images */
.cnx-comment-images {
    margin-top: 0.75rem;
}

.cnx-comment-img {
    max-width: 100%;
    max-height: 12rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-comment-img {
        max-height: 16rem;
    }
}

.cnx-comment-img:hover {
    opacity: 0.9;
}

/* Spoiler Image */
.cnx-spoiler-img-container {
    position: relative;
    display: inline-block;
    margin: 0.5rem 0;
}

.cnx-spoiler-img {
    max-width: 100%;
    max-height: 12rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: filter 0.3s ease;
    filter: blur(20px);
}

@media (min-width: 640px) {
    .cnx-spoiler-img {
        max-height: 16rem;
    }
}

.cnx-spoiler-img.revealed {
    filter: blur(0);
}

.cnx-spoiler-img-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.cnx-spoiler-img-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.cnx-spoiler-img-overlay svg {
    width: 1.5rem;
    height: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .cnx-spoiler-img-overlay svg {
        width: 2rem;
        height: 2rem;
    }
}

.cnx-spoiler-img-overlay span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* ===== COMMENT ACTIONS ===== */
.cnx-comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    flex-wrap: wrap;
}

.cnx-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem;
    margin: -0.375rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnx-action-btn:hover {
    color: white;
}

.cnx-action-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.cnx-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cnx-action-btn svg {
    width: 1rem;
    height: 1rem;
}

.cnx-action-btn.liked {
    color: var(--cnx-green);
}

.cnx-action-btn.liked svg {
    fill: currentColor;
}

.cnx-action-btn.disliked {
    color: var(--cnx-red);
}

.cnx-action-btn.disliked svg {
    fill: currentColor;
}

/* Score */
.cnx-score {
    min-width: 20px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cnx-text-muted);
}

.cnx-score.positive {
    color: var(--cnx-green);
}

.cnx-score.negative {
    color: var(--cnx-red);
}

/* Divider */
.cnx-action-divider {
    width: 1px;
    height: 1rem;
    background: var(--cnx-border);
}

/* Reply action text */
.cnx-action-text {
    display: none;
}

@media (min-width: 480px) {
    .cnx-action-text {
        display: inline;
    }
}

/* Edit/Delete actions */
.cnx-action-btn[data-action="edit"]:hover {
    color: var(--cnx-yellow);
}

.cnx-action-btn[data-action="delete"]:hover {
    color: var(--cnx-red);
}

/* Edit mode textarea */
.cnx-edit-form {
    margin-top: 0.5rem;
}

.cnx-edit-textarea {
    width: 100%;
    background: var(--cnx-bg-input);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    color: white;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .cnx-edit-textarea {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

.cnx-edit-textarea:focus {
    outline: none;
    border-color: var(--cnx-border-hover);
}

.cnx-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cnx-edit-cancel-btn {
    padding: 0.375rem 0.625rem;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.cnx-edit-cancel-btn:hover {
    color: white;
}

.cnx-edit-save-btn {
    padding: 0.375rem 0.625rem;
    background: var(--cnx-yellow);
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: black;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cnx-edit-save-btn:hover {
    background: #eab308;
}

.cnx-edit-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Delete confirmation */
.cnx-delete-confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
}

.cnx-delete-confirm-text {
    flex: 1;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
}

.cnx-delete-confirm-btn {
    padding: 0.25rem 0.5rem;
    background: var(--cnx-red);
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cnx-delete-confirm-btn:hover {
    background: #dc2626;
}

.cnx-delete-cancel-btn {
    padding: 0.25rem 0.5rem;
    background: none;
    border: 1px solid var(--cnx-border);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
}

.cnx-delete-cancel-btn:hover {
    color: white;
    border-color: var(--cnx-border-hover);
}

/* Comment editing state */
.cnx-comment.editing .cnx-comment-content {
    display: none;
}

/* Deleted comment fade out */
.cnx-comment.deleting {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== REPLIES ===== */
.cnx-replies-container {
    margin-top: 0.75rem;
    margin-left: 2rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(99, 102, 241, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    .cnx-replies-container {
        margin-left: 2.5rem;
        padding-left: 1rem;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
}

/* Resposta de resposta - sem degrau extra */
.cnx-replies-container .cnx-replies-container {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.cnx-replies {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cnx-reply {
    position: relative;
}

/* Reply card */
.cnx-reply .cnx-comment-card {
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid var(--cnx-border);
}

.cnx-reply .cnx-comment-inner {
    padding: 0.375rem;
}

@media (min-width: 640px) {
    .cnx-reply .cnx-comment-inner {
        padding: 0.5rem;
    }
}

/* Reply avatar smaller */
.cnx-reply .cnx-avatar-container {
    width: 1.5rem;
    height: 1.5rem;
}

@media (min-width: 640px) {
    .cnx-reply .cnx-avatar-container {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Reply connection line */
.cnx-reply-line {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1rem;
    display: flex;
    justify-content: center;
}

@media (min-width: 640px) {
    .cnx-reply-line {
        width: 1.5rem;
    }
}

.cnx-reply-line::before {
    content: '';
    width: 2px;
    height: 100%;
    background: rgba(82, 82, 91, 0.5);
}

.cnx-reply-content {
    margin-left: 1rem;
    padding-left: 0.5rem;
}

@media (min-width: 640px) {
    .cnx-reply-content {
        margin-left: 1.5rem;
        padding-left: 1rem;
    }
}

/* ===== REPLY FORM ===== */
.cnx-reply-form-wrapper {
    margin-left: 2rem;
    padding-left: 0.75rem;
    margin-top: 0.75rem;
    border-left: 2px solid rgba(99, 102, 241, 0.5);
}

@media (min-width: 640px) {
    .cnx-reply-form-wrapper {
        margin-left: 2.5rem;
        padding-left: 1rem;
    }
}

.cnx-reply-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cnx-reply-form .cnx-form-avatar {
    width: 1.75rem;
    height: 1.75rem;
}

@media (min-width: 640px) {
    .cnx-reply-form .cnx-form-avatar {
        width: 2rem;
        height: 2rem;
    }
}

.cnx-reply-form-content {
    flex: 1;
}

.cnx-reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cnx-cancel-btn {
    padding: 0.375rem 0.625rem;
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-cancel-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

.cnx-cancel-btn:hover {
    color: white;
}

.cnx-reply-submit-btn {
    padding: 0.375rem 0.625rem;
    background: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: black;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

@media (min-width: 640px) {
    .cnx-reply-submit-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

.cnx-reply-submit-btn:hover {
    background: #e5e5e5;
}

.cnx-reply-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== IMAGE UPLOAD ===== */
.cnx-image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cnx-image-preview {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
}

.cnx-image-preview img {
    height: 3rem;
    width: auto;
    border-radius: 0.25rem;
    border: 1px solid var(--cnx-border);
}

@media (min-width: 640px) {
    .cnx-image-preview img {
        height: 4rem;
    }
}

.cnx-preview-remove {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 1.125rem;
    height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cnx-red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cnx-preview-remove:hover {
    background: #dc2626;
}

.cnx-spoiler-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(82, 82, 91, 0.5);
    border: 1px solid var(--cnx-border);
    color: var(--cnx-text-muted);
}

@media (min-width: 640px) {
    .cnx-spoiler-toggle {
        font-size: 0.75rem;
    }
}

.cnx-spoiler-toggle.active {
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.3);
    color: var(--cnx-yellow);
}

.cnx-spoiler-toggle svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ===== LOAD MORE ===== */
.cnx-load-more {
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .cnx-load-more {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

.cnx-load-more:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.cnx-load-more svg {
    width: 0.875rem;
    height: 0.875rem;
}

@media (min-width: 640px) {
    .cnx-load-more svg {
        width: 1rem;
        height: 1rem;
    }
}

/* ===== LOADING SPINNER ===== */
.cnx-loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.cnx-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: cnx-spin 0.8s linear infinite;
}

@media (min-width: 640px) {
    .cnx-spinner {
        width: 2rem;
        height: 2rem;
    }
}

@keyframes cnx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== NOTICES ===== */
.cnx-notice {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    padding: 0.75rem 1.5rem;
    background: var(--cnx-bg-card);
    border: 1px solid var(--cnx-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--cnx-text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.cnx-notice.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cnx-notice.error {
    border-color: var(--cnx-red);
    background: rgba(239, 68, 68, 0.1);
}

.cnx-notice.success {
    border-color: var(--cnx-green);
    background: rgba(34, 197, 94, 0.1);
}

/* ===== LIGHTBOX ===== */
.cnx-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cnx-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.cnx-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 0.5rem;
}

.cnx-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cnx-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== FILE INPUT HIDDEN ===== */
.cnx-file-input {
    display: none;
}

/* ===== PAGINATION ===== */
.cnx-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.cnx-page-btn {
    min-width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cnx-bg-input);
    border: 1px solid var(--cnx-border);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: var(--cnx-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cnx-page-btn:hover {
    border-color: var(--cnx-border-hover);
    color: white;
}

.cnx-page-btn.active {
    background: white;
    color: black;
    border-color: white;
}

.cnx-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
