/* Restore list bullets for the editor and displayed answers */
#answer_editor ul,
.ans-body ul {
    list-style: disc !important;
    margin: 15px 0 15px 25px !important;
    padding: 0 !important;
    display: block !important;
}

#answer_editor li,
.ans-body li {
    display: list-item !important;
    margin-bottom: 5px !important;
    list-style: disc !important;
}

#answer_editor:empty:before {
    content: attr(placeholder);
    color: #adb5bd;
}

#answer_editor b,
.ans-body b,
#answer_editor strong,
.ans-body strong {
    font-weight: 700 !important;
}

#answer_editor i,
.ans-body i,
#answer_editor em,
.ans-body em {
    font-style: italic !important;
}

/* Link Visibility */
#answer_editor a,
.ans-body a {
    color: #007bff !important;
    text-decoration: underline !important;
    cursor: pointer !important;
}

/* Link Popover */
#link_popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    margin-bottom: 10px;
    width: 300px;
}

#link_popover input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 8px;
    outline: none;
}

#link_popover .popover-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#link_popover button {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
}

.btn-apply {
    background: #007bff;
    color: #fff;
}

.btn-cancel {
    background: #f0f2f5;
    color: #606770;
}

/* YouTube Lazy Load Button */
.yt-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 12px;
    color: #007bff;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #eef0f2;
    margin: 15px 0;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.yt-video-btn:hover {
    background: #eef7ff;
    border-color: #007bff33;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.1);
}

.yt-video-btn svg {
    transition: transform 0.2s;
}

.yt-video-btn:hover svg {
    transform: scale(1.1);
}

/* Video Embed Style */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin: 15px 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Video Popover Style */
#video_popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    margin-bottom: 10px;
    width: 320px;
}

#video_popover input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 8px;
    outline: none;
}

#video_popover .popover-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Image Preview Grid */
#img-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #ddd;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #ff4d6d;
    border: 1px solid #eee;
}

/* Mention Pill Styles */
.mention-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f2f5;
    border-radius: 50px;
    padding: 2px 10px 2px 4px;
    color: #007bff;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9em;
    vertical-align: middle;
    transition: background 0.2s;
    border: 1px solid #e4e6eb;
    margin: 0 2px;
}

.mention-pill:hover {
    background: #e4e6eb;
    color: #0056b3;
}

.mention-pill img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

/* Tribute Dropdown Styles */
.tribute-container {
    position: absolute;
    top: 0;
    left: 0;
    height: auto;
    max-height: 300px;
    max-width: 500px;
    overflow: auto;
    display: block;
    z-index: 999999;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid #ddd;
}

.tribute-container ul {
    margin: 0;
    margin-top: 0 !important;
    padding: 0;
    list-style: none !important;
}

.tribute-container li {
    padding: 10px 15px !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border-bottom: 1px solid #f0f2f5;
    list-style: none !important;
    margin: 0 !important;
}

.tribute-container li:last-child {
    border-bottom: none;
}

.tribute-container li.highlight {
    background-color: #f0f7ff;
}

.tribute-container li img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.tribute-container li span {
    font-weight: 600;
    color: #1c1e21;
    font-size: 0.95rem;
}

/* MOBILE Layout Fixes */
@media (max-width: 991px) {
    .detail-page-content.container {
        padding-left: 2px !important;
        padding-right: 2px !important;
        max-width: 100% !important;
    }

    .detail-layout {
        flex-direction: column !important;
    }

    .qa-detail-sidebar {
        display: none !important;
    }

    .qa-unified-card {
        border-radius: 8px !important;
        margin-bottom: 20px !important;
    }

    .qa-answers-section {
        padding: 0 5px !important;
    }
}

/* Empty State Styling */
.empty-state-card {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.empty-state-card:hover {
    border-color: #7c4dff55;
    background: #fdfdff;
}

.empty-state-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    color: #7c4dff;
}

.empty-state-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.empty-state-subtext {
    font-size: 0.95rem;
    color: #64748b;
}