/* ================================= */
/* Theme Variables - Light Theme (Default) */
/* ================================= */
:root {
    /* Refined color palette - Option 1 */
    --primary-color: #d85a1f;      /* Muted orange - less eye strain */
    --secondary-color: #044571;    /* Deeper blue - more professional */
    --tertiary-color: #16a34a;     /* Green for success states */
    --third-color: #999999;        /* Neutral gray */
    --background-color: #ffffff;
    --text-color: #333333;
    --navbar-bg: var(--secondary-color);
    --navbar-text: #ffffff;
    --navbar-hover: var(--primary-color);
    --footer-bg: var(--secondary-color);
    --footer-text: #ffffff;

    /* PaperMod theme variables for light theme */
    --gap: 24px;
    --content-gap: 20px;
    --nav-width: 1024px;
    --main-width: 720px;
    --header-height: 60px;
    --footer-height: 60px;
    --radius: 8px;
    --theme: rgb(255, 255, 255);
    --entry: rgb(255, 255, 255);
    --primary: rgb(30, 30, 30);
    --secondary: rgb(108, 108, 108);
    --tertiary: rgb(214, 214, 214);
    --content: rgb(31, 31, 31);
    --code-block-bg: rgb(28, 29, 33);
    --code-bg: rgb(245, 245, 245);
    --border: rgb(238, 238, 238);
}

/* Dark Theme Overrides */
.dark {
    --background-color: #0d1117;   /* GitHub dark - improved contrast */
    --text-color: #f0f0f0;
    --navbar-bg: var(--primary-color);
    --navbar-text: #ffffff;
    --footer-bg: var(--primary-color);
    --footer-text: #ffffff;

    /* PaperMod theme variables */
    --theme: rgb(29, 30, 32);
    --entry: rgb(46, 46, 51);
    --primary: rgb(218, 218, 219);
    --secondary: rgb(155, 156, 157);
    --tertiary: rgb(65, 66, 68);
    --content: rgb(196, 196, 197);
    --code-block-bg: rgb(46, 46, 51);
    --code-bg: rgb(55, 56, 62);
    --border: rgb(51, 51, 51);
}

/* ================================= */
/* Global Reset & Base */
/* ================================= */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* ================================= */
/* Navbar */
/* ================================= */
.navbar {
    background-color: var(--navbar-bg);
    color: var(--navbar-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-title {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--navbar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
    background-color: white;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-title:hover .navbar-logo {
    transform: scale(1.1);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: var(--navbar-text);
    text-decoration: none;
    margin-left: 15px;
    font-weight: bold;
}

.nav-links a:hover {
    color: var(--navbar-hover);
}

#theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    margin-left: 15px;
}

/* ================================= */
/* Main Content Wrapper */
/* ================================= */
main.content {
    min-height: calc(100vh - 200px);
    background-color: var(--background-color);
}

main.home {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* Homepage backgrounds removed - use default theme backgrounds */

/* ================================= */
/* Homepage Hero Section */
/* ================================= */
.home-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    background-color: var(--background-color);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: 40px 20px;
}

.site-logo {
    margin-bottom: 80px;
}

.site-logo img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.home-social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.home-social-icons a {
    color: var(--primary-color);
    font-size: 2rem;
    transition: all 0.3s ease;
}

.home-social-icons a:hover {
    color: var(--secondary-color);
    transform: scale(1.2);
}

/* ================================= */
/* Scramble Text Area */
/* ================================= */
#scramble-text-container {
    margin-top: 30px;
    margin-bottom: 80px;
    font-size: 3.5rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

#scramble-text {
    filter: blur(0.3px);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: color-alternate 2s ease infinite;
}

@keyframes color-alternate {
    0%, 100% {
        color: var(--primary-color);
    }
    50% {
        color: var(--secondary-color);
    }
}

/* Optional 'fuzzy' ghost text effect */
.ghost {
    opacity: 0.5;
    color: var(--third-color);
}

/* ================================= */
/* Footer */
/* ================================= */
footer,
.site-footer {
    background-color: var(--footer-bg) !important;
    color: var(--footer-text) !important;
    text-align: center;
    padding: 30px 20px !important;   /* Increased from 10px - more breathing room */
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);  /* More visible separator */
    margin-top: 60px;
}

.site-footer p,
.site-footer a {
    color: var(--footer-text) !important;
}

.site-footer a:hover {
    opacity: 0.8;
}

/* ================================= */
/* Post Listings (Homepage) */
/* ================================= */
.post-list {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.post-section {
    margin-bottom: 60px;
}

.post-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.post-card {
    background-color: var(--background-color);
    border: 1px solid var(--third-color);
    border-radius: 0;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

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

.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--third-color);
}

.post-meta time {
    font-style: italic;
}

.post-meta .tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.post-meta .tag {
    background-color: var(--secondary-color);
    color: var(--background-color);
    padding: 3px 10px;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.post-meta .tag:hover {
    background-color: var(--primary-color);
}

.post-card .summary {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.view-all {
    text-align: center;
    margin-top: 30px;
}

.view-all .button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: var(--background-color);
    text-decoration: none;
    border-radius: 0;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s;
}

.view-all .button:hover {
    background-color: var(--primary-color);
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-section h2 {
        font-size: 1.5rem;
    }
}

/* ================================= */
/* List Pages (Blog & HTB Archives) */
/* ================================= */
.list-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--background-color);
}

.page-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin: 0 0 15px 0;
    font-weight: 700;
}

.page-description {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
}

.list-page .post-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.list-page .post-card {
    background-color: var(--background-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0;
    padding: 25px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.list-page .post-card:hover {
    box-shadow: 0 4px 16px rgba(216, 90, 31, 0.2);
    border-left-color: var(--secondary-color);
}

.list-page .post-card h2 {
    margin: 0 0 12px 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.list-page .post-card h2 a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.list-page .post-card h2 a:hover {
    color: var(--primary-color);
}

.list-page .post-card .summary {
    margin: 12px 0 15px 0;
    line-height: 1.7;
    color: var(--text-color);
    opacity: 0.9;
}

.list-page .post-card .read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background-color: var(--secondary-color);
    color: var(--background-color);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
}

.list-page .post-card .read-more:hover {
    background-color: var(--primary-color);
    transform: translateX(5px);
}

/* ================================= */
/* Single Post Pages */
/* ================================= */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    gap: 40px;
    position: relative;
}

.single-post {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--background-color);
}

.post-header {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid var(--secondary-color);
}

.post-title {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin: 0 0 20px 0;
    line-height: 1.3;
    font-weight: 700;
}

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

/* Content Typography */
.post-content h1 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin: 40px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 700;
}

.post-content h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin: 35px 0 15px 0;
    font-weight: 600;
}

.post-content h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.post-content h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.post-content p {
    margin: 15px 0;
}

.post-content ul, .post-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.post-content li {
    margin: 8px 0;
}

.post-content a {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-color);
    transition: all 0.2s;
}

.post-content a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    background-color: rgba(216, 90, 31, 0.05);
    padding: 15px 20px;
    margin: 25px 0;
    font-style: italic;
    color: var(--text-color);
}

/* Inline code styling */
.post-content code:not(.chroma code) {
    background-color: rgba(216, 90, 31, 0.1);
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 0;
    font-family: 'Courier New', 'Menlo', 'Monaco', monospace;
    font-size: 0.9em;
    font-weight: 500;
}

.dark .post-content code:not(.chroma code) {
    background-color: rgba(216, 90, 31, 0.2);
    color: var(--primary-color);
}

/* Code block container styling - Terminal-like black background for both themes */
.post-content pre {
    background-color: #0d0d0d;
    border: none;
    padding: 20px;
    border-radius: 0;
    overflow-x: auto;
    margin: 25px 0;
}

/* Dark theme - same terminal-like styling */
.dark .post-content pre {
    background-color: #0d0d0d;
    border: none;
}

.post-content pre code {
    color: #ffffff !important;
    background-color: transparent !important;
}


.dark .post-content pre code {
    color: #ffffff !important;
    background-color: transparent !important;
}

body.dark .post-content pre code {
    color: #ffffff !important;
    background-color: transparent !important;
}

html.dark .post-content pre code {
    color: #ffffff !important;
    background-color: transparent !important;
}

/* Chroma syntax highlighted code blocks with terminal-style header */
.post-content .highlight:not(table),
.highlight:not(table),
div.highlight:not(table) {
    background-color: #0d0d0d !important;
    margin: 25px 0 !important;
    position: relative;
    padding-top: 40px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding-bottom: 20px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    border-radius: 0 !important;
}

/* Remove theme's background from pre inside highlight */
.post-content .highlight pre,
.highlight pre {
    margin: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* Hide copy code button and any CODE text */
.copy-code,
.highlight .copy-code,
div.highlight .copy-code,
.post-content .copy-code,
button.copy-code {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

/* Terminal-style header for code blocks */
.post-content .highlight::before,
.highlight::before,
div.highlight::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: #343a40;
    border-bottom: 1px solid #2c3136;
}

/* MacOS-style buttons for code blocks */
.post-content .highlight::after,
.highlight::after,
div.highlight::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff5f57;
    box-shadow:
        20px 0 0 #febc2e,
        40px 0 0 #28c840;
}

/* Chroma content - completely transparent, no inner box */
.post-content .chroma,
.chroma,
.highlight .chroma,
.post-content .highlight .chroma {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: auto;
    box-shadow: none !important;
}

/* Dark theme - same styling */
.dark .post-content .chroma,
.dark .chroma {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
}

/* Remove ALL styling from pre and code inside highlight */
.post-content .highlight pre,
.highlight pre,
.post-content pre code,
.highlight pre code,
.post-content .highlight pre code {
    background-color: transparent !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    font-family: 'Courier New', 'Menlo', 'Monaco', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    display: block !important;
}

/* Chroma specific overrides */
.chroma .lntd:first-child {
    padding-right: 15px;
}

.chroma code {
    background-color: transparent !important;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    margin: 20px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content table th,
.post-content table td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

.post-content table th {
    background-color: var(--secondary-color);
    color: var(--background-color);
    font-weight: 600;
}

.post-content table tr:nth-child(even) {
    background-color: rgba(4, 69, 113, 0.05);
}

.post-content table tr:hover {
    background-color: rgba(216, 90, 31, 0.05);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 0.95rem;
}

.post-meta time {
    color: var(--third-color);
    font-weight: 500;
}

.post-meta .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-meta .tag {
    background-color: var(--secondary-color);
    color: var(--background-color);
    padding: 4px 12px;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.post-meta .tag:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 3px solid var(--secondary-color);
    gap: 20px;
}

.nav-previous, .nav-next {
    flex: 1;
}

.nav-next {
    text-align: right;
}

.post-navigation a {
    display: block;
    padding: 20px;
    background-color: rgba(4, 69, 113, 0.05);
    border-left: 4px solid var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.post-navigation a:hover {
    background-color: rgba(216, 90, 31, 0.1);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.nav-previous a:hover {
    transform: translateX(-5px);
}

.nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--third-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-title {
    display: block;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h1 {
        font-size: 1.75rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .nav-next {
        text-align: left;
    }
}

/* ================================= */
/* Floating Table of Contents */
/* ================================= */
.floating-toc {
    position: sticky;
    top: 100px;
    width: 280px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    background: var(--secondary-color);
    border: 3px solid var(--secondary-color);
    border-left: 6px solid var(--primary-color);
    padding: 20px;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toc-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toc-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-content li {
    margin: 8px 0;
}

.toc-content a {
    color: #ffffff;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.toc-content a:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.3);
    padding-left: 18px;
    transform: translateX(3px);
    font-weight: 600;
}

.toc-content ul ul {
    padding-left: 15px;
    margin-top: 5px;
}

.toc-content ul ul a {
    font-size: 0.85rem;
    color: var(--third-color);
    border-left-width: 3px;
}

.toc-content ul ul a:hover {
    color: var(--secondary-color);
}

/* Dark Theme TOC */
.dark .floating-toc {
    background: var(--primary-color);
    border-color: var(--primary-color);
    border-left-color: #4dabf7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.dark .toc-title {
    color: #ffffff;
    border-bottom-color: #4dabf7;
}

.dark .toc-content a {
    color: #ffffff;
}

.dark .toc-content a:hover {
    color: #4dabf7;
    background: rgba(77, 171, 247, 0.3);
    border-left-color: #4dabf7;
}

/* Hide TOC on smaller screens */
@media (max-width: 1200px) {
    .floating-toc {
        display: none;
    }

    .page-container {
        max-width: 900px;
    }
}

/* ================================= */
/* MacOS-Style Terminal Blocks */
/* ================================= */

/* Base Terminal Styling */
.terminal-block {
    margin: 25px 0;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border: none;
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    position: relative;
    user-select: none;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 15px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-button.close {
    background-color: #ff5f57;
}

.terminal-button.minimize {
    background-color: #febc2e;
}

.terminal-button.maximize {
    background-color: #28c840;
}

.terminal-title {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.terminal-body {
    padding: 15px 20px;
    overflow-x: auto;
}

.terminal-line {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.terminal-prompt {
    font-weight: 600;
    margin-right: 8px;
    white-space: nowrap;
}

.terminal-pwd {
    color: inherit;
    margin: 0 3px;
}

.terminal-command {
    flex: 1;
    word-break: break-all;
}

/* Attacker Terminal - Dark Theme */
.attacker-terminal {
    border: none;
}

.attacker-terminal .terminal-header {
    background-color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.attacker-terminal .terminal-title {
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.attacker-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
}

.attacker-terminal .terminal-prompt {
    color: var(--primary-color);
    font-weight: bold;
}

.attacker-terminal .terminal-pwd {
    color: #ffffff;
}

.attacker-terminal .terminal-command {
    color: #ffffff;
}

/* Target Terminal - Dark Theme */
.target-terminal {
    border: none;
}

.target-terminal .terminal-header {
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}

.target-terminal .terminal-title {
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.target-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
}

.target-terminal .terminal-prompt {
    color: #4dabf7;
    font-weight: bold;
}

.target-terminal .terminal-pwd {
    color: #ffffff;
}

.target-terminal .terminal-command {
    color: #ffffff;
}

/* Shell Terminal - Dark theme for both light and dark modes */
.shell-terminal {
    border: none;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shell-terminal .terminal-header {
    background-color: #343a40;
    border-bottom: 1px solid #2c3136;
}

.shell-terminal .terminal-title {
    color: #e0e0e0;
    font-weight: 600;
    font-size: 0.8rem;
}

.shell-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
}

.shell-terminal .terminal-prompt {
    color: #4dabf7;
    font-weight: bold;
}

.shell-terminal .terminal-command {
    color: #ffffff;
}

/* LSD (LSDeluxe) Style Terminal Output */
/* Use these classes in your terminal content for lsd-style formatting */

/* Base lsd container */
.lsd-output {
    font-family: 'Courier New', 'Menlo', 'Monaco', monospace;
    line-height: 1.6;
    color: #ffffff;
}

/* LSD Icons using Unicode */
.lsd-icon {
    display: inline-block;
    width: 1.5em;
    text-align: center;
    margin-right: 0.5em;
}

/* Folder icon and color */
.lsd-dir::before {
    content: "📁 ";
    color: #5796f8;
    font-weight: bold;
}

.lsd-dir {
    color: #5796f8;
    font-weight: bold;
}

/* File types */
.lsd-file {
    color: #d4d4d4;
}

.lsd-exec::before {
    content: "⚡ ";
    color: #76e268;
}

.lsd-exec {
    color: #76e268;
    font-weight: bold;
}

/* Symlink */
.lsd-link::before {
    content: "🔗 ";
    color: #6cc7f6;
}

.lsd-link {
    color: #6cc7f6;
    font-style: italic;
}

/* Archive files */
.lsd-archive::before {
    content: "📦 ";
    color: #ff6b6b;
}

.lsd-archive {
    color: #ff6b6b;
}

/* Image files */
.lsd-image::before {
    content: "🖼️ ";
    color: #ffa94d;
}

.lsd-image {
    color: #ffa94d;
}

/* Video files */
.lsd-video::before {
    content: "🎬 ";
    color: #ff8787;
}

.lsd-video {
    color: #ff8787;
}

/* Audio files */
.lsd-audio::before {
    content: "🎵 ";
    color: #ff9ff3;
}

.lsd-audio {
    color: #ff9ff3;
}

/* Code/Source files */
.lsd-code::before {
    content: "📝 ";
    color: #74c0fc;
}

.lsd-code {
    color: #74c0fc;
}

/* Config files */
.lsd-config::before {
    content: "⚙️ ";
    color: #ffd43b;
}

.lsd-config {
    color: #ffd43b;
}

/* Document files */
.lsd-doc::before {
    content: "📄 ";
    color: #c9c9c9;
}

.lsd-doc {
    color: #c9c9c9;
}

/* Hidden files (starting with .) */
.lsd-hidden {
    color: #6c757d;
    opacity: 0.7;
}

/* LSD permissions display */
.lsd-perms {
    color: #8c8c8c;
    font-family: 'Courier New', monospace;
    margin-right: 1em;
}

/* LSD size display */
.lsd-size {
    color: #76e268;
    text-align: right;
    display: inline-block;
    min-width: 4em;
    margin-right: 1em;
}

/* LSD date display */
.lsd-date {
    color: #74c0fc;
    margin-right: 1em;
}

/* LSD owner/group */
.lsd-owner {
    color: #ffd43b;
    margin-right: 0.5em;
}

.lsd-group {
    color: #ffa94d;
    margin-right: 1em;
}

/* LSD grid layout for detailed view */
.lsd-grid {
    display: grid;
    grid-template-columns: auto auto auto auto auto 1fr;
    gap: 0.5em;
    align-items: center;
}

.lsd-grid-item {
    white-space: nowrap;
}

/* LSD tree view styling */
.lsd-tree {
    font-family: 'Courier New', monospace;
}

.lsd-tree-branch {
    color: #6c757d;
}

/* Output Terminal - Collapsible */
.output-terminal {
    border: none;
}

.output-terminal .terminal-header {
    background-color: #4a4a4a;
    border-bottom: 1px solid #3a3a3a;
    cursor: pointer;
    transition: background-color 0.2s;
}

.output-terminal .terminal-header:hover {
    background-color: #5a5a5a;
}

.output-terminal .terminal-title {
    color: #e0e0e0;
    font-style: italic;
}

.output-terminal .terminal-title::before {
    content: "▼ ";
    font-style: normal;
    margin-right: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.terminal-type-label {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.output-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
    border: 1px solid #3a3a3a;
    border-top: none;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 500px;
    overflow-y: auto;
}

.output-terminal .terminal-body.collapsed {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

.output-content {
    margin: 0;
    white-space: pre-wrap;
    color: #ffffff !important;
    background-color: transparent !important;
    word-wrap: break-word;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.collapse-indicator {
    position: absolute;
    right: 15px;
    display: flex;
    align-items: center;
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: #666666;
}

.output-terminal .terminal-body:not(.collapsed) ~ .terminal-header .collapse-icon,
.collapse-icon.expanded {
    transform: rotate(180deg);
}

/* Dark Theme Overrides for Target Terminal - Keep BLUE */
.dark .target-terminal {
    border-color: var(--secondary-color);
}

.dark .target-terminal .terminal-header {
    background-color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.dark .target-terminal .terminal-title {
    color: #ffffff;
}

/* ================================================== */
/* Tags Page Styling */
/* ================================================== */

.terms-tags {
    list-style: none;
    padding: 0;
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.terms-tags li {
    display: inline-block;
}

.terms-tags a {
    display: inline-block;
    padding: 12px 20px;
    background: rgba(4, 69, 113, 0.1);
    border: 2px solid var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.terms-tags a:hover {
    background: var(--primary-color);    /* Solid color instead of gradient */
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(var(--primary-color), 0.3);
    border-color: var(--primary-color);
}

.terms-tags a sup {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 5px;
}

.terms-tags a:hover sup {
    color: white;
}

/* Dark theme adjustments for tags */
.dark .terms-tags a {
    background: rgba(216, 90, 31, 0.15);    /* Solid color with opacity */
    border-color: var(--secondary-color);
}

.dark .terms-tags a:hover {
    background: var(--primary-color);       /* Solid color instead of gradient */
    border-color: var(--primary-color);
    color: white;
}

/* Target terminal body remains the same in dark mode since it's already black */

.dark .output-terminal {
    border: none;
}

.dark .output-terminal .terminal-header {
    background-color: #4a4a4a;
    border-bottom-color: #3a3a3a;
}

.dark .output-terminal .terminal-header:hover {
    background-color: #5a5a5a;
}

.dark .output-terminal .terminal-title {
    color: #e0e0e0;
}

.dark .output-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
    border-color: #3a3a3a;
}

.dark .collapse-icon {
    color: #aaaaaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-block {
        font-size: 0.8rem;
    }

    .terminal-body {
        padding: 12px 15px;
    }

    .terminal-line {
        flex-direction: column;
    }

    .terminal-prompt {
        margin-bottom: 5px;
    }
}

/* ================================================== */
/* Timeline Shortcode Styles */
/* ================================================== */

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

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: var(--secondary-color);
}

.timeline-item {
    position: relative;
    margin: 30px 0;
    display: flex;
    align-items: center;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid var(--background-color);
    z-index: 2;
}

.timeline-content {
    width: 45%;
    padding: 20px;
    background: rgba(4, 69, 113, 0.05);
    border-left: 4px solid var(--secondary-color);
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    margin-right: 5%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
    margin-left: 5%;
}

.timeline-time {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.timeline-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.timeline-description {
    color: var(--text-color);
    line-height: 1.6;
}

/* Dark theme timeline adjustments */
.dark .timeline-content {
    background: rgba(216, 90, 31, 0.1);
    border-left-color: var(--primary-color);
}

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

    .timeline-marker {
        left: 20px;
    }

    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 50px !important;
        margin-right: 0 !important;
    }
}

/* ================================================== */
/* Admonition Box Styles */
/* ================================================== */

.admonition {
    margin: 25px 0;
    padding: 0;
    border-left: 4px solid;
    background-color: rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.admonition-title {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-weight: bold;
    gap: 10px;
}

.admonition-icon {
    font-size: 1.2rem;
}

.admonition-content {
    padding: 12px 16px;
}

.admonition-content p:last-child {
    margin-bottom: 0;
}

/* Note type */
.admonition-note {
    border-left-color: #4285f4;
}

.admonition-note .admonition-title {
    background-color: rgba(66, 133, 244, 0.1);
    color: #4285f4;
}

/* Warning type */
.admonition-warning {
    border-left-color: #ff9800;
}

.admonition-warning .admonition-title {
    background-color: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

/* Tip type */
.admonition-tip {
    border-left-color: #00c853;
}

.admonition-tip .admonition-title {
    background-color: rgba(0, 200, 83, 0.1);
    color: #00c853;
}

/* Info type */
.admonition-info {
    border-left-color: var(--secondary-color);
}

.admonition-info .admonition-title {
    background-color: rgba(4, 69, 113, 0.1);
    color: var(--secondary-color);
}

/* Danger type */
.admonition-danger {
    border-left-color: #f44336;
}

.admonition-danger .admonition-title {
    background-color: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

/* Success type */
.admonition-success {
    border-left-color: #4caf50;
}

.admonition-success .admonition-title {
    background-color: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

/* Dark theme admonition adjustments */
.dark .admonition {
    background-color: rgba(255, 255, 255, 0.05);
}

/* ================================================== */
/* Gallery Styles */
/* ================================================== */

.gallery {
    margin: 30px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gallery[data-columns="2"] .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
}

.gallery[data-columns="4"] .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.85rem;
    text-align: center;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-slide {
    display: none;
    text-align: center;
}

.lightbox-slide.active {
    display: block;
}

.lightbox-slide img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-caption {
    color: white;
    padding: 15px;
    font-size: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--primary-color);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    z-index: 10000;
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: var(--primary-color);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Responsive gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-item img {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ================================================== */
/* Audio Block Styles */
/* ================================================== */

.audio-block {
    margin: 30px 0;
    padding: 20px;
    background: rgba(4, 69, 113, 0.05);
    border-left: 4px solid var(--secondary-color);
}

.audio-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.audio-player {
    width: 100%;
    margin: 15px 0;
    outline: none;
}

.audio-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    font-style: italic;
}

/* Dark theme audio adjustments */
.dark .audio-block {
    background: rgba(216, 90, 31, 0.1);
    border-left-color: var(--primary-color);
}

/* ================================================== */
/* Video Block Styles */
/* ================================================== */

.video-block {
    margin: 30px 0;
}

.video-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border: 3px solid var(--secondary-color);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-caption {
    margin-top: 10px;
    padding: 10px;
    background: rgba(4, 69, 113, 0.05);
    border-left: 4px solid var(--secondary-color);
    font-size: 0.9rem;
    color: var(--text-color);
    font-style: italic;
}

/* Dark theme video adjustments */
.dark .video-wrapper {
    border-color: var(--primary-color);
}

.dark .video-caption {
    background: rgba(216, 90, 31, 0.1);
    border-left-color: var(--primary-color);
}

/* ================================================== */
/* Tabs Shortcode Styles */
/* ================================================== */

.tabs-container {
    margin: 30px 0;
}

.tabs-header {
    display: flex;
    border-bottom: 3px solid var(--secondary-color);
    margin-bottom: 20px;
}

.tab-item {
    flex: 1;
}

.tab-button {
    width: 100%;
    padding: 15px 20px;
    background: rgba(4, 69, 113, 0.05);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.tab-item.active .tab-button {
    background: var(--secondary-color);
    color: white;
    border-bottom-color: var(--primary-color);
}

.tab-button:hover {
    background: rgba(4, 69, 113, 0.15);
}

.tab-content {
    display: none;
    padding: 20px;
    border-left: 4px solid var(--secondary-color);
    background: rgba(4, 69, 113, 0.02);
}

.tab-item.active .tab-content {
    display: block;
}

/* Dark theme tabs */
.dark .tab-button {
    background: rgba(216, 90, 31, 0.05);
}

.dark .tab-item.active .tab-button {
    background: var(--primary-color);
}

.dark .tab-content {
    border-left-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.05);
}

/* ================================================== */
/* Collapsible/Accordion Styles */
/* ================================================== */

.collapse-container {
    margin: 25px 0;
    border: 2px solid var(--secondary-color);
}

.collapse-header {
    width: 100%;
    padding: 15px 20px;
    background: rgba(4, 69, 113, 0.05);
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.collapse-header:hover {
    background: rgba(4, 69, 113, 0.15);
}

.collapse-header.active {
    background: var(--secondary-color);
    color: white;
}

.collapse-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapse-header.active .collapse-icon {
    transform: rotate(90deg);
}

.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.collapse-content.active {
    max-height: 2000px;
    padding: 20px;
}

/* Dark theme collapse */
.dark .collapse-container {
    border-color: var(--primary-color);
}

.dark .collapse-header {
    background: rgba(216, 90, 31, 0.05);
}

.dark .collapse-header.active {
    background: var(--primary-color);
}

/* ================================================== */
/* Code Diff Styles */
/* ================================================== */

.code-diff {
    margin: 25px 0;
    border-left: 4px solid var(--secondary-color);
}

.diff-title {
    padding: 10px 15px;
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.code-diff pre {
    margin: 0;
    padding: 15px;
    background: #1e1e1e;
    overflow-x: auto;
}

.code-diff code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Diff line styling */
.code-diff .line-add {
    background: rgba(0, 255, 0, 0.1);
    display: block;
}

.code-diff .line-remove {
    background: rgba(255, 0, 0, 0.1);
    display: block;
}

/* ================================================== */
/* File Tree Styles */
/* ================================================== */

.file-tree {
    margin: 25px 0;
    border: 2px solid var(--secondary-color);
    background: rgba(4, 69, 113, 0.02);
}

.file-tree-title {
    padding: 10px 15px;
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.file-tree-content {
    margin: 0;
    padding: 20px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-color);
    overflow-x: auto;
}

/* Dark theme file tree */
.dark .file-tree {
    border-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.05);
}

.dark .file-tree-title {
    background: var(--primary-color);
}

/* ================================================== */
/* Copyable Block Styles */
/* ================================================== */

.copyable-block {
    margin: 25px 0;
    position: relative;
    border: 2px solid var(--secondary-color);
}

.copyable-title {
    padding: 10px 15px;
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.copyable-header {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.copy-button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.copy-button.copied {
    background: #4caf50;
}

.copy-button.copied .copy-text::after {
    content: 'ed!';
}

.copyable-block pre {
    margin: 0;
    padding: 40px 15px 15px 15px;
    background: #1e1e1e;
    overflow-x: auto;
}

/* ================================================== */
/* Badge/Label Styles */
/* ================================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-default {
    background: #6c757d;
    color: white;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-high {
    background: #dc3545;
    color: white;
}

.badge-medium {
    background: #ff9800;
    color: white;
}

.badge-low {
    background: #ffc107;
    color: #212529;
}

.badge-critical {
    background: #9c27b0;
    color: white;
}

/* ================================================== */
/* Keyboard Key Styles */
/* ================================================== */

.kbd-container {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.kbd-key {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: bold;
    line-height: 1;
    color: #333;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #ced4da;
    border-radius: 0;
    box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}

.kbd-plus {
    margin: 0 2px;
    color: var(--text-color);
    font-weight: bold;
}

/* Dark theme kbd */
.dark .kbd-key {
    color: #f0f0f0;
    background: linear-gradient(180deg, #495057 0%, #343a40 100%);
    border-color: #212529;
}

/* ================================================== */
/* CTF Flag Box Styles */
/* ================================================== */

.flag-box {
    margin: 30px 0;
    border: 3px solid var(--primary-color);
    background: rgba(216, 90, 31, 0.1);    /* Solid color with opacity instead of gradient */
}

.flag-header {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-icon {
    font-size: 1.5rem;
}

.flag-content {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.flag-text {
    flex: 1;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.flag-copy {
    padding: 10px 15px;
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.flag-copy:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* ================================================== */
/* Enhanced Quote Styles */
/* ================================================== */

.enhanced-quote {
    margin: 30px 0;
    padding: 0;
    border-left: 6px solid var(--secondary-color);
    background: rgba(4, 69, 113, 0.05);
    font-style: italic;
}

.quote-content {
    padding: 20px 25px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.quote-content p:last-child {
    margin-bottom: 0;
}

.quote-footer {
    padding: 15px 25px;
    background: rgba(4, 69, 113, 0.1);
    font-size: 0.9rem;
    font-style: normal;
}

.quote-author {
    font-weight: bold;
    color: var(--secondary-color);
}

.quote-source a {
    color: var(--primary-color);
    text-decoration: none;
}

.quote-source a:hover {
    text-decoration: underline;
}

/* Dark theme quote */
.dark .enhanced-quote {
    border-left-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.05);
}

.dark .quote-footer {
    background: rgba(216, 90, 31, 0.1);
}

.dark .quote-author {
    color: var(--primary-color);
}

/* ================================================== */
/* Progress Bar Styles */
/* ================================================== */

.progress-container {
    margin: 25px 0;
}

.progress-label {
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.1);
    border: 2px solid var(--secondary-color);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    position: relative;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.progress-primary {
    background: var(--primary-color);
}

.progress-secondary {
    background: var(--secondary-color);
}

.progress-success {
    background: #28a745;
}

.progress-warning {
    background: #ffc107;
}

.progress-danger {
    background: #dc3545;
}

.progress-info {
    background: #17a2b8;
}

/* Dark theme progress */
.dark .progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* ================================================== */
/* Mermaid Diagram Styles */
/* ================================================== */

.mermaid-container {
    margin: 30px 0;
    padding: 20px;
    background: rgba(4, 69, 113, 0.02);
    border: 2px solid var(--secondary-color);
    overflow-x: auto;
}

.mermaid {
    display: flex;
    justify-content: center;
}

/* Dark theme mermaid */
.dark .mermaid-container {
    background: rgba(216, 90, 31, 0.05);
    border-color: var(--primary-color);
}

/* ================================================== */
/* ASCII Art Styles */
/* ================================================== */

.ascii-art {
    margin: 25px 0;
    border: 2px solid var(--secondary-color);
    background: rgba(4, 69, 113, 0.02);
}

.ascii-title {
    padding: 10px 15px;
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.ascii-content {
    margin: 0;
    padding: 20px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--text-color);
    overflow-x: auto;
    white-space: pre;
}

/* Dark theme ASCII */
.dark .ascii-art {
    border-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.05);
}

.dark .ascii-title {
    background: var(--primary-color);
}

/* ================================================== */
/* Split View Styles */
/* ================================================== */

.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.split-panel {
    border: 2px solid var(--secondary-color);
    background: rgba(4, 69, 113, 0.02);
}

.split-panel-title {
    padding: 12px 15px;
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}

.split-panel-content {
    padding: 20px;
}

/* Dark theme split view */
.dark .split-panel {
    border-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.05);
}

.dark .split-panel-title {
    background: var(--primary-color);
}

/* Responsive split view */
@media (max-width: 768px) {
    .split-view {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Gallery Filtering and Sharing Styles
   ========================================== */

/* Gallery Container */
.gallery-container {
    margin: 2rem 0;
}

/* Gallery Filter Buttons */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--background-color);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.dark .filter-btn {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

.dark .filter-btn:hover,
.dark .filter-btn.active {
    background: var(--primary-color);
}

/* Gallery Items - Update for better transitions */
.gallery-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

/* Lightbox Share Button */
.lightbox-share {
    position: absolute;
    top: 20px;
    right: 70px;
    z-index: 1002;
}

.share-btn {
    background: rgba(216, 90, 31, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* Share Menu */
.share-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: var(--background-color);
    border: 2px solid var(--primary-color);
    border-radius: 0;
    padding: 10px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.share-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 14px;
}

.share-link:hover {
    background: var(--primary-color);
    color: #fff;
}

.share-link i {
    font-size: 16px;
}

.dark .share-menu {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

/* ==========================================
   Embed Block Styles (SoundCloud, Spotify)
   ========================================== */

.soundcloud-block,
.spotify-block {
    margin: 2rem 0;
    padding: 20px;
    background: var(--background-color);
    border: 2px solid var(--primary-color);
    border-radius: 0;
}

.embed-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.soundcloud-wrapper,
.spotify-wrapper {
    margin: 15px 0;
    border-radius: 0;
    overflow: hidden;
}

.embed-caption {
    margin-top: 15px;
    padding: 10px;
    background: rgba(216, 90, 31, 0.1);
    border-left: 4px solid var(--primary-color);
    border-radius: 0;
    font-size: 14px;
    color: var(--text-color);
    font-style: italic;
}

.dark .soundcloud-block,
.dark .spotify-block {
    background: #2a2a2a;
    border-color: var(--primary-color);
}

.dark .embed-caption {
    background: rgba(216, 90, 31, 0.2);
}

/* Responsive Embeds */
@media (max-width: 768px) {
    .soundcloud-block,
    .spotify-block {
        padding: 15px;
    }

    .embed-title {
        font-size: 16px;
    }

    .lightbox-share {
        right: 60px;
        top: 15px;
    }

    .share-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}


/* ==========================================
   Reading Progress Bar
   ========================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(4, 69, 113, 0.2);
    z-index: 9999;
}

.reading-progress-bar {
    height: 100%;
    background: var(--primary-color);    /* Solid color instead of gradient */
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

.dark .reading-progress {
    background: rgba(216, 90, 31, 0.2);    /* Updated to new primary color */
}

/* ==========================================
   Series Navigation
   ========================================== */

.series-box {
    margin: 2rem 0;
    padding: 25px;
    background: rgba(216, 90, 31, 0.1);    /* Solid color with opacity instead of gradient */
    border: 2px solid var(--primary-color);
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.series-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.series-icon {
    font-size: 24px;
}

.series-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.series-description {
    margin: 15px 0;
    font-size: 15px;
    color: var(--text-color);
    line-height: 1.6;
}

.series-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.series-item {
    margin: 10px 0;
    padding: 12px 15px;
    background: var(--background-color);
    border-left: 4px solid var(--secondary-color);
    border-radius: 0;
    transition: all 0.3s ease;
}

.series-item:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.series-item.current {
    border-left-color: var(--primary-color);
    background: rgba(216, 90, 31, 0.1);
    font-weight: 600;
}

.series-item a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.series-item.current a {
    color: var(--primary-color);
}

.series-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.series-item.current .series-number {
    background: var(--primary-color);
}

.series-post-title {
    flex: 1;
}

.series-current-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.series-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--primary-color);
}

.series-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--secondary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 48%;
}

.series-nav-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(216, 90, 31, 0.3);
}

.series-nav-btn.next {
    justify-content: flex-end;
    text-align: right;
}

.series-nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #ccc;
}

.dark .series-box {
    background: rgba(216, 90, 31, 0.15);    /* Solid color with opacity instead of gradient */
}

.dark .series-item {
    background: #2a2a2a;
}

.dark .series-item.current {
    background: rgba(216, 90, 31, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .series-box {
        padding: 20px 15px;
    }

    .series-title {
        font-size: 18px;
    }

    .series-navigation {
        flex-direction: column;
    }

    .series-nav-btn {
        max-width: 100%;
    }

    .series-nav-btn.next {
        justify-content: flex-start;
        text-align: left;
    }
}

/* ========================================
   MacOS-Style Code Blocks
   ======================================== */

.macos-code-wrapper {
    margin: 1.5em 0;
    background-color: #0d0d0d;
    border: 1px solid #3a3a3a;
    overflow: hidden;
}

.macos-code-header {
    display: flex;
    align-items: center;
    background-color: #2d2d2d;
    padding: 8px 12px;
    border-bottom: 1px solid #3a3a3a;
}

.macos-code-buttons {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.macos-code-title {
    font-size: 12px;
    color: #888;
    font-family: var(--font-monospace);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Code block styling inside wrapper */
.macos-code-wrapper .chroma {
    margin: 0;
    background-color: #0d0d0d !important;
    padding: 1em;
}

.macos-code-wrapper pre {
    margin: 0;
    background-color: transparent !important;
}

/* Light theme adjustments */
body:not(.dark) .macos-code-wrapper {
    background-color: #f8f9fa;
    border-color: #d0d0d0;
}

body:not(.dark) .macos-code-header {
    background-color: #e9ecef;
    border-bottom-color: #d0d0d0;
}

body:not(.dark) .macos-code-title {
    color: #666;
}

body:not(.dark) .macos-code-wrapper .chroma {
    background-color: #f8f9fa !important;
}

/* ========================================
   Scroll to Top Button
   ======================================== */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

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

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .scroll-to-top svg {
        width: 18px;
        height: 18px;
    }
}

/* ========================================
   Terminal Copy Button (Hidden)
   ======================================== */

.terminal-copy-btn {
    display: none !important;
}

/* Terminal Output Styles */
.terminal-output {
    margin-top: 0.5em;
    opacity: 0.9;
}

.terminal-output pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-monospace);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ========================================
   PowerShell Terminal
   ======================================== */

.powershell-terminal {
    border: 1px solid #1e3a5f;
}

.powershell-terminal .terminal-header {
    background-color: #012456;
    border-bottom: 2px solid #1e3a5f;
}

.powershell-terminal .terminal-title {
    color: #ffffff;
    font-weight: 600;
}

.powershell-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
}

.powershell-terminal .terminal-prompt {
    color: #5c9fd8;
    font-weight: bold;
}

.powershell-terminal .terminal-command {
    color: #ffffff;
}

/* ========================================
   CMD Terminal
   ======================================== */

.cmd-terminal {
    border: 1px solid #3a3a3a;
}

.cmd-terminal .terminal-header {
    background-color: #5a5a5a;
    border-bottom: 2px solid #4a4a4a;
}

.cmd-terminal .terminal-title {
    color: #ffffff;
    font-weight: 600;
}

.cmd-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #c0c0c0;
}

.cmd-terminal .terminal-prompt {
    color: #c0c0c0;
    font-weight: bold;
}

.cmd-terminal .terminal-command {
    color: #ffffff;
}

/* ========================================
   SQL Terminal
   ======================================== */

.sql-terminal {
    border: 1px solid #005f73;
}

.sql-terminal .terminal-header {
    background-color: #00758f;
    border-bottom: 2px solid #005f73;
}

.sql-terminal .terminal-title {
    color: #ffffff;
    font-weight: 600;
}

.sql-terminal .terminal-body {
    background-color: #0d0d0d;
    color: #ffffff;
}

.sql-terminal .terminal-prompt {
    color: #00d9ff;
    font-weight: bold;
}

.sql-terminal .terminal-command {
    color: #ffffff;
}

.sql-terminal .terminal-content {
    margin: 0;
    color: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================================
   Terminal Syntax Highlighting Support
   ======================================== */

/* Make Chroma code blocks inline in terminal commands */
.terminal-command .highlight,
.terminal-command .chroma {
    display: inline;
    background-color: transparent !important;
    padding: 0;
    margin: 0;
}

.terminal-command .highlight pre,
.terminal-command .chroma pre {
    display: inline;
    background-color: transparent !important;
    padding: 0;
    margin: 0;
    border: none;
}

.terminal-command .highlight code,
.terminal-command .chroma code {
    display: inline;
    background-color: transparent !important;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

/* Remove color inheritance for syntax highlighting */
.terminal-command .chroma * {
    color: inherit;
}

/* Allow Chroma tokens to use their own colors */
.terminal-command .chroma .k,  /* Keywords */
.terminal-command .chroma .kc, /* Keyword.Constant */
.terminal-command .chroma .kd, /* Keyword.Declaration */
.terminal-command .chroma .kn, /* Keyword.Namespace */
.terminal-command .chroma .kp, /* Keyword.Pseudo */
.terminal-command .chroma .kr, /* Keyword.Reserved */
.terminal-command .chroma .kt, /* Keyword.Type */
.terminal-command .chroma .s,  /* String */
.terminal-command .chroma .s1, /* String.Single */
.terminal-command .chroma .s2, /* String.Double */
.terminal-command .chroma .se, /* String.Escape */
.terminal-command .chroma .si, /* String.Interpol */
.terminal-command .chroma .n,  /* Name */
.terminal-command .chroma .nf, /* Name.Function */
.terminal-command .chroma .nb, /* Name.Builtin */
.terminal-command .chroma .nc, /* Name.Class */
.terminal-command .chroma .no, /* Name.Constant */
.terminal-command .chroma .nd, /* Name.Decorator */
.terminal-command .chroma .ni, /* Name.Entity */
.terminal-command .chroma .ne, /* Name.Exception */
.terminal-command .chroma .nl, /* Name.Label */
.terminal-command .chroma .nn, /* Name.Namespace */
.terminal-command .chroma .nx, /* Name.Other */
.terminal-command .chroma .py, /* Name.Property */
.terminal-command .chroma .nt, /* Name.Tag */
.terminal-command .chroma .nv, /* Name.Variable */
.terminal-command .chroma .m,  /* Number */
.terminal-command .chroma .mf, /* Number.Float */
.terminal-command .chroma .mh, /* Number.Hex */
.terminal-command .chroma .mi, /* Number.Integer */
.terminal-command .chroma .mo, /* Number.Oct */
.terminal-command .chroma .c,  /* Comment */
.terminal-command .chroma .c1, /* Comment.Single */
.terminal-command .chroma .cm, /* Comment.Multiline */
.terminal-command .chroma .o,  /* Operator */
.terminal-command .chroma .ow  /* Operator.Word */
{
    color: revert !important;
}



/* ========================================
   Theme-Specific Syntax Highlighting
   Solarized Light / Solarized Dark
   ======================================== */

/* Terminal-like black background with white text for both themes */
.bg { color:#ffffff;background-color:#0d0d0d; }
.chroma { color:#ffffff;background-color:#0d0d0d !important; }

/* Dark theme - same terminal-like styling */
.dark .bg { color:#ffffff;background-color:#0d0d0d; }
.dark .chroma { color:#ffffff;background-color:#0d0d0d !important; }

/* Terminal-like: All syntax elements in white (no syntax highlighting) */
.chroma .k,
.chroma .kc,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt,
.chroma .na,
.chroma .nc,
.chroma .no,
.chroma .nb,
.chroma .nf,
.chroma .nv,
.chroma .s,
.chroma .s2,
.chroma .s1,
.chroma .m,
.chroma .mi,
.chroma .c,
.chroma .c1,
.chroma .o,
.chroma .p,
.chroma .n,
.chroma .nx,
.chroma .nt,
.chroma .err,
.chroma .cp,
.chroma .cpf,
.chroma .cs,
.chroma .cm {
    color: #ffffff !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* Dark theme - same white text */
.dark .chroma .k,
.dark .chroma .kc,
.dark .chroma .kd,
.dark .chroma .kn,
.dark .chroma .kp,
.dark .chroma .kr,
.dark .chroma .kt,
.dark .chroma .nc,
.dark .chroma .no,
.dark .chroma .nb,
.dark .chroma .nf,
.dark .chroma .nv,
.dark .chroma .s,
.dark .chroma .s2,
.dark .chroma .s1,
.dark .chroma .m,
.dark .chroma .mi,
.dark .chroma .c,
.dark .chroma .c1,
.dark .chroma .o,
.dark .chroma .n,
.dark .chroma .nx,
.dark .chroma .nt,
.dark .chroma .err,
.dark .chroma .cp,
.dark .chroma .cpf,
.dark .chroma .cs,
.dark .chroma .cm {
    color: #ffffff !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* Catch-all: Override any other chroma elements */
.chroma span,
.chroma code,
.dark .chroma span,
.dark .chroma code {
    color: #ffffff !important;
}

