/* Modern Comment System Styles - Hybrid (Premium Layout + Classic Input + Ultra Compact) */
/* Glassmorphism & Mobile-First */

.feed-comments-container {
    background: rgba(248, 250, 252, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    margin-top: 1rem;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0px !important;
    /* Force zero gap */
}

/* Comment Item Structure */
.comment-item {
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
    margin-top: 2px !important;
    /* Tiny breathing room top */
}

.comment-flex-wrapper {
    gap: 8px;
    /* Gap between avatar and bubble */
    align-items: flex-start;
    /* Ensure avatar aligns with top of bubble */
}

/* Glass Bubble for Comments */
.comment-bubble {
    position: relative;
    max-width: fit-content;
    min-width: 120px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    border-top-left-radius: 4px;
    /* Chat bubble effect */
    padding: 6px 12px;
    /* Very tight padding inside bubble */
    margin-bottom: 0px !important;
    /* Zero margin below bubble */
}

/* User Bubble (Own comments) */
.comment-item.own .comment-bubble {
    background: #eef2ff !important;
    border-color: #e0e7ff !important;
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
}

/* Typography & Header */
.comment-header {
    margin-bottom: 0px !important;
    line-height: 1.1 !important;
}

.comment-author-name {
    font-size: 0.85rem;
    color: #1e293b;
    font-weight: 700 !important;
}

.comment-text {
    font-size: 0.9rem;
    line-height: 1.3 !important;
    /* Tight line height */
    color: #334155;
    word-wrap: break-word;
    margin-top: 1px !important;
}

/* FORCE REMOVAL OF PARAGRAPH MARGINS */
.comment-text p {
    margin: 0 !important;
    padding: 0 !important;
    margin-bottom: 0px !important;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 2px;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1;
    height: 18px;
    /* Fixed small height for actions */
}

.comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    color: #64748b;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.comment-action-btn:hover {
    color: #4f46e5;
}

.comment-date {
    color: #94a3b8;
    font-weight: 500;
}

/* Replies Container */
.replies-container {
    margin-left: 42px;
    margin-top: 0px !important;
    padding-left: 0;
}

/* FLATTENED THREADING: Deep nested replies align with the first level of replies */
.replies-container .replies-container {
    margin-left: 0 !important;
    padding-left: 0 !important;
    /* Optional: Add a subtle border to group the thread if needed, but clean is better */
}

/* Mobile: Flatten as well */
@media (max-width: 768px) {
    .replies-container .replies-container {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
}

/* Reply Input Specific */
.reply-input-area {
    margin-left: 42px;
    margin-top: 2px;
    padding: 0;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
}

.load-more-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.load-more-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4f46e5;
}

/* Input Area Redesign - RESTORED HYBRID/CLASSIC STYLE */
.comment-input-area {
    display: flex;
    align-items: flex-end;
    padding: 10px 0;
    /* Vertical padding only, aligns Left with comments */
    gap: 8px;
    /* Matches Bootstrap gap-2 (0.5rem) */
    background: transparent;
}

.comment-user-avatar {
    width: 34px;
    /* Classic size */
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
    /* Restored margin-bottom from Classic */
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
    background: #f1f5f9;
    /* Classic Pill background */
    border-radius: 20px;
    padding: 6px 6px 6px 16px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.comment-input-wrapper:focus-within {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.comment-input {
    background: transparent;
    border: none;
    padding: 4px 0;
    width: 100%;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    font-size: 0.95rem;
    color: #334155;
    font-family: inherit;
}

.comment-input:focus {
    box-shadow: none;
    outline: none;
    background: transparent;
}

.submit-comment-btn {
    width: 32px;
    /* Classic size */
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    background: var(--primary-color, #4f46e5);
    /* Classic Solid Color */
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1);
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    /* No shadow */
}

.submit-comment-btn:hover {
    transform: scale(1.05);
    background: #4338ca;
}

.submit-comment-btn:disabled {
    background: #cbd5e1;
    color: #fff;
    cursor: default;
    transform: none;
}

.submit-comment-btn i {
    font-size: 13px;
    margin-left: -2px;
}

/* Dark Mode Support */
.dark-mode .feed-comments-container {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .comment-bubble {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .comment-author-name {
    color: #f1f5f9;
}

.dark-mode .comment-text {
    color: #e2e8f0;
}

.dark-mode .comment-input-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .comment-input {
    color: #f8fafc;
}

.dark-mode .comment-input:focus-within {
    border-color: #6366f1;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .replies-container {
        margin-left: 32px;
        padding-left: 10px;
    }

    .comment-user-avatar {
        width: 32px;
        height: 32px;
    }

    .comment-bubble {
        padding: 6px 12px;
    }
}