:root {
    /* Light Theme (Default) */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --heading-color: #111111;
    --overlay-color: rgba(0, 0, 0, 0.4);
    --accent-color: #222;
    --border-color: #ddd;
    /* Code Colors */
    --code-bg: #f3f4f6;
    --code-text: #24292f;
    --pre-bg: #f6f8fa;
    --pre-text: #24292f;
    --inline-code-bg: rgba(175, 184, 193, 0.2);
    --inline-code-text: #24292f;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --transition: background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        border-color 0.3s ease,
        transform 0.3s ease;
}

/* Dark Theme */
body.dark-mode {
    --bg-color: #0d1117;
    /* GitHub Dark Dimmed style */
    --card-bg: #161b22;
    --text-color: #c9d1d9;
    --heading-color: #f0f6fc;
    --overlay-color: rgba(0, 0, 0, 0.7);
    --accent-color: #58a6ff;
    --border-color: #30363d;
    --blockquote-color: #8b949e;

    /* Dark Mode Code Colors */
    --code-bg: #161b22;
    --code-text: #c9d1d9;
    --pre-bg: #161b22;
    --pre-text: #c9d1d9;
    --inline-code-bg: rgba(110, 118, 129, 0.4);
    --inline-code-text: #e2e8f0;
    /* Lighter text for inline code */

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.8);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ... existing styles ... */

.markdown-content code {
    background: var(--inline-code-bg);
    color: var(--inline-code-text);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
}

/* Code Blocks & Copy Button */
.code-block-wrapper {
    position: relative;
    margin-bottom: 1.5em;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.markdown-content pre {
    background: var(--pre-bg);
    color: var(--pre-text);
    padding: 16px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border-radius: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Header */
.site-header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 20px;
    position: relative;
    /* For absolute positioning of toggle */
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--heading-color);
}

/* Theme Toggle Button */
.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    line-height: 1;
}


.theme-btn:hover {
    transform: rotate(30deg) scale(1.1);
    background-color: var(--overlay-color);
}



.site-header p {
    color: #666;
    /* Note: Should use a variable like --text-muted or inherit opacity */
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.1rem;
}

/* CSS Grid for Uniform Cards */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
        /* Keep uniform height on mobile */
    }

    .blog-card.large,
    .blog-card.medium,
    .blog-card.small {
        grid-column: 1 / -1 !important;
    }
}

/* Blog Card */
.blog-card {
    display: block;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    will-change: transform;
    height: 100%;
}

.blog-card.small {
    grid-column: span 1;
    grid-row: span 1;
}

.blog-card.small {
    /* Maintained for backwards compatibility if class persists anywhere */
    grid-column: span 1;
    grid-row: span 1;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Overlay Text */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post View */
/* Post View Back Button */
.back-btn,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: transparent;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.back-btn:hover,
.back-link:hover {
    background-color: var(--heading-color);
    color: var(--bg-color);
    border-color: var(--heading-color);
    text-decoration: none;
    transform: translateX(-4px);
    box-shadow: var(--shadow-sm);
}

body.dark-mode .back-btn:hover,
body.dark-mode .back-link:hover {
    background-color: #fff;
    color: #000;
    border-color: #fff;
}

.blog-post {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
    margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--heading-color);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.post-hero-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 30px;
    max-height: 500px;
    object-fit: cover;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-body p {
    margin-bottom: 1.5em;
}

@media (max-width: 600px) {
    .blog-post {
        padding: 20px;
    }

    .post-header h1 {
        font-size: 2rem;
    }
}

/* Category Navigation */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    /* opacity: 0.8; Removed to improve contrast */
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: #999;
    color: var(--heading-color);
    /* opacity: 1; */
    background: rgba(0, 0, 0, 0.05);
    /* Subtle background on hover for better visibility */
}

body.dark-mode .filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.filter-btn.active {
    background: var(--heading-color);
    color: var(--bg-color);
    /* Inverted text color for contrast */
    border-color: var(--heading-color);
}

body.dark-mode .filter-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}


/* Instagram Button */
.instagram-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--heading-color);
    transition: transform 0.3s ease;
    padding: 5px;
    line-height: 1;
    display: inline-flex;
}

.instagram-btn:hover {
    transform: rotate(-10deg) scale(1.1);
    color: #E1306C;
    /* Instagram Brand Color */
}



/* Markdown Styles */
/* Markdown Styles */
.markdown-content h1 {
    font-size: 2rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.2;
}

.markdown-content h2 {
    font-size: 1.6rem;
    margin-top: 2em;
    margin-bottom: 0.8em;
    line-height: 1.3;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.3rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.markdown-content a {
    color: var(--heading-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.markdown-content a:hover {
    color: var(--accent-color);
    background: rgba(0, 0, 0, 0.05);
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1.5em;
    padding-left: 25px;
}

.markdown-content li {
    margin-bottom: 0.8em;
    padding-left: 5px;
}

.markdown-content blockquote {
    border-left: 4px solid var(--heading-color);
    padding-left: 20px;
    color: var(--blockquote-color);
    font-style: italic;
    margin-bottom: 2em;
    background: rgba(0, 0, 0, 0.02);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

.markdown-content code {
    background: var(--inline-code-bg);
    color: var(--inline-code-text);
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
}

/* Code Blocks & Copy Button */
.code-block-wrapper {
    position: relative;
    margin-bottom: 1.5em;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.markdown-content pre {
    background: var(--pre-bg);
    color: var(--pre-text);
    padding: 16px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    border-radius: 0;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Footer & Admin */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.site-footer a {
    color: var(--heading-color);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Resume Button */
.resume-btn {
    display: inline-block;
    background: var(--heading-color);
    color: var(--card-bg);
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid var(--heading-color);
}

.resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.9;
}

body.dark-mode .resume-btn {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Contact Form Styles */
.contact-section {
    margin-top: 20px;
}

.contact-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--heading-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

body.dark-mode .contact-form input:focus,
body.dark-mode .contact-form textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.submit-btn {
    align-self: flex-start;
    padding: 12px 30px;
    background: var(--heading-color);
    color: var(--card-bg);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 10px;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

body.dark-mode .submit-btn {
    background: #fff;
    color: #000;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--heading-color);
}

.popup-content p {
    margin-bottom: 25px;
    color: var(--text-color);
}

/* Post Date */
.post-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.post-date a:not(.category-link) {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.post-date a:not(.category-link):hover {
    color: var(--heading-color);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.popup-close-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--heading-color);
    font-weight: 600;
    transition: all 0.2s;
}

.popup-close-btn:hover {
    background: var(--heading-color);
    color: var(--bg-color);
    border-color: var(--heading-color);
}

body.dark-mode .popup-close-btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--heading-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Featured Countdown Banner */
.featured-countdown {
    margin-bottom: 40px;
}

.countdown-banner {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .countdown-banner {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 1px solid var(--border-color);
}

.banner-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #fff;
}

.banner-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.banner-badge {
    background: #e1306c;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
}

.banner-btn {
    display: inline-block;
    background: white;
    color: #333;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background: #f0f0f0;
}

@media (max-width: 600px) {
    .countdown-banner {
        padding: 30px 20px;
    }
    .banner-content h2 {
        font-size: 1.5rem;
    }
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .scroll-top-btn {
    background-color: #fff;
    color: #000;
}

/* Mobile Header Fix */
@media (max-width: 768px) {
    .site-header {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding-left: 10px;
        padding-right: 10px;
    }

    .instagram-btn,
    .theme-btn {
        position: static;
        /* Reset absolute positioning */
        transform: none;
        margin: 0;
    }

    .site-header h1 {
        width: 100%;
        /* Force new line */
        order: 1;
        /* Move below buttons */
        margin-top: 10px;
        font-size: 2rem;
        /* Smaller font */
    }

    .site-header p {
        width: 100%;
        order: 2;
    }

    .category-nav {
        width: 100%;
        order: 3;
    }

    /* Adjust hover to not rotate/move too much to avoid layout shift if needed, 
       but keeping scale is fine usually unless it causes overflow. */
}

/* Search Feature */
.search-container {
    max-width: 700px;
    /* Increased width to accommodate dropdown */
    margin: 20px auto 30px;
    position: relative;
    width: 90%;
}

.search-controls {
    display: flex;
    gap: 10px;
}

#category-filter {
    padding: 14px 40px 14px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-width: 170px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Custom subtle arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

#category-filter:hover {
    border-color: #aaa;
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

body.dark-mode #category-filter {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9d1d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    border-color: var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body.dark-mode #category-filter:hover {
    border-color: #666;
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.5);
    background-color: #1c2128;
}

#category-filter:focus {
    outline: none;
    border-color: var(--heading-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

body.dark-mode #category-filter:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

#search-input {
    flex: 1;
    /* Take remaining space */
    padding: 14px 24px;
    border-radius: 30px;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#search-input:focus {
    outline: none;
    border-color: var(--heading-color);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

body.dark-mode #search-input:focus {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    margin-top: 12px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.search-result-item {
    display: block;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-color);
}

.search-result-item .result-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: var(--heading-color);
}

.search-result-item .result-meta {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-result-item .result-category {
    background: var(--code-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--heading-color);
}

.search-result-item .result-tags {
    color: #888;
}

.search-result-item .result-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Keyboard Navigation Active State */
.search-result-item.selected {
    background: var(--bg-color);
    border-left: 4px solid var(--heading-color);
    padding-left: 16px;
    /* Adjust padding to account for border */
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    justify-content: center;
}

.tag-cloud-item {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-transform: capitalize;
}

.tag-cloud-item:hover {
    background: var(--heading-color);
    color: var(--bg-color);
    border-color: var(--heading-color);
    transform: translateY(-2px);
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.7;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Blog Tags */
.blog-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-family: 'Inter', sans-serif;
}

.blog-tags strong {
    margin-right: 10px;
    color: var(--heading-color);
}

.tag-link {
    display: inline-block;
    background: var(--code-bg);
    color: var(--text-color);
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.tag-link:hover {
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    font-size: 0.9em;
}

.category-link {
    display: inline-block;
    color: var(--heading-color);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.category-link:hover {
    background: var(--border-color);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Mobile Responsiveness for Search */
@media (max-width: 600px) {
    .search-controls {
        flex-direction: column;
        gap: 10px;
    }

    #category-filter {
        width: 100%;
        min-width: auto;
        /* Reset min-width to avoid overflow issues if any */
    }

    #search-input {
        width: 100%;
    }
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 15px;
}

.breadcrumb a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--heading-color);
    text-decoration: underline;
}

/* Timeline Layout */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background-color: var(--border-color, #e0e0e0);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    padding: 0 40px;
    box-sizing: border-box;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 24px;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color, #007bff);
    border: 4px solid var(--bg-color, #ffffff);
    border-radius: 50%;
    z-index: 1;
    box-sizing: border-box;
    box-shadow: 0 0 0 2px var(--border-color, #e0e0e0);
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:nth-child(odd)::before {
    right: -10px;
}

.timeline-item:nth-child(even)::before {
    left: -10px;
}

.timeline-item:hover::before {
    transform: scale(1.3);
    background-color: var(--accent-color, #0056b3);
}

.timeline-content {
    padding: 24px;
    background-color: var(--card-bg, #f9f9f9);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
    border: 1px solid transparent;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color, #007bff);
    margin-bottom: 8px;
    display: block;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.timeline-title {
    margin: 0 0 12px 0;
    font-size: 1.3em;
    color: var(--heading-color, #222);
    font-weight: 600;
}

.timeline-content p {
    margin: 0;
    color: var(--text-color, #555);
    line-height: 1.6;
    font-size: 0.95em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 20px;
        text-align: left !important;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item::before {
        left: 10px !important;
        right: auto !important;
    }
}

/* Dark Mode Compatibility */
body.dark-mode .timeline::before {
    background-color: #333;
}

body.dark-mode .timeline-item::before {
    border-color: #121212;
    box-shadow: 0 0 0 2px #444;
    background-color: #3b82f6;
}

body.dark-mode .timeline-content {
    background-color: #1e1e1e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

body.dark-mode .timeline-title {
    color: #eee;
}

body.dark-mode .timeline-content p {
    color: #aaa;
}

body.dark-mode .timeline-date {
    color: #60a5fa;
}

/* FAQ Accordion */
.faq-container {
    margin-bottom: 2em;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--card-bg);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: var(--hover-bg, rgba(128, 128, 128, 0.05));
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    display: inline-block;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
}

.faq-answer-content {
    overflow: hidden;
    padding: 0 1.5rem;
}

.faq-question.active+.faq-answer {
    grid-template-rows: 1fr;
}

.faq-question.active+.faq-answer .faq-answer-content {
    padding-bottom: 1.2rem;
}

.faq-answer-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
}