/* Blog Components CSS */

/* 0. Global Body Styles */
body {
    background-color: #0A0A0F;
    color: #E2E8F0;
    overflow-x: hidden;
}

/* 1. Floating Share Sidebar */
.share-sidebar {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-sidebar.visible {
    opacity: 1;
    visibility: visible;
}

.share-link {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(19, 19, 31, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.share-link:hover {
    background: #FCD34D;
    color: #0A0A0F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 211, 77, 0.2);
}

@media (max-width: 1280px) {
    .share-sidebar {
        display: none;
    }
}

/* 2. Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #fbbf24);
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* 3. Custom Prose Styles (Overrides) */
.prose p {
    margin-bottom: 1.5em;
    line-height: 1.8;
}

.prose h2 {
    font-size: 2rem;
    margin-top: 2.5em;
    margin-bottom: 1em;
}

.prose h3 {
    font-size: 1.5rem;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5em;
    margin-bottom: 1.5em;
}

.prose li {
    margin-bottom: 0.5em;
}

.prose code {
    background-color: #1F2937;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-size: 0.9em;
    color: #FCD34D;
}

.prose pre {
    background-color: #1F2937;
    padding: 1em;
    border-radius: 0.5em;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5em;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* 4. Common Utilities */
.noise-overlay::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 50;
    opacity: 0.4;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    color: #9ca3af;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 5. Animations & Effects (The "Vibe") */
@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(252, 211, 77, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(252, 211, 77, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(252, 211, 77, 0);
    }
}

.cta-glow {
    animation: glow-pulse 2s infinite;
    position: relative;
    z-index: 10;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 6. Unified Design System (The "Glass Stack") */
.glass-panel {
    background: rgba(13, 13, 22, 0.7);
    /* Deep, dark tint */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 2px 4px -1px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    /* Inner highlight */
    border-radius: 1.5rem;
    /* rounded-3xl */
    padding: 2rem;
    /* p-8: Generous breathing room */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
    will-change: transform;
    /* Performance optimization */
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(19, 19, 31, 0.8);
    transform: translateY(-4px);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.4),
        0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* 7. Neural HUD TOC (UX Reform) */
.toc-container {
    /* Removed Glass Panel styles for "Rail" look */
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
    margin-bottom: 3rem;
    position: relative;
}

.toc-header {
    font-family: 'Inter', sans-serif;
    /* Tech/Modern feeling */
    font-size: 0.75rem;
    /* XS label */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #6B7280;
    /* Muted */
    margin-bottom: 1rem;
    padding-left: 1rem;
    /* Align with text, not border */
}

#toc-nav {
    position: relative;
}

/* The continuous rail line */
#toc-nav::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
}

#toc-nav a {
    display: block;
    font-size: 0.85rem;
    /* Compact clean text */
    color: #9CA3AF;
    padding: 0.35rem 0 0.35rem 1.25rem;
    /* Tight spacing, indentation */
    border-left: 2px solid transparent;
    /* The active marker */
    margin-left: 0;
    /* Overlap the rail line */
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    line-height: 1.4;
}

#toc-nav a:hover {
    color: #F3F4F6;
    border-left-color: rgba(255, 255, 255, 0.2);
}

#toc-nav a.text-accent,
#toc-nav a.active {
    color: #FFFFFF !important;
    font-weight: 600;
    border-left-color: #FCD34D;
    /* Gold Neural Link */
    box-shadow: -1px 0 15px rgba(252, 211, 77, 0.2);
    /* Subtle glow on the rail */
    background: linear-gradient(90deg, rgba(252, 211, 77, 0.03), transparent);
}