/* 
 * SEAMLESS READING MODAL CSS - MEDIUM-INSPIRED EXPERIENCE
 * Clean, minimal, and focused on contentfdfdfsdsd
 */

/* ===== BASE MODAL STRUCTURE ===== */
.reading-modal {
position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #0b0f1a; /* Keep your dark background */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    
    /* Hide all scrollbars completely */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.reading-modal::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Hide scrollbars on all child elements */
.reading-modal * {
    scrollbar-width: none;
    -ms-overflow-style: none;
    pointer-events: auto !important;
}

.reading-modal *::-webkit-scrollbar {
    display: none;
}

.reading-modal.active {
    opacity: 1;
    visibility: visible;
}

/* ===== SUBTLE PROGRESS BAR ===== */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    z-index: 99999;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    width: 0%;
    transition: width 0.15s ease-out;
    /* Remove all glow effects and animations */
}

.project-content {
    color: rgba(255, 255, 255, 0.85);
}
.project-section {
    margin-bottom: 3rem;
}

.project-section h3 {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ===== MINIMAL CLOSE BUTTON ===== */
.floating-close-btn {
    position: fixed !important;
    top: 2rem !important;
    right: 2rem !important;
    width: 48px !important;
    height: 48px !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;

    /* ADD THIS */
    border-radius: 50% !important; /* 👈 This makes it a circle */
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(1.05);
}

.floating-close-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* ===== CLEAN OVERLAY ===== */
.reading-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.7) !important; /* Dark background */
    z-index: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.reading-modal-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    pointer-events: none !important;
}

/* ===== MAIN CONTENT AREA ===== */
.reading-modal-content {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 3rem 4rem;
    width: 100%;
    pointer-events: auto !important; /* This blocks clicks from reaching overlay */
    position: relative;
    z-index: 3;
}

.reading-article {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
}

/* ===== ARTICLE HEADER ===== */
.article-header {    
    background: transparent;
    padding: 3rem 0 2rem; /* Very generous top/bottom padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80vh; /* Takes up most of the viewport */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center content horizontally */
    text-align: center; /* Center text */
    position: relative;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.content-type-badge {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-type-badge.blog {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.content-type-badge.project {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.reading-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    border: none;
}

.article-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 600;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
    width: 100%;
}

.article-subtitle {
    font-size: clamp(1.125rem, 3vw, 1.375rem);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 3.5rem;
    font-weight: 400;
}

.article-details {
    display: flex;
    flex-direction: column;
    justify-content: center;

}

.author-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 2rem;
    background: rgba(30, 34, 48, 0.65);
    border-radius: 1.75rem;
    border: 1.5px solid rgba(150,160,190,0.10);
    box-shadow: 0 4px 24px rgba(40,50,100,0.10);
    margin: 0 auto 1.5rem auto;
    max-width: 440px;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #232b3e; /* Subtle dark border */
    box-shadow: 0 2px 8px rgba(44,54,93,0.12), 0 1.5px 6px rgba(61,36,128,0.08); /* Soft glow */
    object-fit: cover;
    background: linear-gradient(135deg, #2d3748 60%, #111827 100%);
    transition: box-shadow 0.2s;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.1rem;
    letter-spacing: 0.01em;
}

.publish-date {
    color: #aab3c9;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.article-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.article-actions .action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
}

.article-actions .action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}
.action-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* ===== ARTICLE BODY - MEDIUM-STYLE ===== */
.article-body {
    min-height: 200px !important;
    padding: 4rem 0 3rem;
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.8;
    font-size: 1.125rem;
    display: block !important; /* Ensure it's not hidden */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.article-body:empty::after {
    content: "No content loaded";
    color: #ff6b6b;
    font-style: italic;
}

/* Typography optimized for reading */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
    margin: 3rem 0 1.5rem 0;
    scroll-margin-top: 120px;
    letter-spacing: -0.01em;
}

.article-body h1 { font-size: 2.25rem; }
.article-body h2 { font-size: 1.875rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body h4 { font-size: 1.25rem; }
.article-body h5 { font-size: 1.125rem; }
.article-body h6 { font-size: 1rem; }

.article-body p {
    margin-bottom: 1.75rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

.article-body ul,
.article-body ol {
    margin: 1.75rem 0;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

.article-body strong {
    color: #ffffff;
    font-weight: 600;
}

.article-body em {
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

.article-body code {
    background: rgba(255, 255, 255, 0.08);
    color: #fbbf24;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

.article-body pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    line-height: 1.6;
}

.article-body pre code {
    background: none;
    color: rgba(255, 255, 255, 0.9);
    padding: 0;
    font-size: 0.875rem;
}

.article-body blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-body blockquote p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    font-size: 1.1em;
}

.article-body a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    transition: all 0.2s ease;
}

.article-body a:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2.5rem 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* ===== PROJECT-SPECIFIC CONTENT ===== */
.project-content .project-section {
    margin-bottom: 3rem;
}

.project-content .tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.project-content .tech-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-content .project-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-content .project-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
}

.project-content .project-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ===== ARTICLE FOOTER ===== */
.article-footer {
    background: transparent;
    padding: 2.5rem 0 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tags-section {
    margin-bottom: 2.5rem;
}

.tags-section h3 {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.footer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.footer-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.footer-action-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .reading-modal-content {
        max-width: 90%;
        padding: 3rem 1.5rem 3rem;
    }
    
    .article-header {
        padding: 6rem 0 4rem;
        min-height: 50vh;
    }
    
    .floating-close-btn {
        top: 1.5rem;
        right: 1.5rem;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 768px) {
    .reading-modal-content {
        padding: 2rem 1rem 2rem;
    }
    
    .article-header {
        padding: 4rem 0 3rem;
        min-height: 45vh;
    }
    
    .article-meta {
        margin-bottom: 2.5rem;
    }
    
    .article-title {
        margin-bottom: 2rem;
    }
    
    .article-subtitle {
        margin-bottom: 3rem;
    }
    
    .article-details {
        padding-top: 2.5rem;
    }
    
    .article-body {
        padding: 3rem 0 2.5rem;
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .article-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
    
    .article-subtitle {
        font-size: clamp(1rem, 4vw, 1.25rem);
    }
    
    .article-details {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .footer-actions {
        flex-direction: column;
    }
    
    .footer-action-btn {
        justify-content: center;
    }
    .floating-close-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
    }
    
    .floating-close-btn {
        top: 1rem !important;
        right: 1rem !important;
        width: 48px !important;
        height: 48px !important;
        
        /* Additional mobile fixes */
        position: fixed !important;
        z-index: 999999 !important;
    }
    
    /* Mobile typography */
    .article-body h1 { font-size: 1.875rem; }
    .article-body h2 { font-size: 1.5rem; }
    .article-body h3 { font-size: 1.25rem; }
    .article-body h4 { font-size: 1.125rem; }
    .article-body h5 { font-size: 1rem; }
    .article-body h6 { font-size: 0.9375rem; }
}

@media (max-width: 480px) {
    .article-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .content-type-badge,
    .reading-time {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
    }
}

/* ===== LOADING STATES ===== */
.article-body.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.article-body.loading::after {
    content: '';
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== FOCUS MANAGEMENT ===== */
.reading-modal:focus {
    outline: none;
}

/* Remove all distracting focus outlines in reading mode */
.reading-modal.active {
    opacity: 1 !important;
    visibility: visible !important;
}