/* =====================================================
   SINGLE POST PAGE STYLES
   ===================================================== */

/* CSS Variables for Reading Modes */
:root {
    /* Light Mode (Default) */
    --reading-bg: #ffffff;
    --reading-text: #2c3e50;
    --reading-text-light: #5a6c7d;
    --reading-border: #e5e7eb;
    --reading-shadow: rgba(0, 0, 0, 0.1);
    --reading-accent: #ff5252;
    
    /* Colors & Gradients */
    --gradient-primary: linear-gradient(135deg, #ff5252 0%, #ff7979 100%);
    --color-primary: #ff5252;
    --color-accent: #ff5252;
    --color-bg-dark: #1a1a1a;
    --color-bg-darker: #0f0f0f;
    
    /* Font Sizes */
    --font-size-small: 14px;
    --font-size-medium: 16px;
    --font-size-large: 18px;
    --font-size-xlarge: 20px;
    
    /* Content Width */
    --content-max-width: 800px;
    --content-line-height: 1.7;
}

/* Dark Mode Variables */
[data-reading-theme="dark"] {
    --reading-bg: #1a1a1a;
    --reading-text: #e5e7eb;
    --reading-text-light: #9ca3af;
    --reading-border: #374151;
    --reading-shadow: rgba(255, 255, 255, 0.1);
}

/* Font Size Classes */
.font-size-small {
    --font-size-base: var(--font-size-small);
    --content-line-height: 1.6;
}

.font-size-medium {
    --font-size-base: var(--font-size-medium);
    --content-line-height: 1.7;
}

.font-size-large {
    --font-size-base: var(--font-size-large);
    --content-line-height: 1.8;
}

.font-size-xlarge {
    --font-size-base: var(--font-size-xlarge);
    --content-line-height: 1.9;
}

/* =====================================================
   READING TOOLBAR & SETTINGS
   ===================================================== */

.reading-toolbar {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    transition: all 0.3s ease;
}

.reading-settings-btn {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 82, 82, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    z-index: 1001;
}

.reading-settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 82, 82, 0.4);
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.reading-settings-btn:active {
    transform: scale(0.95);
}

.reading-settings-btn i {
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Reading Settings Sidebar */
.reading-settings-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: var(--color-bg-darkest);
    backdrop-filter: blur(20px);
    z-index: 1002;
    transition: right 0.3s ease;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.reading-settings-sidebar.active {
    right: 0;
    background: var(--color-bg-darkest);
    border: 2px solid #ff5252; /* Debug border */
}

.reading-settings-content {
    padding: 30px;
    height: 100%;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    color: var(--color-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.settings-close-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.settings-close-btn:hover {
    color: var(--color-accent);
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group h4 {
    color: var(--color-text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.theme-btn:hover,
.theme-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.theme-btn i {
    font-size: 18px;
}

.theme-btn span {
    font-size: 12px;
    font-weight: 600;
}

/* Font Size Controls */
.font-size-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.font-control-btn {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.font-control-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-1px);
}

#fontSizeDisplay {
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: 14px;
}

/* Feature Toggles */
.feature-toggles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.toggle-switch input[type="checkbox"] {
    position: relative;
    width: 50px;
    height: 25px;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked {
    background: var(--gradient-primary);
}

.toggle-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked::before {
    transform: translateX(25px);
}

.toggle-label {
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Reading Settings Overlay */
.reading-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.reading-settings-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.7); /* Black overlay */
}

/* =====================================================
   READING PROGRESS BAR
   ===================================================== */

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.reading-progress-bar.hidden {
    opacity: 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 0 2px 2px 0;
}

/* =====================================================
   SINGLE POST CONTAINER
   ===================================================== */

.single-post-container {
    background: var(--color-bg-darkest);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* =====================================================
   POST HERO SECTION
   ===================================================== */

.single-post-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 60px 0;
}

.hero-content .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Post Categories */
.post-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.post-category-badge {
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
}

.post-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.4);
    color: white !important;
}

/* Post Title */
.post-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 30px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.author-meta {
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.author-name a:hover {
    color: var(--color-accent);
}

.author-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.meta-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
}

.meta-item i {
    opacity: 0.8;
}

/* Post Tags */
.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post-tag {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
}

.post-tag:hover {
    background: rgba(255, 82, 82, 0.3);
    color: white;
    transform: translateY(-1px);
}

/* =====================================================
   TABLE OF CONTENTS
   ===================================================== */

.table-of-contents {
    background: var(--color-bg-darker);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
}

.table-of-contents.hidden {
    opacity: 0;
    max-height: 0;
    padding: 0;
}

.toc-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 30px 20px;
}

.toc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.toc-title i {
    color: var(--color-accent);
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.toc-item a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.toc-item:hover,
.toc-item.active {
    background: rgba(255, 82, 82, 0.1);
    border-left-color: var(--color-accent);
}

.toc-item:hover a,
.toc-item.active a {
    color: var(--color-accent);
}

.toc-empty-message {
    padding: 20px;
    text-align: center;
    color: var(--color-text-secondary);
    font-style: italic;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.toc-empty-message i {
    margin-right: 8px;
    color: var(--color-accent);
}

/* Nested TOC Items */
.toc-item.level-2 {
    margin-left: 20px;
}

.toc-item.level-3 {
    margin-left: 40px;
}

/* =====================================================
   POST CONTENT
   ===================================================== */

.single-post-content {
    background: var(--reading-bg);
    color: var(--reading-text);
    transition: all 0.3s ease;
    padding: 60px 0;
}

.content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.post-content-text {
    font-size: var(--font-size-base, var(--font-size-medium));
    line-height: var(--content-line-height);
    color: var(--reading-text);
}

/* Content Typography */
.post-content-text h1,
.post-content-text h2,
.post-content-text h3,
.post-content-text h4,
.post-content-text h5,
.post-content-text h6 {
    color: var(--reading-text);
    font-weight: 700;
    margin: 40px 0 20px 0;
    line-height: 1.3;
    scroll-margin-top: 100px; /* For TOC scroll */
}

.post-content-text h1 { font-size: 2.5em; }
.post-content-text h2 { font-size: 2em; }
.post-content-text h3 { font-size: 1.7em; }
.post-content-text h4 { font-size: 1.4em; }
.post-content-text h5 { font-size: 1.2em; }
.post-content-text h6 { font-size: 1em; }

.post-content-text p {
    margin-bottom: 25px;
    color: var(--reading-text);
    line-height: var(--content-line-height);
}

.post-content-text a {
    color: var(--reading-accent);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.3s ease;
}

.post-content-text a:hover {
    text-decoration-color: var(--reading-accent);
}

.post-content-text blockquote {
    margin: 30px 0;
    padding: 25px 30px;
    background: rgba(255, 82, 82, 0.05);
    border-left: 4px solid var(--reading-accent);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--reading-text-light);
}

.post-content-text ul,
.post-content-text ol {
    margin: 25px 0;
    padding-left: 30px;
}

.post-content-text li {
    margin-bottom: 10px;
    color: var(--reading-text);
    line-height: var(--content-line-height);
}

.post-content-text code {
    background: var(--reading-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--reading-accent);
}

.post-content-text pre {
    background: var(--color-bg-darker);
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 25px 0;
    border: 1px solid var(--reading-border);
}

.post-content-text pre code {
    background: none;
    padding: 0;
    color: var(--color-text-primary);
}

.post-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: 0 10px 30px var(--reading-shadow);
}

.post-content-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: var(--reading-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--reading-shadow);
}

.post-content-text th,
.post-content-text td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--reading-border);
}

.post-content-text th {
    background: var(--color-bg-darker);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Post Pagination */
.post-pagination {
    margin: 40px 0;
    text-align: center;
}

.pagination-title {
    color: var(--reading-text-light);
    font-weight: 600;
    margin-right: 15px;
}

.page-link {
    display: inline-block;
    margin: 0 5px;
    padding: 10px 15px;
    background: var(--reading-accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

/* =====================================================
   SOCIAL SHARE SECTION
   ===================================================== */

.social-share-section {
    background: var(--color-bg-darker);
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.share-title {
    color: var(--color-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.share-btn.twitter-share:hover {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.share-btn.facebook-share:hover {
    background: #4267b2;
    color: white;
    border-color: #4267b2;
}

.share-btn.linkedin-share:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.share-btn.copy-link:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--color-accent);
}

/* =====================================================
   AUTHOR BIO SECTION
   ===================================================== */

.author-bio-section {
    background: var(--color-bg-darker);
    padding: 50px 0;
}

.author-bio-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.author-bio-avatar {
    flex-shrink: 0;
}

.bio-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-accent);
}

.author-bio-content {
    flex: 1;
}

.author-bio-name {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.author-bio-name a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-bio-name a:hover {
    color: var(--color-accent);
}

.author-bio-description {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.author-bio-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.author-posts-count,
.author-website {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.author-website:hover,
.author-posts-count:hover {
    color: var(--color-accent);
}

/* =====================================================
   RELATED POSTS SECTION
   ===================================================== */

.related-posts-section {
    background: var(--color-bg-darkest);
    padding: 60px 0;
}

.related-title {
    text-align: center;
    color: var(--color-text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-post-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.related-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 82, 82, 0.3);
}

.related-post-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-image img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 24px;
}

.related-post-content {
    padding: 25px;
}

.related-post-title {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.related-post-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-post-title a:hover {
    color: var(--color-accent);
}

.related-post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.related-post-excerpt {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.no-related-posts {
    text-align: center;
    color: var(--color-text-secondary);
    font-style: italic;
    grid-column: 1 / -1;
}

/* =====================================================
   POST NAVIGATION SECTION
   ===================================================== */

.post-navigation-section {
    background: var(--color-bg-darker);
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-nav-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link:hover {
    background: rgba(255, 82, 82, 0.1);
    border-color: rgba(255, 82, 82, 0.3);
    transform: translateY(-2px);
}

.nav-previous .nav-link {
    text-align: left;
}

.nav-next .nav-link {
    text-align: right;
}

.nav-home .nav-link {
    text-align: center;
    padding: 15px 20px;
}

.nav-direction {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.nav-next .nav-direction {
    justify-content: flex-end;
}

.nav-title {
    color: var(--color-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.nav-home .nav-link {
    color: var(--color-text-secondary);
    font-weight: 600;
}

.nav-home .nav-link:hover {
    color: var(--color-accent);
}

/* =====================================================
   COMMENTS SECTION
   ===================================================== */

.comments-section {
    background: var(--color-bg-darkest);
    padding: 60px 0;
}

.comments-section .container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   BACK TO TOP BUTTON
   ===================================================== */

.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    box-shadow: 0 4px 20px rgba(164, 22, 26, 0.3);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    background: var(--color-red-bright);
    box-shadow: 0 6px 25px rgba(164, 22, 26, 0.4);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .post-title {
        font-size: 2.8rem;
    }
    
    .reading-toolbar {
        right: 15px;
    }
    
    .reading-settings-sidebar {
        width: 320px;
        right: -320px;
    }
    
    .author-bio-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .post-nav-wrapper {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .nav-home {
        order: -1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .post-title {
        font-size: 2.2rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .meta-divider {
        display: none;
    }
    
    .reading-settings-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .reading-toolbar {
        bottom: 80px;
        right: 20px;
        top: auto;
        transform: none;
    }
    
    .reading-settings-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .post-title {
        font-size: 1.8rem;
    }
    
    .hero-content .container {
        padding: 0 15px;
    }
    
    .content-wrapper,
    .share-wrapper,
    .author-bio-wrapper {
        padding: 0 15px;
    }
    
    .toc-wrapper {
        padding: 20px 15px;
    }
    
    .font-size-controls {
        flex-direction: column;
        gap: 10px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .post-title {
        font-size: 4rem;
    }
    
    .hero-content {
        padding: 80px 0;
    }
    
    .single-post-content {
        padding: 80px 0;
    }
}

/* =====================================================
   AUTHOR SOCIAL LINKS
   ===================================================== */

.author-social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.author-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.author-social-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

/* =====================================================
   ENHANCED COMMENTS SECTION
   ===================================================== */

.comments-section {
    background: var(--color-bg-darker);
    padding: 80px 0;
    margin-top: 60px;
}

.comments-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.comments-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.comments-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.comments-title i {
    color: var(--color-accent);
    font-size: 1.8rem;
}

.comments-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin: 0;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Comments List Styles */
.comments-list {
    margin-bottom: 50px;
}

.comments-list-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-list-title i {
    color: var(--color-accent);
}

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* WordPress Default Comment Styles Override */
.comments-container .comment {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid var(--color-accent);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.comments-container .comment:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.comments-container .comment-author {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 8px;
}

.comments-container .comment-author a {
    color: var(--color-accent);
    text-decoration: none;
}

.comments-container .comment-meta {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comments-container .comment-content {
    color: var(--color-text-primary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.comments-container .comment-content p {
    margin-bottom: 10px;
}

.comments-container .reply {
    margin-top: 10px;
}

.comments-container .reply a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.comments-container .reply a:hover {
    background: rgba(255, 82, 82, 0.1);
    color: var(--color-white);
}

.comment-item {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid var(--color-accent);
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.comment-avatar-img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 3px solid var(--color-accent);
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-author {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-white);
    margin: 0;
}

.comment-author a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author a:hover {
    color: var(--color-white);
}

.comment-date {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-text {
    color: var(--color-text-primary);
    line-height: 1.7;
    margin-bottom: 15px;
}

.comment-text p {
    margin-bottom: 10px;
}

/* Comment Form Styles */
.comment-form-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-form-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-form-title i {
    color: var(--color-accent);
}

.comment-form-info {
    margin-bottom: 25px;
}

.comment-form-info p {
    color: var(--color-text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-info i {
    color: var(--color-accent);
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.comment-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form-label {
    color: var(--color-white);
    font-weight: 500;
    font-size: 0.95rem;
}

.comment-form-field input,
.comment-form-field textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--color-white);
    font-size: 1rem;
    transition: all 0.3s ease;
    resize: vertical;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.1);
}

.comment-form-field input::placeholder,
.comment-form-field textarea::placeholder {
    color: var(--color-text-secondary);
}

.comment-submit-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.comment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 82, 82, 0.4);
}

.comment-submit-btn:active {
    transform: translateY(0);
}

/* Comments Pagination */
.comments-pagination {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.pagination-info {
    color: var(--color-text-secondary);
    font-size: 14px;
    text-align: center;
}

.pagination-info span {
    background: rgba(255, 82, 82, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 82, 82, 0.2);
}

.pagination-links {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 44px;
    justify-content: center;
}

.page-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 82, 82, 0.3);
    border-color: transparent;
}

.page-link.current-page {
    background: var(--gradient-primary);
    color: white;
    cursor: default;
    border-color: transparent;
}

.page-link.prev-page,
.page-link.next-page {
    padding: 10px 20px;
    font-weight: 600;
}

.page-link.prev-page i,
.page-link.next-page i {
    font-size: 12px;
}

/* Mobile Responsive for Pagination */
@media (max-width: 768px) {
    .pagination-links {
        gap: 5px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 40px;
    }
    
    .page-link.prev-page,
    .page-link.next-page {
        padding: 8px 15px;
    }
}

/* Comments Closed State */
.comments-closed {
    text-align: center;
    padding: 50px 20px;
}

.comments-closed-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 15px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.comments-closed-content i {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.comments-closed-content h4 {
    color: var(--color-white);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.comments-closed-content p {
    color: var(--color-text-secondary);
    margin: 0;
}

/* Responsive Design for Comments */
@media (max-width: 768px) {
    .comments-section {
        padding: 50px 0;
    }
    
    .comments-title {
        font-size: 1.8rem;
    }
    
    .comment-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .comment-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .author-social-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Comment Styling */

.comment,
.comment-item,
.manual-comment {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border-left: 3px solid var(--gradient-primary);
    transition: all 0.3s ease;
}

.comment:hover,
.comment-item:hover,
.manual-comment:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Pending Comments */
.pending-comment {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.pending-notice {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-notice i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.comment-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.comment-avatar img {
    border-radius: 50%;
    border: 2px solid var(--color-accent);
}

.comment-meta h5 {
    color: var(--color-accent);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.comment-date {
    color: var(--color-text-secondary);
    font-size: 13px;
    opacity: 0.8;
}

.comment-date i {
    margin-right: 5px;
}

.comment-content {
    color: var(--color-text);
    line-height: 1.6;
}

.comment-content p {
    margin: 0;
}

/* WordPress Default Comment Structure */
.commentlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.commentlist .comment {
    margin-bottom: 20px;
}

/* Comment Reply Form */
#respond {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    border: 1px solid rgba(255, 82, 82, 0.1);
}

#respond h3 {
    color: var(--color-accent);
    margin-bottom: 15px;
    font-size: 18px;
}

/* Mobile Responsive for Comments */
@media (max-width: 768px) {
    
    .comment-author-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .comment-avatar {
        align-self: flex-start;
    }
}

/* ===== ARTICLE FOOTER SECTION ===== */
.article-footer-section {
    background: var(--reading-bg);
    border-top: 2px solid var(--reading-border);
    border-bottom: 2px solid var(--reading-border);
    padding: 2rem 0;
    margin: 3rem 0;
    transition: all 0.3s ease;
}

[data-reading-theme="dark"] .article-footer-section {
    background: #1f2937;
    border-color: #374151;
}

.article-footer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Categories Section */
.article-categories {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.categories-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--reading-text);
    font-size: 0.9rem;
    min-width: fit-content;
}

.categories-label i {
    color: #6366f1;
    font-size: 0.85rem;
}

.categories-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    color: white;
}

/* Tags Section */
.article-tags {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tags-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--reading-text);
    font-size: 0.9rem;
    min-width: fit-content;
}

.tags-label i {
    color: #10b981;
    font-size: 0.85rem;
}

.tags-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Dark Mode Styles for Tags */
[data-reading-theme="dark"] .tag-badge {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #065f46;
}

[data-reading-theme="dark"] .tag-badge:hover {
    background: #10b981;
    color: white;
}

/* Responsive Design for Article Footer */
@media (max-width: 768px) {
    .article-footer-section {
        padding: 1.5rem 0;
        margin: 2rem 0;
    }
    
    .article-footer-wrapper {
        padding: 0 1rem;
    }
    
    .article-categories,
    .article-tags {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .categories-label,
    .tags-label {
        margin-bottom: 0.25rem;
    }
    
    .category-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .tag-badge {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .article-footer-wrapper {
        gap: 1rem;
    }
    
    .categories-list,
    .tags-list {
        gap: 0.5rem;
    }
    
    .category-badge,
    .tag-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}