﻿/* ═══ PERFORMANCE OPTIMIZED COMMENT STYLES ═══ */
.comments-section {
    margin-top: 4rem;
    padding: 0 1.5rem;
}

.comments-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.comments-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comments-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: var(--text, #f0eeff);
    letter-spacing: 1px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-title-icon {
    font-size: 1.8rem;
}

.comments-count {
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted, #94a3b8);
    background: rgba(108, 43, 217, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(108, 43, 217, 0.2);
}

.comments-sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sort-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(108, 43, 217, 0.3);
    color: var(--text, #f0eeff);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    /* ✅ Removed transition for performance */
}

    .sort-select:hover,
    .sort-select:focus {
        border-color: #6c2bd9;
        background: rgba(108, 43, 217, 0.1);
        outline: none;
    }

    .sort-select option {
        background: #1a1a2e;
        color: #f0eeff;
    }

/* Comment Form */
.comment-form-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(108, 43, 217, 0.2);
    border-radius: 16px;
    /* ✅ Removed backdrop-filter (expensive) */
}

.comment-form-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6c2bd9, #1a6bff);
    box-shadow: 0 4px 12px rgba(108, 43, 217, 0.3);
    position: relative;
    overflow: hidden;
    /* ✅ Add GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
}

    /* ✅ Simplified animation (less expensive) */
    .comment-form-avatar::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(127, 80, 226, 0.65) 0%, transparent 70%);
        animation: avatar-shine 4s ease-in-out infinite;
        /* ✅ GPU accelerated */
        transform: translateZ(0);
        will-change: transform;
    }

@keyframes avatar-shine {
    0%, 100% {
        transform: translate(-40%, -40%) translateZ(0);
    }

    50% {
        transform: translate(40%, 40%) translateZ(0);
    }
}

.comment-form-body {
    flex: 1;
}

.comment-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(108, 43, 217, 0.2);
    color: var(--text, #f0eeff);
    padding: 1rem;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    /* ✅ Removed transition */
}

    .comment-textarea:focus {
        border-color: #6c2bd9;
        background: rgba(108, 43, 217, 0.05);
        outline: none;
        box-shadow: 0 0 0 3px rgba(108, 43, 217, 0.1);
    }

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.comment-char-count {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted, #94a3b8);
}

.comment-submit-btn {
    background: linear-gradient(135deg, #6c2bd9, #1a6bff);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* ✅ Only transform on hover */
    transform: translateZ(0);
    will-change: transform;
}

    .comment-submit-btn:hover {
        transform: translateY(-2px) translateZ(0);
        box-shadow: 0 8px 20px rgba(108, 43, 217, 0.4);
    }

.btn-icon {
    font-size: 1rem;
}

/* Login Prompt */
.comment-login-prompt {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(108, 43, 217, 0.3);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.login-prompt-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.comment-login-prompt p {
    color: var(--muted, #94a3b8);
    font-size: 0.9rem;
}

.comment-login-prompt a {
    color: #6c2bd9;
    text-decoration: none;
    font-weight: 600;
}

    .comment-login-prompt a:hover {
        color: #8b5cf6;
    }

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Comment Card */
.comment-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(108, 43, 217, 0.15);
    border-radius: 16px;
    padding: 1.5rem;
    /* ✅ Removed transition (not needed for static cards) */
}

    .comment-card:hover {
        border-color: rgba(108, 43, 217, 0.3);
        background: rgba(255, 255, 255, 0.04);
    }

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    /* ✅ GPU acceleration */
    transform: translateZ(0);
}

.comment-user-info {
    flex: 1;
}

.comment-user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text, #f0eeff);
    margin: 0;
}

.comment-user-email {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted, #94a3b8);
    margin: 0;
}

.comment-time {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted, #94a3b8);
}

.comment-content {
    color: var(--text, #f0eeff);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

    .comment-content.edited {
        font-style: italic;
    }

.edited-badge {
    font-family: 'DM Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted, #94a3b8);
    margin-left: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wave-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid rgba(108, 43, 217, 0.3);
    color: var(--muted, #94a3b8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    /* ✅ Removed transition */
}

    .wave-btn:hover {
        border-color: #6c2bd9;
        color: #6c2bd9;
        background: rgba(108, 43, 217, 0.1);
    }

    .wave-btn.active {
        border-color: #6c2bd9;
        color: #6c2bd9;
        background: rgba(108, 43, 217, 0.15);
    }

.wave-icon {
    font-size: 1rem;
}

.wave-count {
    font-weight: bold;
}

.reply-btn,
.edit-btn,
.delete-btn {
    background: none;
    border: none;
    color: var(--muted, #94a3b8);
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    padding: 0.5rem;
}

    .reply-btn:hover {
        color: #1a6bff;
    }

    .edit-btn:hover {
        color: #d4a017;
    }

    .delete-btn:hover {
        color: #ef4444;
    }

/* Replies */
.replies-container {
    margin-left: 3rem;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(108, 43, 217, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-card.reply-card {
    background: rgba(255, 255, 255, 0.015);
}

/* Load More */
.comments-load-more {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: rgba(108, 43, 217, 0.1);
    border: 1px solid rgba(108, 43, 217, 0.3);
    color: #6c2bd9;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    /* ✅ GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
}

    .load-more-btn:hover {
        background: rgba(108, 43, 217, 0.2);
        transform: translateY(-2px) translateZ(0);
        box-shadow: 0 8px 20px rgba(108, 43, 217, 0.3);
    }

.load-more-replies-btn {
    background: rgba(108, 43, 217, 0.1);
    border: 1px solid rgba(108, 43, 217, 0.3);
    color: #6c2bd9;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

    .load-more-replies-btn:hover {
        background: rgba(108, 43, 217, 0.2);
    }

/* Loading Spinner */
.comments-loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted, #94a3b8);
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid rgba(108, 43, 217, 0.2);
    border-top-color: #6c2bd9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    /* ✅ GPU acceleration */
    transform: translateZ(0);
    will-change: transform;
}

@keyframes spin {
    to {
        transform: rotate(360deg) translateZ(0);
    }
}

/* Empty State */
.comments-empty {
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.comments-empty h4 {
    color: var(--text, #f0eeff);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.comments-empty p {
    color: var(--muted, #94a3b8);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .replies-container {
        margin-left: 1.5rem;
        padding-left: 1rem;
    }

    .comments-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-form-container {
        padding: 1rem;
    }
}

/* Edit form styles */
.edit-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(108, 43, 217, 0.3);
    color: var(--text, #f0eeff);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
}

.save-edit-btn,
.cancel-edit-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
}

.save-edit-btn {
    background: linear-gradient(135deg, #6c2bd9, #1a6bff);
    color: white;
}

.cancel-edit-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--muted, #94a3b8);
}

/* Cancel reply button */
.cancel-reply-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}

    .cancel-reply-btn:hover {
        background: rgba(239, 68, 68, 0.1);
    }

/* Error state */
.comments-error {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
}

/* Admin buttons */
.admin-delete-btn,
.admin-spam-btn {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
}

    .admin-delete-btn:hover {
        background: #fee2e2;
    }

    .admin-spam-btn:hover {
        background: #fef3c7;
    }





/* ═══ ROLE BADGES ═══ */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.4;
}

[dir="rtl"] .role-badge {
    margin-left: 0;
    margin-right: 6px;
}

.role-badge-admin {
    background: linear-gradient(135deg, #d4a017, #f0c040);
    color: #07070d;
    padding: 2px 8px;
    position: relative;
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.5);
    animation: adminBadgePulse 2s ease-in-out infinite;
    will-change: box-shadow, transform;
}

@keyframes adminBadgePulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(212, 160, 23, 0.5), 0 0 20px rgba(212, 160, 23, 0.2);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 14px rgba(212, 160, 23, 0.9), 0 0 28px rgba(212, 160, 23, 0.5);
        transform: scale(1.04);
    }
}

/* Optional: pulsing ring behind it */
.role-badge-admin::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #d4a017, #f0c040);
    opacity: 0.5;
    z-index: -1;
    filter: blur(4px);
    animation: adminGlowPulse 2s ease-in-out infinite;
}

@keyframes adminGlowPulse {
    0%, 100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.role-badge-operator {
    background: linear-gradient(135deg, #6c2bd9, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(108, 43, 217, 0.4);
}

.role-badge-blogsmanager {
    background: linear-gradient(135deg, #1a6bff, #06b6d4);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(26, 107, 255, 0.4);
}

.role-badge-newsmanager {
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.role-badge-earthquakemanager {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.role-badge-tsunamimanager {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.role-badge-lexiconmanager {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.role-badge-contactsmanager {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
