/**
 * Forum Threaded Replies
 * 
 * Enhanced styling for forum replies with threaded/tabbed discussions
 */

/* Thread indicators */
.forum-reply {
    position: relative;
}

/* Reply threading styles */
.forum-nested-replies {
    margin-left: 20px;
    border-left: 2px solid #e5e7eb;
    padding-left: 10px;
    margin-top: 8px;
}

/* Different background colors for nested levels */
.forum-nested-replies .forum-reply {
    background-color: #f1f5f9;
}

.forum-nested-replies .forum-nested-replies .forum-reply {
    background-color: #e9eef5;
}

.forum-nested-replies .forum-nested-replies .forum-nested-replies .forum-reply {
    background-color: #e2e8f0;
}

/* Compact reply styling */
.forum-reply {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.forum-reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.forum-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    font-size: 12px;
}

.forum-reply-author {
    font-weight: 600;
    font-size: 14px;
}

.forum-reply-date {
    font-size: 12px;
    margin-left: 8px;
}

.forum-reply p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
}

.forum-reply p:last-child {
    margin-bottom: 0;
}

/* Reply tools */
.forum-reply-tools {
    margin-top: 5px;
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.forum-reply-tool {
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.forum-reply-tool:hover {
    color: #3b82f6;
    background-color: #eff6ff;
}

/* Reply button icon */
.forum-reply-tool.reply::before {
    content: '\21a9';
    font-size: 14px;
    display: inline-block;
    transform: scaleX(-1);
}

/* Like button icon */
.forum-reply-tool.like::before {
    content: '\2661';
    font-size: 14px;
}

.forum-reply-tool.like.active::before {
    content: '\2665';
    color: #ef4444;
}

/* Thread lines to show conversation flow */
.reply-thread-line {
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #cbd5e1;
}

/* Compact row content */
.forum-row-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s ease;
}

.forum-row-item.expanded .forum-row-content {
    padding: 15px;
    max-height: 2000px;
    overflow-y: auto;
}

/* More compact spacing in replies section */
.forum-row-replies-section {
    margin-top: 15px;
    border-top: 1px solid #cbd5e1;
    padding-top: 12px;
}

.forum-row-replies-title {
    font-size: 15px;
    margin: 0 0 10px 0;
}

/* Reply form */
.forum-reply-form {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
}

.forum-reply-form-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.forum-reply-textarea {
    min-height: 70px;
    padding: 8px;
    margin-bottom: 8px;
}

/* Active discussion styling */
.forum-row-item.expanded .forum-row-full-text {
    background-color: #334155;
    color: #f8fafc;
    padding: 18px;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.forum-row-item.expanded .forum-row-full-text p,
.forum-row-item.expanded .forum-row-full-text li {
    color: #f1f5f9;
}

.forum-row-item.expanded .forum-row-full-text strong {
    color: #ffffff;
}

/* Color differentiation for active/inactive discussions */
.forum-row-item {
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.forum-row-item.expanded {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Inactive discussions when one is expanded */
.has-expanded-row .forum-row-item:not(.expanded) {
    opacity: 0.75;
    background-color: #f8fafc;
}

.has-expanded-row .forum-row-item:not(.expanded) .forum-row-header {
    background-color: #e2e8f0;
}

/* Hover effect for inactive discussions */
.has-expanded-row .forum-row-item:not(.expanded):hover {
    opacity: 0.9;
    background-color: #f8fafc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .forum-nested-replies {
        margin-left: 10px;
        padding-left: 8px;
    }
    
    .forum-reply {
        padding: 8px 10px;
    }
    
    .forum-reply-avatar {
        width: 24px;
        height: 24px;
    }
}