/* Post Details Page Styles - Optimized for Performance */

/* Base Layout Styles */
.card-style {
    margin: 0px 5px 30px 5px !important;
}

.btn-group.content-zoom-action-btns {
    position: fixed;
    z-index: 100;
    bottom: 67px;
    right: 100px;
}

@media (max-width: 767px) {
    .page-content > .container > .row > .col-md-12 {
        padding: 0px !important;
    }
}

/* Table of Contents Styles */
.table-of-contents {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table-of-contents .card-header {
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #495057;
}

.toc-nav {
    max-height: 300px;
    overflow-y: auto;
}

.toc-link {
    color: #495057;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin-bottom: 2px;
}

.toc-link:hover {
    background-color: #f8f9fa;
    border-left-color: #007bff !important;
    color: #007bff;
    text-decoration: none;
    transform: translateX(2px);
}

.toc-link.toc-level-1 {
    font-weight: 600;
    font-size: 15px;
}

.toc-link.toc-level-2 {
    font-weight: 500;
}

.toc-link.toc-level-3,
.toc-link.toc-level-4,
.toc-link.toc-level-5,
.toc-link.toc-level-6 {
    font-size: 13px;
    color: #6c757d;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Highlight active section in TOC */
.toc-link.active {
    background-color: #e3f2fd;
    border-left-color: #2196f3 !important;
    color: #1976d2;
    font-weight: 500;
}

/* Reply System Styles */
.replies-container {
    border-left: 2px solid #e9ecef;
    margin-left: 20px;
    padding-left: 15px;
}

.comment-item {
    transition: all 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reply-form {
    animation: slideDown 0.3s ease-out;
}

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

.btn-reply {
    transition: all 0.2s ease;
}

.btn-reply:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.border-start {
    border-left-width: 3px !important;
}

.border-primary {
    border-left-color: #007bff !important;
}

/* Edit Comment Styles */
.edit-form {
    animation: slideDown 0.3s ease-out;
}

.comment-actions {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.comment-item:hover .comment-actions {
    opacity: 1;
}

.btn-edit-comment {
    transition: all 0.2s ease;
}

.btn-edit-comment:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-save-edit {
    transition: all 0.2s ease;
}

.btn-save-edit:hover {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-cancel-edit {
    transition: all 0.2s ease;
}

.btn-cancel-edit:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.edit-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}

/* Comment Sorting Styles */
.dropdown-menu .sort-option {
    transition: all 0.2s ease;
    padding: 8px 16px;
}

.dropdown-menu .sort-option:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.dropdown-menu .sort-option.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.dropdown-menu .sort-option i {
    width: 16px;
    text-align: center;
}

#commentSortDropdown {
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

#commentSortDropdown:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

#commentSortDropdown:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}

@media (max-width: 576px) {
    #commentSortDropdown {
        font-size: 12px;
        padding: 4px 8px;
    }

    .dropdown-menu .sort-option {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Mention Autocomplete Styles */
.mention-dropdown {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
}

.mention-list {
    padding: 4px 0;
}

.mention-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    margin: 2px 4px;
}

.mention-item:hover,
.mention-item.selected {
    background-color: #f8f9fa;
}

.mention-item.selected {
    background-color: #e3f2fd;
}

.mention-avatar {
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.mention-name {
    font-size: 14px;
    color: #212529;
}

.mention-username {
    font-size: 12px;
    color: #6c757d;
}

/* Mention highlighting in comments */
.comment-text .mention {
    color: #007bff;
    font-weight: 500;
    text-decoration: none;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-text .mention:hover {
    background-color: rgba(0, 123, 255, 0.2);
    text-decoration: underline;
}

/* Responsive mention dropdown */
@media (max-width: 576px) {
    .mention-dropdown {
        max-height: 150px;
        border-radius: 6px;
    }

    .mention-item {
        padding: 8px;
    }

    .mention-avatar {
        width: 28px;
        height: 28px;
    }

    .mention-name {
        font-size: 13px;
    }

    .mention-username {
        font-size: 11px;
    }
}

/* Report System Styles */
.btn-report-comment {
    transition: all 0.2s ease;
}

.btn-report-comment:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.social-share-buttons .btn-outline-danger {
    transition: all 0.2s ease;
}

.social-share-buttons .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Report Modal Enhancements */
#reportModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#reportModal .modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

#reportModal .modal-body {
    padding: 1.5rem;
}

#reportModal .form-select:focus,
#reportModal .form-control:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Responsive report modal */
@media (max-width: 576px) {
    #reportModal .modal-dialog {
        margin: 0.5rem;
    }

    #reportModal .modal-body {
        padding: 1rem;
    }
}

/* Reading Progress Bar Styles */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    transform-origin: left;
    transition: transform 0.1s ease-out;
}

.reading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #28a745 100%);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    transition: width 0.1s ease-out;
}

[data-theme="dark"] .reading-progress-bar {
    background-color: rgba(26, 26, 26, 0.8);
}

[data-theme="dark"] .reading-progress-fill {
    background: linear-gradient(90deg, #0d6efd 0%, #198754 100%);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

/* Hide progress bar on very small screens */
@media (max-width: 480px) {
    .reading-progress-bar {
        height: 3px;
    }
}

/* Progress Bar Animations */
.reading-progress-bar {
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.reading-progress-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

.reading-progress-fill {
    position: relative;
    overflow: hidden;
}

.reading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Author Badges Styles */
.author-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.author-badges .badge {
    border-radius: 12px;
    font-weight: 500;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.author-badges .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.author-badges .badge i {
    opacity: 0.9;
}

/* Dark theme support for badges */
[data-theme="dark"] .author-badges .badge {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"] .author-badges .badge:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Badges Section Styles */
.badges-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.badges-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.badges-grid {
    max-height: 200px;
    overflow-y: auto;
}

.badge-item {
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.badge-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.1);
}

.badge-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.badge-name {
    color: #495057;
    margin-bottom: 2px;
    font-weight: 500;
}

.badge-description {
    color: #6c757d;
    line-height: 1.2;
    font-size: 13px;
}

.badge-date {
    color: #adb5bd;
    font-weight: 500;
    font-size: 12px;
}

/* Dark theme support for badges section */
[data-theme="dark"] .badges-section {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
}

[data-theme="dark"] .badges-section h6 {
    color: #e2e8f0;
}

[data-theme="dark"] .badge-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.2);
}

[data-theme="dark"] .badge-icon {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

[data-theme="dark"] .badge-name {
    color: #e2e8f0;
}

[data-theme="dark"] .badge-description {
    color: #a0aec0;
}

[data-theme="dark"] .badge-date {
    color: #718096;
}

/* Responsive badges section */
@media (max-width: 576px) {
    .badges-grid {
        max-height: 150px;
    }

    .badge-item {
        padding: 6px 8px;
    }

    .badge-icon {
        width: 20px;
        height: 20px;
    }

    .badge-name {
        font-size: 14px;
    }

    .badge-description {
        font-size: 12px;
    }
}