/* Comment Popup Modal */
.comment-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(0px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1), 
                backdrop-filter 400ms cubic-bezier(0.4, 0, 0.2, 1), 
                background 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-popup-modal.active {
    display: flex;
    pointer-events: auto;
    opacity: 1;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.comment-popup-modal.closing {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: opacity 350ms cubic-bezier(0.4, 0, 1, 1), 
                backdrop-filter 350ms cubic-bezier(0.4, 0, 1, 1), 
                background 350ms cubic-bezier(0.4, 0, 1, 1);
}

.comment-popup-container {
    position: relative;
    z-index: 1;
    background: linear-gradient(145deg, var(--secondary-bg, #1e1e1e), rgba(30, 30, 30, 0.95));
    background-color: #1e1e1e;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(40px) scale(0.9);
    opacity: 0;
    transition: transform 450ms cubic-bezier(0.34, 1.2, 0.64, 1), 
                opacity 450ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 450ms cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-popup-modal.active .comment-popup-container {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.comment-popup-modal.closing .comment-popup-container {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 350ms cubic-bezier(0.4, 0, 1, 1), 
                opacity 350ms cubic-bezier(0.4, 0, 1, 1),
                box-shadow 350ms cubic-bezier(0.4, 0, 1, 1);
}

/* Only force white color on text inputs */
.comment-popup-modal.active .comment-popup-container input,
.comment-popup-modal.active .comment-popup-container textarea {
    color: var(--text-primary, #ffffff) !important;
}

/* Ensure buttons keep their intended colors */
.comment-popup-modal.active .comment-popup-container button {
    color: inherit;
}

/* Removed bouncy animations for smoother experience */

/* Respect reduced motion preferences for accessibility */
@media (prefers-reduced-motion: reduce) {
    .comment-popup-modal,
    .comment-popup-container,
    .comment-popup-title,
    .comment-popup-title i,
    .comment-popup-input-container,
    .comment-popup-item,
    .comment-spinner,
    .comments-empty::before {
        animation: none !important;
        transition: opacity 200ms ease !important;
    }
    
    .comment-popup-modal.active .comment-popup-container {
        transform: none;
        opacity: 1;
    }
    
    .comment-popup-item {
        animation: none;
    }
}

.comment-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    backdrop-filter: blur(10px);
}

.comment-popup-title {
    color: var(--text-primary, #ffffff) !important;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    letter-spacing: -0.02em;
}

.comment-popup-modal.active .comment-popup-title {
    animation: slideInTitle 400ms cubic-bezier(0.34, 1.2, 0.64, 1) 150ms backwards;
}

@keyframes slideInTitle {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.comment-popup-title i {
    color: #4CAF50;
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.4));
}

.comment-popup-modal.active .comment-popup-title i {
    animation: bounceIcon 500ms cubic-bezier(0.34, 1.2, 0.64, 1) 200ms backwards;
}

@keyframes bounceIcon {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.comment-popup-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-popup-close:hover {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.3);
    color: #ff4757;
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.comment-popup-close:active {
    transform: scale(0.95) rotate(90deg);
}

.comment-popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Comment Input Section */
.comment-popup-input-section {
    display: none;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.01);
}

.comment-popup-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.comment-popup-modal.active .comment-popup-input-container {
    animation: slideInInput 450ms cubic-bezier(0.34, 1.56, 0.64, 1) 150ms backwards;
}

@keyframes slideInInput {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-popup-input-section .comment-popup-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(69, 160, 73, 0.3));
    border: 2px solid rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.comment-popup-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(69, 160, 73, 0.3));
    border: 2px solid rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.comment-popup-avatar:hover {
    border-color: #4CAF50;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    transform: scale(1.08) rotate(5deg);
}

.comment-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.comment-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.comment-popup-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 48px;
}

.comment-popup-input-wrapper:focus-within {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.12), inset 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.comment-popup-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    padding: 0.25rem 0;
    font-weight: 400;
}

.comment-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-weight: 400;
}

.comment-popup-submit-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    flex-shrink: 0;
}

.comment-popup-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.comment-popup-submit-btn:active:not(:disabled) {
    transform: scale(1.05) rotate(15deg);
}

.comment-popup-submit-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.4;
    box-shadow: none;
}

.comment-popup-submit-btn.cooldown-active {
    background: #6c757d !important;
    color: white !important;
    cursor: not-allowed !important;
    opacity: 0.8 !important;
    width: auto !important;
    padding: 0 1rem !important;
    border-radius: 20px !important;
    font-size: 0.9rem !important;
}

/* Comments List */
.comment-popup-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem 2rem;
}

.comment-popup-list::-webkit-scrollbar {
    width: 8px;
}

.comment-popup-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.comment-popup-list::-webkit-scrollbar-thumb {
    background: rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.comment-popup-list::-webkit-scrollbar-thumb:hover {
    background: rgba(76, 175, 80, 0.5);
}

.no-comments {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 2rem 2rem;
    font-size: 1rem;
}

.comment-popup-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
}

.comment-popup-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(76, 175, 80, 0.2);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.comment-popup-item-content {
    flex: 1;
}

.comment-popup-item-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.comment-popup-item-username {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.comment-popup-item-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-weight: 500;
}

.comment-popup-item-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.85rem;
    font-weight: 400;
}

.comment-popup-item-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.comment-popup-like-btn,
.comment-popup-reply-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-popup-like-btn:hover,
.comment-popup-reply-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.comment-popup-like-btn.liked {
    background: rgba(255, 77, 79, 0.15);
    border-color: rgba(255, 77, 79, 0.3);
    color: #ff4d4f;
}

.comment-popup-like-btn.liked i {
    color: #ff4d4f;
    animation: heartPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Replies */
.comment-popup-replies {
    margin-left: 3.5rem;
    margin-top: 1.25rem;
    padding-left: 1.5rem;
    border-left: 3px solid rgba(76, 175, 80, 0.2);
    position: relative;
}

.comment-popup-replies::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, rgba(76, 175, 80, 0.4), transparent);
    border-radius: 10px;
}

.comment-popup-reply-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.015);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-popup-reply-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(76, 175, 80, 0.15);
    transform: translateX(4px);
}

.comment-popup-reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(69, 160, 73, 0.2));
    border: 2px solid rgba(76, 175, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.comment-popup-reply-avatar:hover {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
    transform: scale(1.1) rotate(5deg);
}

.reply-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.reply-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.comment-popup-reply-content {
    flex: 1;
}

.comment-popup-reply-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.4rem;
}

.comment-popup-reply-username {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.comment-popup-reply-time {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    font-weight: 500;
}

.comment-popup-reply-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.65rem;
    font-weight: 400;
}

.comment-popup-reply-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-popup-reply-like-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-popup-reply-like-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.comment-popup-reply-like-btn.liked {
    background: rgba(255, 77, 79, 0.12);
    border-color: rgba(255, 77, 79, 0.25);
    color: #ff4d4f;
}

.comment-popup-reply-like-btn.liked i {
    color: #ff4d4f;
    animation: heartPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reply Input */
.reply-input-container {
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.reply-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    overflow: hidden;
}

.reply-avatar:hover {
    background: #4CAF50;
    color: white;
    transform: scale(1.05);
}

.reply-input-field {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--accent-color);
    border-radius: 16px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.reply-input-field:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.1);
}

.reply-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    padding: 0.25rem 0;
}

.reply-input::placeholder {
    color: var(--text-secondary);
}

.reply-submit-btn {
    background: #4CAF50;
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.reply-submit-btn:hover:not(:disabled) {
    background: #45a049;
    transform: scale(1.05);
}

.reply-submit-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

.comment-popup-replies-toggle {
    margin-left: 3rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    background: rgba(76, 175, 80, 0.05);
    border: 1.5px solid rgba(76, 175, 80, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-popup-replies-toggle:hover {
    background: rgba(76, 175, 80, 0.12);
    border-color: #4CAF50;
    color: var(--text-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.comment-popup-replies-toggle[data-expanded="true"] {
    background: rgba(76, 175, 80, 0.18);
    border-color: #4CAF50;
    color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.comment-popup-item-actions .comment-popup-replies-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-popup-item-actions .comment-popup-replies-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.comment-popup-replies-toggle[data-expanded="true"] {
    background: rgba(76, 175, 80, 0.12);
    border-color: transparent;
    color: var(--text-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comment-popup-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .comment-popup-container {
        max-height: 95vh;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    
    .comment-popup-modal.active .comment-popup-container {
        transform: translateY(0);
    }
    
    .comment-popup-header {
        padding: 1.25rem 1rem;
    }
    
    .comment-popup-title {
        font-size: 1.2rem;
    }
    
    .comment-popup-title i {
        font-size: 1.2rem;
    }
    
    .comment-popup-close {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
    
    .comment-popup-input-section {
        padding: 1rem;
    }
    
    .comment-popup-input-container {
        gap: 0.75rem;
    }
    
    .comment-popup-input-section .comment-popup-avatar {
        width: 36px;
        height: 36px;
    }
    
    .comment-popup-input-wrapper {
        padding: 0.75rem 1rem;
    }
    
    .comment-popup-input {
        font-size: 0.95rem;
    }
    
    .comment-popup-submit-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .comment-popup-list {
        padding: 1rem;
    }
    
    .comment-popup-item {
        padding: 1rem;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .comment-popup-item-username {
        font-size: 1rem;
    }
    
    .comment-popup-item-time {
        font-size: 0.8rem;
    }
    
    .comment-popup-item-text {
        font-size: 0.95rem;
    }
    
    .comment-popup-like-btn,
    .comment-popup-reply-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .comment-popup-replies {
        margin-left: 1.5rem;
        padding-left: 1rem;
    }
    
    .comment-popup-reply-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .comment-popup-reply-avatar {
        width: 32px;
        height: 32px;
    }
    
    .comment-popup-reply-username {
        font-size: 0.9rem;
    }
    
    .comment-popup-reply-text {
        font-size: 0.9rem;
    }
    
    .comment-popup-replies-toggle {
        margin-left: 1.5rem;
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .comment-popup-header {
        padding: 1rem 0.75rem;
    }
    
    .comment-popup-title {
        font-size: 1.1rem;
    }
    
    .comment-popup-close {
        width: 36px;
        height: 36px;
    }
    
    .comment-popup-input-section {
        padding: 0.75rem;
    }
    
    .comment-popup-avatar {
        width: 36px;
        height: 36px;
    }
    
    .comment-popup-input-wrapper {
        padding: 0.65rem 0.85rem;
    }
    
    .comment-popup-input {
        font-size: 0.9rem;
    }
    
    .comment-popup-submit-btn {
        width: 34px;
        height: 34px;
    }
    
    .comment-popup-list {
        padding: 0.75rem;
    }
    
    .comment-popup-item {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .comment-popup-replies {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }
    
    .comment-popup-reply-avatar {
        width: 28px;
        height: 28px;
    }
    
    .cooldown-message {
        padding: 0.85rem 1rem;
        font-size: 0.85rem;
    }
    
    .cooldown-message i {
        font-size: 1.1rem;
    }
    
    .cooldown-timer {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .comment-popup-container {
        max-height: 90vh;
    }
}

/* Skeleton Loading State */
.comments-skeleton {
    padding: 1rem 0;
    animation: fadeIn 300ms ease;
}

.skeleton-comment {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    opacity: 0.6;
}

.skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-header {
    width: 150px;
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    width: 100%;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text.short {
    width: 70%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced Loading State */
.comments-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 3.5rem 2rem;
    animation: fadeIn 300ms ease;
}

.comments-loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.comment-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(76, 175, 80, 0.15);
    border-top-color: #4CAF50;
    border-right-color: #4CAF50;
    border-radius: 50%;
    animation: commentSpin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    position: relative;
}

.comment-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-top-color: rgba(76, 175, 80, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: commentSpinReverse 0.6s linear infinite;
}

@keyframes commentSpin {
    0% { 
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    }
}

@keyframes commentSpinReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

.comment-loading-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
    }
}


/* Comment Item Styles */
.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-time {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.comment-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Enhanced Empty and Error States */
.comments-empty {
    text-align: center;
    padding: 2rem 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    font-style: italic;
    animation: fadeIn 400ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.comments-empty::before {
    content: '💬';
    font-size: 2.5rem;
    opacity: 0.4;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.comments-error {
    text-align: center;
    padding: 3rem 2rem;
    color: #ff4757;
    font-size: 1rem;
    animation: fadeIn 400ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.comments-error::before {
    content: '⚠️';
    font-size: 2.5rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}


/* Comment Actions (Like and Reply buttons) */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.comment-like-btn,
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-like-btn:hover,
.comment-reply-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.comment-like-btn.liked {
    color: #ff4757;
}

.comment-like-btn.liked i {
    color: #ff4757;
}

.comment-like-btn i {
    font-size: 0.9rem;
}

.comment-reply-btn i {
    font-size: 0.85rem;
}

/* Cooldown Message */
.cooldown-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 165, 2, 0.1);
    border: 1px solid rgba(255, 165, 2, 0.3);
    border-radius: 12px;
    margin-top: 1rem;
    color: #ffa502;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cooldown-message i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cooldown-text {
    flex: 1;
}

.cooldown-timer {
    font-weight: 600;
    background: rgba(255, 165, 2, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    min-width: 40px;
    text-align: center;
}

/* Heart Animation */
@keyframes heartPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.heart-pop {
    animation: heartPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.comment-popup-like-btn.liked i,
.comment-popup-reply-like-btn.liked i {
    color: #ff4757;
}

.comment-popup-like-btn,
.comment-popup-reply-like-btn {
    transition: all 0.2s ease;
}

.comment-popup-like-btn:active,
.comment-popup-reply-like-btn:active {
    transform: scale(0.95);
}

.comment-popup-like-btn.processing,
.comment-popup-reply-like-btn.processing {
    opacity: 0.6;
    pointer-events: none;
}

/* Cooldown Message */
.cooldown-message {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 152, 0, 0.12));
    border: 2px solid rgba(255, 193, 7, 0.35);
    border-radius: 14px;
    padding: 1.1rem 1.4rem;
    margin-top: 1rem;
    color: #ffc107;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), pulse 2s ease-in-out infinite;
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cooldown-message i {
    font-size: 1.35rem;
    animation: spin 2s linear infinite;
    filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.5));
}

.cooldown-timer {
    background: rgba(255, 193, 7, 0.25);
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    margin-left: auto;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Guest Sign-In Message - Matches site design */
.comment-guest-signin {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.comment-guest-signin i.fa-sign-in-alt {
    font-size: 3.5rem;
    color: rgba(76, 175, 80, 0.5);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 12px rgba(76, 175, 80, 0.3));
    transition: all 0.3s ease;
}

.comment-guest-signin:hover i.fa-sign-in-alt {
    color: rgba(76, 175, 80, 0.7);
    transform: scale(1.05);
}

.comment-guest-signin p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    font-weight: 500;
}

.btn-signin-comment {
    background: linear-gradient(135deg, #4285F4, #357AE8);
    color: #ffffff;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.4);
}

.btn-signin-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(66, 133, 244, 0.5);
    background: linear-gradient(135deg, #357AE8, #2A63C8);
}

.btn-signin-comment:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.btn-signin-comment svg {
    flex-shrink: 0;
}

.comment-avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}


/* Loading States */
.comments-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 3.5rem 2rem;
    animation: fadeIn 300ms ease;
}

.comments-loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    animation: fadeIn 300ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.comment-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(76, 175, 80, 0.15);
    border-top-color: #4CAF50;
    border-right-color: #4CAF50;
    border-radius: 50%;
    animation: commentSpin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    position: relative;
}

.comment-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-top-color: rgba(76, 175, 80, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: commentSpinReverse 0.6s linear infinite;
}

@keyframes commentSpin {
    0% { 
        transform: rotate(0deg);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
    }
    100% { 
        transform: rotate(360deg);
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
    }
}

@keyframes commentSpinReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

.comment-loading-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    letter-spacing: 0.02em;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
    }
}

/* Loading Overlay - Prevents Black Screen When Posting Comments */
.comments-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: overlayFadeIn 200ms ease;
}

.comments-loading-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2.5rem 3rem;
    background: rgba(20, 22, 24, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Make sure the comment list container has position relative for overlay */
.comment-popup-list {
    position: relative;
}


/* YouTuber Badge in Comments */
.comment-popup-item-username .youtuber-badge {
    color: #FF0000;
    font-size: 0.85rem;
    margin-left: 0.3rem;
    filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.5));
    animation: youtuberPulse 3s ease-in-out infinite;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.comment-popup-item-username .youtuber-badge:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.8));
}

@keyframes youtuberPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 0, 0, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.8));
        transform: scale(1.05);
    }
}
