/* Enhanced Blog Single Page - Modern Design System */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeInDelay {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-10px); 
    }
}

@keyframes shimmer {
    0% { 
        background-position: -200% 0; 
    }
    100% { 
        background-position: 200% 0; 
    }
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.7; 
    }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-delay {
    animation: fadeInDelay 1s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Enhanced Blog Content Styling */
.blog-content {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    color: #374151;
    max-width: none;
}

/* Heading Styles */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    color: #1f2937;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 6rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.blog-content h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 3px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
}

.blog-content h2 {
    font-size: 2rem;
    color: #1f2937;
    position: relative;
    padding: 1.5rem 0 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 0.75rem;
    margin: 3rem 0 2rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.blog-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 0 0.375rem 0.375rem 0;
}

.blog-content h3 {
    font-size: 1.75rem;
    color: #3b82f6;
    position: relative;
    padding-left: 1.5rem;
}

.blog-content h3::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #8b5cf6;
    font-size: 0.875rem;
    top: 0.35rem;
}

.blog-content h4 {
    font-size: 1.5rem;
    color: #4f46e5;
}

.blog-content h5 {
    font-size: 1.25rem;
    color: #6366f1;
}

.blog-content h6 {
    font-size: 1.125rem;
    color: #7c3aed;
}

/* Paragraph Styles */
.blog-content p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
    font-size: 1.125rem;
}

.blog-content p:first-of-type {
    font-size: 1.25rem;
    font-weight: 500;
    color: #1f2937;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 2rem;
    border-radius: 1rem;
    border-left: 4px solid #8b5cf6;
    margin-bottom: 2.5rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.blog-content p:first-of-type::before {
    content: '"';
    font-size: 4rem;
    color: #8b5cf6;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

/* Link Styles */
.blog-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.1) 100%);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border-bottom: 2px solid transparent;
}

.blog-content a:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-bottom-color: #3b82f6;
    transform: translateY(-1px);
}

/* Image Styles */
.blog-content img {
    border-radius: 1rem;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
    margin: 3rem auto;
    max-width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
    image-rendering: optimizeQuality;
    -webkit-image-rendering: -webkit-optimize-contrast;
    -moz-image-rendering: crisp-edges;
}

.blog-content img:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

/* Blockquote Styles */
.blog-content blockquote {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 3rem 0;
    padding: 2.5rem;
    border-radius: 1rem;
    font-style: italic;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-size: 1.25rem;
    line-height: 1.7;
}

.blog-content blockquote::before {
    content: '"';
    font-size: 5rem;
    color: #3b82f6;
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    opacity: 0.15;
    font-family: Georgia, serif;
    line-height: 1;
}

.blog-content blockquote p {
    margin: 0;
    padding-left: 3rem;
    position: relative;
    z-index: 1;
    text-align: left;
}

/* Code Styles */
.blog-content code {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875em;
    color: #1e293b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.blog-content pre {
    background: linear-gradient(135deg, #1e293b, #374151);
    color: #f1f5f9;
    padding: 2.5rem;
    border-radius: 1rem;
    overflow-x: auto;
    margin: 3rem 0;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
}

.blog-content pre::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 24px 0 #f59e0b, 48px 0 #10b981;
}

.blog-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 400;
}

/* List Styles */
.blog-content ul,
.blog-content ol {
    margin: 2.5rem 0;
    padding-left: 2.5rem;
}

.blog-content li {
    margin: 1.25rem 0;
    line-height: 1.8;
    position: relative;
    font-size: 1.125rem;
}

.blog-content ul li {
    list-style: none;
}

.blog-content ul li::before {
    content: '▶';
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: -2rem;
    font-size: 0.875rem;
    top: 0.125rem;
}

.blog-content ol {
    counter-reset: list-counter;
}

.blog-content ol li {
    counter-increment: list-counter;
    list-style: none;
}

.blog-content ol li::before {
    content: counter(list-counter);
    position: absolute;
    left: -2.5rem;
    top: 0;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

/* Table Styles */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 3rem 0;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.blog-content th,
.blog-content td {
    padding: 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.blog-content th {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
    font-size: 1rem;
}

.blog-content tr:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.blog-content tr:last-child td {
    border-bottom: none;
}

/* Special Content Elements */
.blog-content .highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #f59e0b;
    font-weight: 600;
    display: inline-block;
    margin: 0.5rem 0;
}

.blog-content .callout {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #93c5fd;
    border-radius: 1rem;
    padding: 2rem;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.blog-content .callout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.blog-content .info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border-left: 4px solid #3b82f6;
}

.blog-content .warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #f59e0b;
}

.blog-content .danger {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    border-left: 4px solid #ef4444;
}

.blog-content .success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 4px solid #10b981;
}

/* Floating Action Buttons */
.floating-buttons {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.floating-buttons button {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.floating-buttons button:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.floating-buttons button:active {
    transform: translateY(-1px) scale(1.05);
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    right: 4.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1001;
}

.floating-buttons button:hover .tooltip {
    opacity: 1;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(59, 130, 246, 0.1);
    z-index: 1000;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.1s ease-out;
}

/* Sidebar Styles */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Table of Contents */
.toc {
    max-height: 400px;
    overflow-y: auto;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    display: block;
    padding: 0.25rem 0;
}

.toc a:hover,
.toc a.active {
    color: #3b82f6;
    font-weight: 600;
}

.toc .toc-h3 {
    margin-left: 1rem;
    font-size: 0.8rem;
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .floating-buttons {
        right: 1rem;
        bottom: 1rem;
    }
    
    .floating-buttons button {
        width: 3rem;
        height: 3rem;
    }
    
    .tooltip {
        display: none;
    }
}

@media (max-width: 768px) {
    .blog-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .blog-content h1 {
        font-size: 2rem;
    }
    
    .blog-content h2 {
        font-size: 1.75rem;
        padding: 1rem 0 1rem 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.5rem;
    }
    
    .blog-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        text-align: left;
    }
    
    .blog-content p:first-of-type {
        font-size: 1.125rem;
        padding: 1.5rem;
    }
    
    .blog-content blockquote {
        padding: 1.5rem;
        font-size: 1.125rem;
        margin: 2rem 0;
    }
    
    .blog-content pre {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .blog-content ul,
    .blog-content ol {
        padding-left: 2rem;
    }
    
    .blog-content li {
        font-size: 1rem;
    }
    
    .blog-content th,
    .blog-content td {
        padding: 1rem;
    }
    
    .sidebar-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .blog-content {
        color: #e5e7eb;
    }
    
    .blog-content h1,
    .blog-content h2,
    .blog-content h3,
    .blog-content h4,
    .blog-content h5,
    .blog-content h6 {
        color: #f9fafb;
    }
    
    .blog-content p:first-of-type {
        background: linear-gradient(135deg, #374151, #4b5563);
        color: #f3f4f6;
    }
    
    .blog-content blockquote {
        background: linear-gradient(135deg, #374151, #4b5563);
        color: #e5e7eb;
    }
    
    .sidebar-card {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
}

/* Print Styles */
@media print {
    .floating-buttons,
    .progress-bar,
    .sidebar {
        display: none !important;
    }
    
    .blog-content {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }
    
    .blog-content h1,
    .blog-content h2,
    .blog-content h3 {
        page-break-after: avoid;
        color: #000;
    }
    
    .blog-content img {
        max-width: 100%;
        height: auto;
        box-shadow: none;
    }
    
    .blog-content a {
        color: #000;
        text-decoration: underline;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles */
.blog-content a:focus,
.floating-buttons button:focus,
.toc a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDelay {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInFromRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInFromLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-delay {
    animation: fadeInDelay 1s ease-out 0.3s forwards;
    opacity: 0;
}

.animate-slide-in-right {
    animation: slideInFromRight 0.6s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInFromLeft 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Enhanced Typography */
.font-display {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Floating Navigation */
.floating-nav {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Progress Bar */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* Table of Contents */
.toc-nav a {
    transition: all 0.2s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: block;
    color: #6b7280;
}

.toc-nav a:hover {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #3b82f6;
    transform: translateX(4px);
}

.toc-nav a.active {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    font-weight: 600;
}

.toc-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.toc-nav a.active::before {
    height: 70%;
}

/* Floating Action Buttons */
.fab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.15);
}

.fab:hover {
    box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.25);
    transform: scale(1.1) translateY(-2px);
}

/* Enhanced Cards */
.card-enhanced {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

.card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Glass Morphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Author bio enhancements */
.author-bio {
    background: linear-gradient(135deg, #fefefe 0%, #f9fafb 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 3rem 0;
    border: 1px solid #f3f4f6;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.author-info {
    margin-left: 1.5rem;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.author-title {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.author-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.author-social {
    display: flex;
    gap: 0.75rem;
}

.author-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
}

.author-social a:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    transform: translateY(-2px);
}

/* Related articles */
.related-articles {
    display: grid;
    gap: 1.5rem;
    margin: 3rem 0;
}

@media (min-width: 768px) {
    .related-articles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .related-articles {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-article {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.related-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.related-article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article:hover .related-article-image {
    transform: scale(1.05);
}

.related-article-content {
    padding: 1.5rem;
}

.related-article-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.related-article-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.related-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .animate-fade-in,
    .animate-fade-in-delay,
    .animate-slide-in-right,
    .animate-slide-in-left {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .floating-nav {
        top: 10px;
        left: 0.5rem;
        right: 0.5rem;
        margin: 0;
        padding: 0.75rem;
        border-radius: 0.75rem;
    }
    
    .fab {
        width: 44px;
        height: 44px;
        right: 1rem;
    }
    
    .card-enhanced {
        border-radius: 12px;
        margin: 0.5rem;
    }
    
    .author-bio {
        padding: 1.5rem;
    }
    
    .author-bio .flex {
        flex-direction: column;
        text-align: center;
    }
    
    .author-info {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .related-articles {
        grid-template-columns: 1fr;
    }
    
    /* Hide TOC on mobile by default */
    .toc-sidebar {
        width: 100vw;
        left: 0;
    }
    
    /* Adjust hero section for mobile */
    .hero-section {
        padding-top: 4rem;
        padding-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    /* Better content spacing on mobile */
    .blog-content {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .blog-content h1 {
        font-size: 1.75rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.25rem;
    }
    
    /* Mobile share buttons */
    .mobile-share {
        position: fixed;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        z-index: 40;
        background: white;
        border-radius: 1rem;
        padding: 1rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-share.show {
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .floating-nav,
    .fab,
    .tooltip,
    .glass,
    .glass-dark {
        display: none !important;
    }
    
    .card-enhanced {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .author-bio {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .glass,
    .glass-dark {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: none;
        border-color: #000;
    }
    
    .floating-nav {
        background: white;
        border: 2px solid #000;
    }
}

/* Line clamp utilities for text truncation */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Enhanced hover effects for blog cards */
.blog-card {
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Featured post gradient overlay */
.featured-overlay {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(147, 51, 234, 0.9) 100%);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom prose styles for blog content */
.blog-prose {
    line-height: 1.8;
    color: #374151;
}

.blog-prose h1,
.blog-prose h2,
.blog-prose h3,
.blog-prose h4,
.blog-prose h5,
.blog-prose h6 {
    color: #1f2937;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-prose h1 {
    font-size: 2.25rem;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 0.5rem;
}

.blog-prose h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.blog-prose h3 {
    font-size: 1.5rem;
}

.blog-prose p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.blog-prose img {
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    max-width: 100%;
    height: auto;
}

.blog-prose a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.blog-prose a:hover {
    color: #1d4ed8;
    border-bottom-color: #3b82f6;
}

.blog-prose blockquote {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    font-style: italic;
    position: relative;
}

.blog-prose blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #3b82f6;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    opacity: 0.3;
}

.blog-prose code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #1e293b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.blog-prose pre {
    background: #1e293b;
    color: #f1f5f9;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
    position: relative;
}

.blog-prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.blog-prose ul,
.blog-prose ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.blog-prose li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.blog-prose ul li::marker {
    color: #3b82f6;
}

.blog-prose ol li::marker {
    color: #3b82f6;
    font-weight: 600;
}

.blog-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.blog-prose th,
.blog-prose td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.blog-prose th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Search bar animation */
.search-input:focus {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Category filter pills */
.category-pill {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.category-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.category-pill:hover::before {
    left: 100%;
}

/* Loading animation for images */
.blog-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 50;
}

.fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* Responsive design improvements */
@media (max-width: 640px) {
    .blog-prose h1 {
        font-size: 1.875rem;
    }
    
    .blog-prose h2 {
        font-size: 1.5rem;
    }
    
    .blog-prose h3 {
        font-size: 1.25rem;
    }
    
    .blog-prose {
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .blog-prose {
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .blog-prose a {
        color: #000;
        text-decoration: underline;
    }
    
    .blog-prose img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
.blog-card:focus,
.category-pill:focus,
button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .blog-prose {
        color: #e5e7eb;
    }
    
    .blog-prose h1,
    .blog-prose h2,
    .blog-prose h3,
    .blog-prose h4,
    .blog-prose h5,
    .blog-prose h6 {
        color: #f9fafb;
    }
    
    .blog-prose blockquote {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-left-color: #60a5fa;
    }
    
    .blog-prose code {
        background: #374151;
        color: #e5e7eb;
    }
}

/* Enhanced Blog Single Page Content Styling */
.blog-content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.8;
    color: #374151;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    color: #1f2937;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 6rem;
    letter-spacing: -0.025em;
}

.blog-content h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 3px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.blog-content h2 {
    font-size: 2rem;
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin: 3rem 0 2rem 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.blog-content h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 0 0.375rem 0.375rem 0;
}

.blog-content h3 {
    font-size: 1.75rem;
    color: #3b82f6;
    position: relative;
    padding-left: 1rem;
}

.blog-content h3::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #8b5cf6;
    font-size: 0.875rem;
    top: 0.25rem;
}

.blog-content p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
}

.blog-content img {
    border-radius: 1rem;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
    margin: 2.5rem auto;
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-content img:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.blog-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, transparent 0%, rgba(37, 99, 235, 0.1) 100%);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.blog-content a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.blog-content a:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.blog-content a:hover::before {
    width: 100%;
}

.blog-content blockquote {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin: 2.5rem 0;
    padding: 2rem;
    border-radius: 0.75rem;
    font-style: italic;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-size: 1.125rem;
    line-height: 1.7;
}

.blog-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #3b82f6;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

.blog-content blockquote p {
    margin: 0;
    padding-left: 2rem;
    position: relative;
    z-index: 1;
}

.blog-content code {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875em;
    color: #1e293b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.blog-content pre {
    background: linear-gradient(135deg, #1e293b, #374151);
    color: #f1f5f9;
    padding: 2rem;
    border-radius: 1rem;
    overflow-x: auto;
    margin: 2.5rem 0;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #475569;
}

.blog-content pre::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 24px 0 #f59e0b, 48px 0 #10b981;
}

.blog-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
}

.blog-content ul,
.blog-content ol {
    margin: 2rem 0;
    padding-left: 2rem;
}

.blog-content li {
    margin: 1rem 0;
    line-height: 1.8;
    position: relative;
}

.blog-content ul li {
    list-style: none;
}

.blog-content ul li::before {
    content: '▶';
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: -1.5rem;
    font-size: 0.75rem;
    top: 0.25rem;
}

.blog-content ol li {
    counter-increment: list-counter;
}

.blog-content ol {
    counter-reset: list-counter;
}

.blog-content ol li::before {
    content: counter(list-counter);
    position: absolute;
    left: -2rem;
    top: 0;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.blog-content th,
.blog-content td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.blog-content th {
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
}

.blog-content tr:hover {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.blog-content tr:last-child td {
    border-bottom: none;
}