/* ============================================
   Modern Blog Design System - Enhanced CSS
   ============================================ */

/* CSS Variables for Easy Theming */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-muted: #95a5a6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --font-base: 16px;
}

/* Dark Mode Variables */
body.dark-mode {
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-muted: #7f8c8d;
    --bg-primary: #1a1a1a;
    --bg-secondary: #2c2c2c;
    --bg-tertiary: #3a3a3a;
    --border-color: #444444;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: var(--font-base);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Skip to Content (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Hidden Featured Image (for social sharing) */
.hidden-featured-image {
    position: absolute;
    left: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Navbar Enhancements */
.navbar {
    background-color: var(--bg-primary) !important;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

body.dark-mode .navbar {
    background-color: var(--bg-secondary) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

/* Breadcrumb Styling */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}


/* Increase main content width */
.col-lg-8 {
    width: 80% !important;
    padding-right: 0px;
    padding-left: 0px;
}

.col-lg-4 {
    width: 23% !important;
    padding: 0 !important;
    margin: 0 !important;
    position: fixed !important;
    right: 0 !important;
    top: 100px;
    height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Adjust sidebar positioning */
.sidebar-sticky {
    position: relative !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.container.mt-3 {
  margin-top: -1px !important; /* or 0px to remove */
}

.container.mt-4 {
  margin-top: -1px !important; /* or 0px to remove */
}

/* Blog Post Container */
.blog-post {
    background: var(--bg-primary);
    padding: 0;
    transition: background-color var(--transition-speed);
}

/* Post Header */
.post-header {
    margin-bottom: 2rem;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
    transition: color var(--transition-speed);
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    color: var(--primary-color);
}

.category-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}

.category-link:hover {
    color: var(--secondary-color);
}

/* Featured Image */
.featured-image {
    margin: 2rem 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-speed);
}

.featured-image:hover img {
    transform: scale(1.02);
}

/* Table of Contents */
.table-of-contents {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    transition: all var(--transition-speed);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toc-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.toc-toggle {
    transition: transform var(--transition-speed);
}

.toc-header.collapsed .toc-toggle {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.toc-list.collapsed {
    display: none;
}

.toc-item {
    margin: 0.5rem 0;
}

.toc-level-3 {
    margin-left: 1.5rem;
}

.toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-speed);
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary-color);
    background: var(--bg-tertiary);
    padding-left: 1rem;
}

/* Blog Post Content Styling */
.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 2rem 0;
}

.blog-post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
}

.blog-post-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.blog-post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(52, 152, 219, 0.3);
    text-underline-offset: 3px;
    transition: all var(--transition-speed);
}

.blog-post-content a:hover {
    color: var(--secondary-color);
    text-decoration-color: var(--secondary-color);
}

.blog-post-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.blog-post-content em {
    font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-post-content li {
    margin-bottom: 0.75rem;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-speed);
}

.blog-post-content img:hover {
    transform: scale(1.02);
}

.blog-post-content .img-wrapper {
    text-align: center;
    margin: 2rem 0;
}

.blog-post-content .img-caption {
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Tables */
.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.blog-post-content table th,
.blog-post-content table td {
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: left;
}

.blog-post-content table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.blog-post-content table tr:nth-child(even) {
    background: var(--bg-secondary);
}

/* Code Blocks */
.blog-post-content pre {
    background: #2d2d2d;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.blog-post-content code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.blog-post-content pre code {
    background: transparent;
    padding: 0;
}

/* Video Container */
.blog-post-content .video-container {
    position: relative;
    width: 100%;
    margin: 2rem 0;
}

.blog-post-content .video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.blog-post-content .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Tags Section */
.blog-post-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.tags-header {
    display: flex;
    align-items: center;
    white-space: nowrap;
    margin: 0;
    font-weight: 600;
    color: #495057;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* Post Reactions */
.post-reactions {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: center;
    
}

.reactions-prompt {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0rem;
    color: var(--text-primary);
}

.reaction-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.reaction-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1.5rem;
}

.reaction-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.reaction-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.reaction-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.reaction-btn.active .reaction-count {
    color: white;
}

/* Newsletter Inline */
.newsletter-inline {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 2.5rem;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
    box-shadow: var(--shadow-lg);
    color: white;
}

.newsletter-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.newsletter-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.newsletter-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.newsletter-content p {
    margin: 0;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-form button {
    padding: 0.875rem 2rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 0 0;
    padding: 2rem 0;
    border-top: 0px solid var(--border-color);
}

.post-navigation .nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.post-navigation .nav-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.post-navigation .nav-link.disabled {
    opacity: 0;
    pointer-events: none;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.post-navigation .prev-post {
    text-align: left;
}

.post-navigation .next-post {
    text-align: right;
}

/* Next Posts Section */
.next-posts-section {
    margin-top: 0rem;
    padding-top: 0rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.next-post {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.next-post:last-child {
    border-bottom: none;
}

.next-post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
}

.continue-reading-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.post-category-badge {
    background: var(--text-secondary);
    color: white;
    padding: 0.4rem 0.875rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* End of Posts */
.end-of-posts {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.end-of-posts i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.end-of-posts h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Sidebar Styling */
.sidebar-sticky {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    transition: all var(--transition-speed);
}

.sidebar-card:hover {
    box-shadow: var(--shadow-md);
}

.sidebar-card .card-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: none;
}

.sidebar-card .card-header h5 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.related-posts-list {
    max-height: 500px;
    overflow-y: auto;
}

.related-post-item {
    display: block;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item:hover {
    background: var(--bg-secondary);
    padding-left: 2rem;
}

.related-post-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.related-post-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Social Media Sidebar */
.social-sidebar {
    position: fixed;
    left: 2px;
    top: 40%;
    transform: translateY(-50%);
    z-index: 1000;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-md);
    font-size: 1.25rem;
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-lg);
    color: white;
}

.social-btn.facebook { background: #3b5998; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.linkedin { background: #0077b5; }
.social-btn.whatsapp { background: #25d366; }
.social-btn.telegram { background: #0088cc; }
.social-btn.pinterest { background: #bd081c; }

/* Floating Action Buttons */
.floating-actions {
    position: fixed;
    left: 2px; /* Changed from right to left */
    bottom: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 999;
}

 

.fab-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-speed);
    opacity: 0;
    transform: translateY(20px);
}

.fab-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.fab-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--shadow-lg);
    background: var(--secondary-color);
}

.fab-btn i {
    font-size: 1.25rem;
}

/* Font Size Panel */
.font-panel {
    position: fixed;
    right: 80px;
    bottom: 180px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.font-panel.active {
    display: flex;
}

.font-panel button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.font-panel button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Footer Styling */
.site-footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 3px solid var(--primary-color);
}

.site-footer p {
    margin: 0;
    color: var(--text-secondary);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color var(--transition-speed);
}

.footer-link:hover {
    color: var(--primary-color);
}


/* Mobile responsive fixes */
@media (max-width: 991px) {
    .col-lg-8 {
        width: 100% !important;
        padding-right: 15px !important;
        padding-left: 15px !important;
    }
    
    .col-lg-4 {
        width: 100% !important;
        position: static !important;
        right: auto !important;
        top: auto !important;
        height: auto !important;
        overflow-y: visible !important;
        margin-top: 2rem !important;
        padding: 0 15px !important;
    }
}

@media (max-width: 768px) {
    .blog-post-title {
        font-size: 1.75rem;
    }
    
    .social-sidebar {
        position: static;
        transform: none;
        margin-bottom: 2rem;
        display: flex;
        justify-content: center;
    }
    
    .social-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
   
    
    .font-panel {
        right: 70px;
        bottom: 140px;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
    .post-navigation .next-post {
        text-align: left;
    }
    
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .blog-post-meta {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .blog-post-title {
        font-size: 1.5rem;
    }
    
    .blog-post-content {
        font-size: 1rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.25rem;
    }
    
    .social-btn,
    .fab-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .reaction-btn {
        padding: 0.75rem 1rem;
        font-size: 1.25rem;
    }
}

/* Loading Skeleton */
.skeleton-loader {
    animation: skeleton-loading 1.5s infinite ease-in-out;
}

.skeleton-title {
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
    width: 70%;
}

@keyframes skeleton-loading {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

/* Print Styles */
@media print {
    .social-sidebar,
    .floating-actions,
    .font-panel,
    .navbar,
    .breadcrumb,
    .post-navigation,
    .newsletter-inline,
    .post-reactions,
    .next-posts-section,
    .sidebar-sticky,
    .site-footer,
    .reading-progress {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .blog-post-content {
        font-size: 12pt;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility Enhancements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --text-primary: #000000;
        --bg-primary: #ffffff;
        --border-color: #000000;
    }
    
    body.dark-mode {
        --primary-color: #66b3ff;
        --text-primary: #ffffff;
        --bg-primary: #000000;
        --border-color: #ffffff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Custom Selection Color */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* Tooltip Styles */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
    margin-bottom: 5px;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Image Lazy Loading Effect */
img[data-src] {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[data-src].loaded {
    filter: blur(0);
}

/* Pullquote Styling */
.pullquote {
    font-size: 1.5em;
    line-height: 1.4;
    border-left: 5px solid var(--primary-color);
    padding-left: 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
    position: relative;
}

.pullquote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    left: -10px;
    top: -20px;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Callout Boxes */
.callout {
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.callout-info {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--primary-color);
}

.callout-warning {
    background: rgba(241, 196, 15, 0.1);
    border-color: #f1c40f;
}

.callout-success {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--secondary-color);
}

.callout-danger {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--accent-color);
}

/* Reading Time Indicator */
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Social Proof Badge */
.social-proof {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 1rem 0;
    animation: pulse 2s infinite;
}

/* Share Menu (Mobile) */
.share-menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 2px solid var(--border-color);
    padding: 2rem;
    z-index: 9999;
    transition: bottom var(--transition-speed);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.share-menu.active {
    bottom: 0;
}

.share-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.share-menu-header h4 {
    margin: 0;
}

.share-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.share-menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
}

.share-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-speed);
}

.share-menu-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-3px);
}

.share-menu-btn i {
    font-size: 1.5rem;
}

.share-menu-btn span {
    font-size: 0.8rem;
}

/* Bookmark Notification */
.bookmark-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-speed);
}

.bookmark-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Performance Optimization - Will Change */
.reading-progress,
.fab-btn,
.social-btn,
.reaction-btn {
    will-change: transform;
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Article Card Hover Effect */
.article-card {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-speed);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.article-card:hover::before {
    left: 100%;
}

/* Code Copy Button */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: all var(--transition-speed);
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--secondary-color);
}

.toast.error {
    border-left: 4px solid var(--accent-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

/* Enhanced Transitions */
.transition-all {
    transition: all var(--transition-speed) ease;
}

.transition-transform {
    transition: transform var(--transition-speed) ease;
}

.transition-opacity {
    transition: opacity var(--transition-speed) ease;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: box-shadow var(--transition-speed);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

.scale-hover {
    transition: transform var(--transition-speed);
}

.scale-hover:hover {
    transform: scale(1.05);
}

/* Newsletter Popup Modal */
.newsletter-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.newsletter-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.newsletter-popup {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.newsletter-popup-overlay.active .newsletter-popup {
    transform: scale(1);
}

.newsletter-popup-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    text-align: center;
}

.newsletter-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.newsletter-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.newsletter-popup-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.newsletter-popup-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.newsletter-popup-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.newsletter-popup-body {
    padding: 2rem;
}

.newsletter-popup-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-popup-form input {
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.newsletter-popup-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.newsletter-popup-form button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-popup-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.newsletter-popup-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.newsletter-popup-footer {
    padding: 0 2rem 2rem 2rem;
    text-align: center;
}

.newsletter-popup-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.newsletter-popup-benefits {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.newsletter-popup-benefits li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.newsletter-popup-benefits li i {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.newsletter-popup-overlay.active .newsletter-popup {
    animation: slideInUp 0.4s ease-out;
}

/* Responsive */
@media (max-width: 576px) {
    .newsletter-popup {
        width: 95%;
        margin: 1rem;
    }
    
    .newsletter-popup-header {
        padding: 1.5rem;
    }
    
    .newsletter-popup-header h3 {
        font-size: 1.5rem;
    }
    
    .newsletter-popup-body {
        padding: 1.5rem;
    }
    
    .newsletter-popup-icon {
        font-size: 2.5rem;
    }
}

/* End of CSS Framework */