/* Blog Enhancements for Aljawharaa Website */

/* Move back-to-top button to right side to avoid overlapping with dark mode toggle */
.mhc_scroll_top {
    right: 30px !important;
    left: auto !important;
}

/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    z-index: 10001;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    width: 0%;
    transition: width 0.1s ease;
}

/* Table of Contents */
.toc-wrapper {
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.03) 0%, rgba(33, 110, 166, 0.03) 100%);
    border: 2px solid rgba(33, 110, 166, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.toc-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
}

.toc-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.toc-title i {
    color: #216ea6;
}

.toc-title::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

.toc-wrapper.toc-collapsed .toc-title::after {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.toc-wrapper.toc-collapsed .toc-list {
    max-height: 0;
    opacity: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.toc-list a:hover {
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.05) 0%, rgba(33, 110, 166, 0.05) 100%);
    color: #216ea6;
    transform: translateX(-5px);
}

.toc-list .toc-level-2 {
    padding-right: 1.5rem;
}

.toc-list .toc-level-3 {
    padding-right: 3rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(109, 9, 131, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(109, 9, 131, 0.5);
}

/* Dark Mode Styles */
body.dark-mode .blog-main-content {
    background: #1f2937;
    color: #f3f4f6;
}

body.dark-mode .blog-main-content h2,
body.dark-mode .blog-main-content h3,
body.dark-mode .blog-main-content h4 {
    color: #f3f4f6;
}

body.dark-mode .blog-main-content p {
    color: #d1d5db;
}

body.dark-mode .blog-main-content blockquote {
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.1) 0%, rgba(33, 110, 166, 0.1) 100%);
    color: #f3f4f6;
}

body.dark-mode .sidebar-widget {
    background: #1f2937;
}

body.dark-mode .sidebar-widget h3 {
    color: #f3f4f6;
}

body.dark-mode .categories-list a {
    background: #374151;
    color: #d1d5db;
}

body.dark-mode .post-navigation {
    background: #1f2937;
}

body.dark-mode .nav-item {
    background: #374151;
}

body.dark-mode .nav-item a {
    color: #f3f4f6;
}

/* Reading Controls */
.reading-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: all 0.3s ease;
}

.reading-controls.collapsed {
    width: 60px;
    height: 60px;
    padding: 0;
    overflow: hidden;
}

.reading-controls-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: #216ea6;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1;
}

.reading-controls-content {
    padding-top: 2rem;
}

.reading-control-group {
    margin-bottom: 1.5rem;
}

.reading-control-label {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: block;
}

.reading-control-buttons {
    display: flex;
    gap: 0.5rem;
}

.reading-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #f3f4f6;
    background: white;
    color: #4b5563;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reading-control-btn:hover {
    border-color: #216ea6;
    color: #216ea6;
    transform: scale(1.05);
}

.reading-control-btn.active {
    background: linear-gradient(135deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    color: white;
    border-color: transparent;
}

/* Focus Mode */
body.focus-mode .blog-sidebar,
body.focus-mode .blog-hero,
body.focus-mode .blog-featured-image,
body.focus-mode .share-section,
body.focus-mode .post-navigation {
    opacity: 0;
    pointer-events: none;
}

body.focus-mode .blog-main-content {
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* Text to Speech */
.tts-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.05) 0%, rgba(33, 110, 166, 0.05) 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
}

.tts-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tts-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(109, 9, 131, 0.3);
}

.tts-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tts-speed select {
    padding: 0.6rem 1rem;
    border: 2px solid #f3f4f6;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Enhanced Comments Section */
.comments-section {
    margin-top: 4rem;
    padding: 3rem;
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.comments-section h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-item {
    padding: 2rem;
    background: #f9fafb;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.02) 0%, rgba(33, 110, 166, 0.02) 100%);
    transform: translateX(-5px);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #f3f4f6;
}

.comment-name {
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.comment-date {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
}

.comment-text {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.8;
}

/* Reaction Buttons */
.reaction-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f3f4f6;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: #f9fafb;
    border: 2px solid #f3f4f6;
    border-radius: 50px;
    color: #4b5563;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    background: linear-gradient(135deg, rgba(109, 9, 131, 0.05) 0%, rgba(33, 110, 166, 0.05) 100%);
    border-color: #216ea6;
    color: #216ea6;
    transform: translateY(-2px);
}

.reaction-btn.active {
    background: linear-gradient(135deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    color: white;
    border-color: transparent;
}

/* Save for Later */
.save-later-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: white;
    border: 2px solid #216ea6;
    border-radius: 50px;
    color: #216ea6;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.save-later-btn:hover {
    background: #216ea6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(33, 110, 166, 0.3);
}

.save-later-btn.saved {
    background: linear-gradient(135deg, #6d0983 0%, #216ea6 50%, #18bbd8 100%);
    color: white;
    border-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reading-progress-container {
        height: 3px;
    }

    .toc-wrapper {
        padding: 1.5rem;
    }

    .toc-title {
        font-size: 1.2rem;
    }

    .toc-list a {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .dark-mode-toggle {
        width: 50px;
        height: 50px;
        bottom: 80px;
        left: 20px;
        font-size: 1.2rem;
    }

    .reading-controls {
        bottom: 80px;
        right: 20px;
        padding: 1rem;
    }

    .reading-controls.collapsed {
        width: 50px;
        height: 50px;
    }

    .reading-control-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .tts-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .comments-section {
        padding: 2rem 1.5rem;
    }

    .comment-item {
        padding: 1.5rem;
    }

    .reaction-buttons {
        flex-wrap: wrap;
    }
}
