/* blog-view.css */
.blog-view-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
width: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    transform-origin: left;
    transition: transform 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

/* Loading Animation */
@keyframes pulse-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.loading-gradient {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pulse-gradient 1.5s ease-in-out infinite;
}

/* Prevent all editing */
.blog-content-non-editable,
.blog-content-non-editable * {
    -webkit-user-modify: read-only !important;
    -moz-user-modify: read-only !important;
    user-modify: read-only !important;
    cursor: default !important;
}

/* Allow text selection for copying */
.selectable-text {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    cursor: text !important;
}

/* ============ EDITOR.JS SPECIFIC STYLES ============ */

/* Headings - Editor.js specific */
.ce-header {
    font-family: 'Inter', sans-serif;
    font-weight: bold;
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.3;
    color: #111827;
}

h1.ce-header {
    font-size: 3rem !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 3rem !important;
    margin-bottom: 1.5rem !important;
}

h2.ce-header {
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    color: #1f2937;
    position: relative;
    padding-bottom: 0.75rem;
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
}

h2.ce-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 2px;
}

h3.ce-header {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    color: #374151;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

h4.ce-header {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #4b5563;
}

h5.ce-header, h6.ce-header {
    font-size: 1.25rem !important;
    color: #6b7280;
}

/* Paragraph - Editor.js specific */
.ce-paragraph {
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    margin-bottom: 1.5rem !important;
    text-align: justify;
}

/* Lists - Editor.js specific */
.cdx-list {
    margin: 1.5rem 0 !important;
    padding-left: 2rem !important;
}

.cdx-list__item {
    margin-bottom: 0.5rem !important;
    line-height: 1.6 !important;
    color: #4b5563 !important;
}

.cdx-list--unordered {
    list-style-type: disc !important;
}

.cdx-list--ordered {
    list-style-type: decimal !important;
}

/* Code Block - Editor.js specific */
.cdx-block.ce-code {
    background: #1f2937 !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
    border: 2px solid #374151 !important;
    position: relative !important;
    overflow-x: auto !important;
}

.cdx-input.ce-code__textarea {
    background: transparent !important;
    color: #e5e7eb !important;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    border: none !important;
    outline: none !important;
    resize: none !important;
    width: 100% !important;
    min-height: 200px !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: pre !important;
    overflow-x: auto !important;
}

/* Inline Code - Editor.js specific */
.codex-editor__redactor .inline-code {
    background: #f3f4f6 !important;
    color: #dc2626 !important;
    padding: 0.2rem 0.5rem !important;
    border-radius: 0.375rem !important;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    font-size: 0.9em !important;
    border: 1px solid #e5e7eb !important;
}

/* Quote - Editor.js specific */
.cdx-block.ce-quote {
    border-left: 4px solid #8b5cf6 !important;
    padding: 1.5rem 2rem !important;
    margin: 2rem 0 !important;
    background: linear-gradient(90deg, #f5f3ff, #e0e7ff) !important;
    border-radius: 0 0.75rem 0.75rem 0 !important;
    font-style: italic !important;
}

.ce-quote__text {
    font-size: 1.25rem !important;
    color: #4b5563 !important;
    line-height: 1.6 !important;
    margin-bottom: 0.5rem !important;
}

.ce-quote__caption {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
    font-style: normal !important;
    opacity: 0.8 !important;
}

/* Image - Editor.js specific */
.cdx-block.ce-image {
    margin: 2.5rem 0 !important;
}

.ce-image__picture {
    display: block !important;
    margin: 0 auto !important;
}

.ce-image__image {
    width: 100% !important;
    max-height: 600px !important;
    object-fit: contain !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    display: block !important;
    margin: 0 auto !important;
}

.ce-image__caption {
    text-align: center !important;
    font-size: 0.875rem !important;
    color: #6b7280 !important;
    margin-top: 0.75rem !important;
    font-style: italic !important;
}

/* Table - Editor.js specific */
.ce-table {
    margin: 2rem 0 !important;
    overflow-x: auto !important;
}

.tc-table {
    min-width: 100% !important;
    border-collapse: collapse !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
}

.tc-table__cell {
    border: 1px solid #e5e7eb !important;
    padding: 0.75rem 1rem !important;
    text-align: left !important;
}

.tc-table__cell--header {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border-color: #7c3aed !important;
}

.tc-table__row:nth-child(even) {
    background-color: #f9fafb !important;
}

/* Delimiter - Editor.js specific */
.ce-delimiter {
    margin: 2rem 0 !important;
    text-align: center !important;
}

.ce-delimiter::before {
    content: '•••';
    color: #9ca3af;
    font-size: 1.5rem;
    letter-spacing: 1rem;
}

/* ============ CUSTOM STYLES ============ */

/* Custom code block container with copy button */
.code-block-container {
    position: relative;
    margin: 2rem 0;
}

.code-block-container:hover .copy-code-btn {
    opacity: 1;
}

/* Copy button */
.copy-code-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(31, 41, 55, 0.9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.copy-code-btn:hover {
    background: rgba(55, 65, 81, 0.9);
}

.copy-code-btn.copied {
    background: #059669;
}

.copy-code-btn.copied:hover {
    background: #047857;
}

/* Language badge */
.language-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(139, 92, 246, 0.9);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    z-index: 10;
}

/* Syntax highlighting */
pre code {
    display: block;
    padding: 1.5rem !important;
    overflow-x: auto;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e5e7eb;
}

/* Syntax highlighting colors */
pre code .keyword { color: #f472b6; }       /* pink */
pre code .function { color: #60a5fa; }     /* blue */
pre code .string { color: #34d399; }       /* green */
pre code .comment { color: #9ca3af; }      /* gray */
pre code .number { color: #fbbf24; }       /* yellow */
pre code .operator { color: #c084fc; }     /* purple */
pre code .class-name { color: #38bdf8; }   /* light blue */
pre code .tag { color: #f87171; }          /* red */
pre code .attr-name { color: #4ade80; }    /* light green */
pre code .attr-value { color: #fb923c; }   /* orange */

/* Links */
a {
 
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}


a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
   
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Tag pills */
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bae6fd;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 105, 161, 0.15);
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.tag-pill i {
    margin-right: 0.375rem;
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Share buttons */
.share-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.share-btn i {
    margin-right: 0.5rem;
}

/* Newsletter */
.newsletter-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    h1.ce-header {
        font-size: 2.25rem !important;
    }
    
    h2.ce-header {
        font-size: 1.875rem !important;
    }
    
    h3.ce-header {
        font-size: 1.5rem !important;
    }
    
    .ce-paragraph {
        font-size: 1.0625rem !important;
    }
    
    .ce-image__image {
        max-height: 400px !important;
    }
    
    .code-block-container {
        margin: 1.5rem 0;
    }
    
    pre code {
        padding: 1rem !important;
        font-size: 0.875rem;
    }
    
    .copy-code-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ===== CODE BLOCK STYLE ===== */
.code-wrapper {
    background: #0d1117;
    border-radius: 10px;
    margin: 24px 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.code-header {
    background: #161b22;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #c9d1d9;
}

.code-lang {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.copy-btn {
    background: #238636;
    color: white;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: .2s;
}

.copy-btn:hover {
    background: #2ea043;
}

/* Prism overrides */
pre[class*="language-"] {
    margin: 0;
    padding: 18px !important;
    background: #0d1117 !important;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
}

code[class*="language-"] {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    color: #c9d1d9;
}
