/* ==========================================================
   Discussion & Comment System Styles
   Uses footer theme variables from :root in style.css
   ========================================================== */

/* -- Typography: Desktop 16px, Mobile 14px -- */
.discussion-comments .commenttext,
.discussion-comments .comment-reply-textarea,
.discussion-comments .comment-textarea {
    font-size: 16px;
    line-height: 1.6;
    color: var(--footer-text-secondary);
}

.discussion-comments .comment-username {
    font-size: 16px;
    font-weight: 600;
    color: var(--footer-text-primary);
}

.discussion-comments .comment-timestamp {
    font-size: 13px;
    color: var(--footer-text-tertiary);
}

@media (max-width: 768px) {
    .discussion-comments .commenttext,
    .discussion-comments .comment-reply-textarea,
    .discussion-comments .comment-textarea {
        font-size: 14px;
        line-height: 1.5;
    }

    .discussion-comments .comment-username {
        font-size: 14px;
    }

    .discussion-comments .comment-timestamp {
        font-size: 12px;
    }
}

/* -- Author Badge (teal theme) -- */
.author-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    background: var(--footer-accent-medium) !important;
    color: var(--footer-primary-color) !important;
    border: 1px solid var(--footer-border-color);
}

/* -- Pinned Badge -- */
.pinned-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1)) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* -- Edited label -- */
.comment-edited-label {
    font-size: 11px;
    color: var(--footer-text-tertiary);
}

/* -- Pinned Comment highlight -- */
.commentbox.border-start.border-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.04), transparent);
    border-left-color: #fbbf24 !important;
}

/* -- Reply container indentation -- */
.reply-comment.commentbox {
    margin-left: 1rem !important;
    padding: 0.6rem 0.8rem;
    border-left: 2px solid var(--footer-border-color);
    background-color: var(--footer-accent-light);
}

@media (max-width: 576px) {
    .reply-comment.commentbox {
        margin-left: 0.5rem !important;
    }
}

/* ── Action Buttons ── */

/* Reply button (teal ghost) */
.comment-btn-reply {
    background: transparent;
    border: 1px solid var(--footer-border-color);
    color: var(--footer-text-tertiary);
    border-radius: 20px;
    padding: 3px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

/* Edit button (teal ghost icon) */
.comment-btn-edit {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--footer-border-color);
    background: var(--footer-section-bg);
    color: var(--footer-text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.comment-btn-edit:hover {
    background: var(--footer-accent-light);
    border-color: var(--footer-primary-color);
    color: var(--footer-primary-color);
}

/* Delete button (red ghost icon) */
.comment-btn-delete {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--footer-border-color);
    background: var(--footer-section-bg);
    color: var(--footer-text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.comment-btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Pin button (gold ghost icon) */
.comment-btn-pin {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--footer-border-color);
    background: var(--footer-section-bg);
    color: var(--footer-text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.comment-btn-pin:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

.comment-btn-pin.is-pinned {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

/* Admin delete link */
.comment-admin-delete {
    color: var(--footer-text-tertiary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.comment-admin-delete:hover {
    color: #ef4444;
}

/* ── Form Buttons ── */

/* Submit / Save (primary teal) */
.comment-btn-submit {
    background: var(--footer-primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.comment-btn-submit:hover {
    background: var(--footer-accent-color);
    transform: translateY(-1px);
    box-shadow: var(--footer-shadow);
}

/* Cancel (ghost) */
.comment-btn-cancel {
    background: transparent;
    border: 1px solid var(--footer-border-color);
    color: var(--footer-text-tertiary);
    border-radius: 8px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.comment-btn-cancel:hover {
    background: var(--footer-accent-light);
    border-color: var(--footer-primary-color);
    color: var(--footer-primary-color);
}

/* ── Reply form & Edit form styling ── */
.comment-reply-textarea {
    background: var(--footer-section-bg) !important;
    border: 1px solid var(--footer-border-color) !important;
    border-radius: 8px;
    color: var(--footer-text-primary) !important;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
}

.comment-reply-textarea:focus {
    border-color: var(--footer-primary-color) !important;
    box-shadow: 0 0 0 3px var(--footer-accent-light) !important;
    outline: none;
}

.comment-reply-textarea::placeholder {
    color: var(--footer-text-tertiary);
}

/* Comment form main textarea */
.comment-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Replies container ── */
.replies-container {
    margin-top: 0.5rem;
}

.replies-container .commentbox {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

/* ── Smooth transitions ── */
.discussion-comments .commentbox {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* ── Target highlight when navigating from notification ── */
.commentbox:target {
    animation: highlightComment 2s ease-out;
}

@keyframes highlightComment {
    from {
        background-color: var(--footer-accent-medium);
        box-shadow: 0 0 0 3px var(--footer-accent-light);
    }
    to {
        background-color: transparent;
        box-shadow: none;
    }
}

/* ── Mobile responsive for action buttons ── */
@media (max-width: 576px) {
    .comment-btn-edit,
    .comment-btn-delete,
    .comment-btn-pin {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .comment-btn-reply {
        font-size: 12px;
        padding: 2px 10px;
    }

    .comment-btn-submit,
    .comment-btn-cancel {
        font-size: 12px;
        padding: 5px 14px;
    }
}
