/* Blog specific styles */
:root {
    --primary: #01d101;
    --secondary: #00b4d8;
    --optional: #90e0ef;
    --background: #1a1a1a;
    --card-bg: #2a2a2a;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --navbar-height: 80px;
}

body {
    padding-top: var(--navbar-height);
}

/* Blog header */
.blog-header {
    background-color: var(--background);
    padding-top: 120px;
    position: relative;
    background-image: linear-gradient(45deg, rgba(1, 209, 1, 0.1) 0%, rgba(0, 180, 216, 0.1) 100%);
}

.blog-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--optional));
}

/* Blog meta information */
.blog-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.blog-meta a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-meta a:hover {
    color: var(--primary);
}

/* Featured image */
.featured-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.featured-image:hover {
    transform: translateY(-5px);
}

.featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Table of contents */
.toc-sidebar {
    top: calc(var(--navbar-height) + 2rem);
}

.toc-card {
    background-color: var(--card-bg);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.toc-card .card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Table of Contents Styling */
.toc-card #TableOfContents {
    margin: 0;
    padding: 0;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.toc-card #TableOfContents::-webkit-scrollbar {
    width: 4px;
}

.toc-card #TableOfContents::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.toc-card #TableOfContents::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.toc-card #TableOfContents ul {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
}

.toc-card #TableOfContents > ul {
    padding-left: 0;
}

.toc-card #TableOfContents li {
    margin: 0;
}

.toc-card #TableOfContents a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    padding: 0.4rem 0.5rem;
    font-size: 0.875rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.toc-card #TableOfContents a:hover {
    color: var(--primary);
    background-color: rgba(1, 209, 1, 0.1);
    border-left-color: var(--primary);
}

.toc-card #TableOfContents a.active {
    color: var(--primary);
    background-color: rgba(1, 209, 1, 0.15);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Mobile TOC Toggle */
.toc-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.toc-mobile-toggle:hover {
    background-color: var(--secondary);
    transform: scale(1.1);
}

/* Mobile TOC Overlay */
.toc-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Prevent clicks when hidden */
}

.toc-mobile-overlay.show {
    opacity: 1;
    pointer-events: auto; /* Enable clicks when shown */
}

.toc-mobile-content {
    position: fixed;
    right: -300px;
    top: 0;
    width: 300px;
    max-width: 90vw; /* Ensure it doesn't exceed viewport */
    height: 100%;
    background-color: var(--card-bg);
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.toc-mobile-overlay.show .toc-mobile-content {
    right: 0;
}

.toc-mobile-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1003;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.toc-mobile-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Ensure mobile TOC links are clickable */
.toc-mobile-content #TableOfContents-mobile a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: block;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    position: relative;
    z-index: 1;
}

.toc-mobile-content #TableOfContents-mobile a:hover,
.toc-mobile-content #TableOfContents-mobile a:focus {
    color: var(--primary);
    background-color: rgba(1, 209, 1, 0.1);
    border-left-color: var(--primary);
}

.toc-mobile-content #TableOfContents-mobile a.active {
    color: var(--primary);
    background-color: rgba(1, 209, 1, 0.15);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Blog section styling */
.blog-section h2 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    font-size: 2rem;
}

.blog-section h3,
.blog-section h4 {
    color: var(--text-light);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.blog-section p {
    margin-bottom: 1.2rem;
    line-height: 1.8;
    color: var(--text-light);
}

.blog-section ul,
.blog-section ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.blog-section li {
    margin-bottom: 0.8rem;
    color: var(--text-light);
}

/* Quote block */
.quote-block {
    background-color: rgba(1, 209, 1, 0.1);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

.blockquote {
    margin-bottom: 0;
    font-size: 1.2rem;
    color: var(--text-light);
}

.blockquote-footer {
    color: var(--secondary);
    margin-top: 1rem;
}

/* Code block */
.code-block {
    background-color: #1a2327;
    border-radius: 8px;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.code-block pre {
    margin-bottom: 0;
    padding: 1.5rem;
    color: #e6e6e6;
    overflow-x: auto;
}

.code-block code {
    font-family: "Fira Code", "Courier New", Courier, monospace;
    font-size: 0.9rem;
}

/* CTA block */
.cta-block {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(1, 209, 1, 0.3);
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

/* Author bio */
.author-bio {
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.author-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.social-links a {
    color: var(--primary);
    font-size: 1.2rem;
    transition: all 0.3s;
    margin-right: 1rem;
}

.social-links a:hover {
    color: var(--secondary);
    transform: translateY(-2px);
}

/* Related posts */
.related-posts .card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    transition: all 0.3s;
    overflow: hidden;
}

.related-posts .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.related-posts .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: all 0.5s;
}

.related-posts .card:hover .card-img-top {
    transform: scale(1.05);
}

/* Newsletter section */
.newsletter {
    background-color: var(--card-bg) !important;
    border-radius: 12px;
    margin: 3rem 0;
}

.newsletter h3 {
    color: var(--text-light);
}

.newsletter p {
    color: var(--text-muted);
}

.newsletter-form .form-control {
    height: 50px;
    border-radius: 25px 0 0 25px;
    background-color: var(--background);
    border: 1px solid rgba(1, 209, 1, 0.3);
    color: var(--text-light);
}

.newsletter-form .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(1, 209, 1, 0.25);
}

.newsletter-form .btn {
    border-radius: 0 25px 25px 0;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    background-color: var(--primary);
    border: none;
}

.newsletter-form .btn:hover {
    background-color: var(--secondary);
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .toc-sidebar {
        display: none;
    }

    .toc-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toc-mobile-overlay {
        display: block;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding-top: 100px;
    }

    .author-bio .row {
        text-align: center;
    }

    .author-img {
        margin-bottom: 1rem;
    }

    .blog-section h2 {
        font-size: 1.75rem;
    }

    .featured-image {
        margin: 0 -1rem;
        border-radius: 0;
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .newsletter-form .form-control {
        background-color: var(--background);
        color: var(--text-light);
    }

    .newsletter-form .form-control::placeholder {
        color: var(--text-muted);
    }
} 