/* ========================================
   GDX Cloud Documentation Theme
   Modern responsive design with dark/light mode
   ======================================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

:root {
    /* Primary Colors - GDX Cloud Brand */
    --primary-color: #a855f7;  /* Purple accent */
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    
    /* Secondary Colors */
    --secondary-color: #ec4899;  /* Pink accent */
    --accent-color: #3b82f6;     /* Blue accent */
    
    /* Dark Theme Colors */
    --bg-primary: #111111;       /* Dark gray background */
    --bg-secondary: #1a1a1a;     /* Slightly lighter */
    --bg-tertiary: #222222;      /* Card backgrounds */
    --bg-card: #2a2a2a;          /* Feature card background */
    
    /* Neutral Colors */
    --dark: #000000;
    --gray-dark: #9ca3af;
    --gray: #d1d5db;
    --gray-light: #e5e7eb;
    --light: #f9fafb;
    
    /* Text Colors */
    --text-primary: #f4f4f5;      /* Slightly off-white for headings */
    --text-secondary: #a1a1aa;    /* Muted gray for descriptions */
    --text-muted: #71717a;        /* Even more muted */
    --text-body: #d4d4d8;         /* Body text color - light gray */
    
    /* Border Colors */
    --border-color: #27272a;
    --border-light: #18181b;
    
    /* Spacing */
    --section-padding: 80px;
}

/* Light Theme Variables */
html.light-theme {
    /* Primary Colors - Keep same */
    --primary-color: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    
    /* Secondary Colors */
    --secondary-color: #ec4899;
    --accent-color: #3b82f6;
    
    /* Light Theme Colors */
    --bg-primary: #ffffff;       /* White background */
    --bg-secondary: #f9fafb;     /* Light gray */
    --bg-tertiary: #f3f4f6;      /* Card backgrounds */
    --bg-card: #ffffff;          /* Feature card background */
    
    /* Neutral Colors */
    --dark: #1f2937;
    --gray-dark: #4b5563;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --light: #f9fafb;
    
    /* Text Colors */
    --text-primary: #111827;     /* Dark text for headings */
    --text-secondary: #4b5563;   /* Gray for descriptions */
    --text-muted: #6b7280;       /* Muted gray */
    --text-body: #374151;        /* Body text color - dark gray */
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
}

/* ========================================
   Global Styles
   ======================================== */

/* Smooth theme transitions */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: var(--text-body);
    line-height: 1.7;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 400;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

/* Gradient text effect for special elements only */
.gradient-text {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern link styling - blue with underline indicator */
a {
    color: #3b82f6;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

a:hover {
    color: #2563eb;
}

/* Link underline effect */
.docs-body a,
.docs-content a,
main article a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.docs-body a:hover,
.docs-content a:hover,
main article a:hover {
    color: #2563eb;
    border-bottom-color: #3b82f6;
}

/* External link indicator - only for markdown content links */
.content a[href^="http"]:not([href*="localhost"])::after,
article a[href^="http"]:not([href*="localhost"])::after,
.post-content a[href^="http"]:not([href*="localhost"])::after,
.docs-content a[href^="http"]:not([href*="localhost"])::after {
    content: " ↗";
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 600;
    margin-left: 2px;
}

/* Smooth theme color transitions for elements without specific transitions */
.site-header,
.site-footer,
.post-card,
.category-post-card,
.hero-section,
.breadcrumb,
p, span, div:not([class*="pagefind"]) {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Hide breadcrumb separator after home icon */
.breadcrumb-item + .breadcrumb-item::before {
    content: "/" !important;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
    color: var(--text-muted);
}

/* ========================================
   Header & Navigation
   ======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.navbar {
    padding: 0.5rem 0;
    background-color: transparent !important;
}

.navbar-brand {
    font-size: 1.125rem;
    color: var(--light) !important;
    font-weight: 600;
}

.navbar-brand .site-logo {
    height: 28px;
    width: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide light logo by default (show dark logo) */
.navbar-brand .logo-light {
    display: none;
    opacity: 0;
}

.navbar-brand .logo-dark {
    display: block;
    opacity: 1;
}

.navbar-brand:hover .site-logo {
    transform: scale(1.05);
}

.navbar-brand i {
    font-size: 1.25rem;
    color: var(--light);
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

.navbar-toggler {
    border-color: var(--border-color);
}

.navbar-toggler-icon {
    filter: invert(1);
}

.nav-link {
    color: var(--text-secondary) !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--light) !important;
}

/* Navigation Separator */
.nav-separator {
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
    padding: 0 0.5rem;
    user-select: none;
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.dropdown-menu.docs-menu {
    background-color: transparent;
    border: none;
}

.dropdown-item {
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--light);
}

.dropdown-toggle::after {
    margin-left: 0.3em;
}

/* Documentation Dropdown Menu - Mobile/Tablet Only */
.docs-dropdown {
    display: none;
}

@media (max-width: 991.98px) {
    .docs-dropdown {
        display: block;
    }
}

.docs-menu {
    max-height: 70vh;
    overflow-y: auto;
    min-width: 280px;
    max-width: 340px;
    padding: 0 0 0 0.5rem;
    margin-top: -0.5rem;
}

.docs-menu-section {
    padding: 0;
    position: relative;
}

.docs-menu-section.dropend .dropdown-toggle::after {
    content: "\f285";
    font-family: "bootstrap-icons";
    border: none;
    vertical-align: middle;
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.docs-menu-title {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    text-decoration: none;
    width: 100%;
    justify-content: flex-start;
    background-color: transparent;
    border: none;
    cursor: pointer;
    line-height: 1.2;
}

.docs-menu-title:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.docs-menu-title:focus {
    color: var(--text-primary);
    outline: none;
}

.docs-menu-title-static {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    cursor: default;
}

.docs-menu-title-static:hover {
    background-color: transparent;
}

/* Nested Submenu Styling */
.docs-submenu {
    min-width: 240px;
    max-width: 300px;
    max-height: 60vh;
    overflow-y: auto;
    background-color: var(--bg-secondary);
}

.docs-menu-link {
    font-size: 0.875rem;
    padding: 0.4rem 1rem 0.4rem 3rem;
    margin: 0.15rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    line-height: 1.2;
    border-left: 3px solid transparent;
}

.docs-menu-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.docs-menu-link.active {
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

.docs-menu-link.active i {
    color: var(--primary-color);
    opacity: 1;
}

.docs-menu-link:hover i {
    color: var(--text-primary);
}

.docs-menu-link i {
    font-size: 0.7rem;
    opacity: 0.6;
    color: var(--text-muted);
    position: absolute;
    left: 2rem;
}

.docs-menu .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

/* Mobile/Tablet - Stack submenus instead of dropend */
@media (max-width: 991.98px) {
    .docs-menu-section.dropend .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        box-shadow: none;
        background-color: transparent;
        padding: 0;
        margin: 0;
        display: none;
    }
    
    .docs-menu-section.dropend .dropdown-menu.show {
        display: block;
    }
    
    .docs-menu-section.dropend .dropdown-toggle::after {
        content: "\f285";
        font-family: "bootstrap-icons";
        border: none;
        vertical-align: middle;
        margin-left: auto;
        font-size: 0.75rem;
        transition: transform 0.2s ease;
        opacity: 0.6;
    }
    
    .docs-menu-section.dropend .dropdown-toggle[aria-expanded="true"]::after {
        transform: rotate(90deg);
    }
    
    .docs-menu-link {
        padding-left: 3rem;
        font-size: 0.875rem;
        background-color: transparent;
    }
    
    .docs-menu-link:hover {
        background-color: var(--bg-tertiary);
    }
    
    .docs-menu-link i {
        left: 2rem;
    }
}

/* Search Box - Improved */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-wrapper:focus-within {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 157, 255, 0.1);
}

.search-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    flex: 1;
    padding: 0;
    min-width: 100px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    background-color: var(--bg-primary);
    color: var(--text-muted);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
    border: 1px solid var(--border-light);
    margin-left: 0.5rem;
    flex-shrink: 0;
    line-height: 1;
}

/* GitHub Icon */
.nav-item .bi-github {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-item .bi-github:hover {
    color: var(--light);
}

/* ========================================
   Hero Section
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 50%, #0f1419 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(59, 157, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section h1 {
    color: white;
    position: relative;
    z-index: 1;
}

.hero-section .lead {
    color: var(--gray-light);
    position: relative;
    z-index: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 157, 255, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: none !important;
}

/* ========================================
   Cards
   ======================================== */

.card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.card.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(59, 157, 255, 0.15) !important;
    border-color: var(--primary-color);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.bg-gradient-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-body {
    background-color: var(--bg-card);
}

.card-title a {
    font-weight: 600;
    transition: color 0.3s ease;
    color: var(--light);
}

.card-title a:hover {
    color: var(--primary-color) !important;
}

.card-text {
    color: var(--text-secondary) !important;
}

.badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
}

.bg-primary-subtle {
    background-color: rgba(59, 157, 255, 0.15) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--light) !important;
}

/* ========================================
   Features Section
   ======================================== */

.features-section {
    background-color: var(--bg-secondary);
}

.features-section h2,
.features-section h4 {
    color: var(--light);
}

.features-section p {
    color: var(--text-secondary);
}

.feature-icon i {
    transition: all 0.3s ease;
}

.feature-icon:hover i {
    transform: scale(1.1);
}

/* ========================================
   Blog Post Single
   ======================================== */

.post-header {
    background-color: var(--bg-secondary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

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

.post-content .content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

/* Documentation page images - larger display */
.docs-page img,
.docs-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem auto;
    display: block;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Documentation page - scroll to section highlight */
.docs-body h1,
.docs-body h2,
.docs-body h3,
.docs-body h4,
.docs-body h5,
.docs-body h6 {
    scroll-margin-top: 120px;
    scroll-padding-top: 120px;
}

.docs-body h1:target,
.docs-body h2:target,
.docs-body h3:target,
.docs-body h4:target,
.docs-body h5:target,
.docs-body h6:target {
    animation: sectionHighlight 2.5s ease-in-out;
    display: inline-block;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    margin-left: -0.75rem;
    border-radius: 8px;
}

@keyframes sectionHighlight {
    0%, 15% {
        background-color: rgba(168, 85, 247, 0.3);
        box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}

.post-content .content h2,
.post-content .content h3,
.post-content .content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--light);
}

.post-content .content p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-content .content blockquote {
    border-left: 4px solid var(--border-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    background-color: transparent;
    padding: 0.5rem 0 0.5rem 1.5rem;
    border-radius: 0;
}

.post-content .content blockquote p {
    margin: 0.5rem 0;
}

.post-content .content blockquote cite {
    font-style: normal;
    color: var(--text-muted);
}

.post-content .content code {
    background-color: var(--bg-tertiary);
    color: #60a5fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content .content pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(168, 85, 247, 0.1);
    position: relative;
    line-height: 1.6;
}

/* Scrollbar styling for code blocks */
.post-content .content pre::-webkit-scrollbar {
    height: 8px;
}

.post-content .content pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.post-content .content pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.post-content .content pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

.post-content .content pre code {
    background-color: transparent;
    padding: 0;
    color: var(--light);
}

/* Hide line numbers in code blocks */
.post-content .content pre code .line-number,
.post-content .content pre .line-number,
.post-content .content pre code .ln,
.post-content .content pre .ln {
    display: none !important;
}

.post-content .content pre code > span[data-line],
.post-content .content pre code > div[data-line] {
    display: block;
}

.post-content .content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-content .content a:hover {
    color: var(--primary-light);
}

.post-tags,
.post-share,
.post-navigation {
    border-top: 1px solid var(--border-color) !important;
}

.post-navigation {
    background-color: var(--bg-secondary) !important;
}

.post-navigation a {
    color: var(--primary-color);
}

.post-navigation a:hover {
    color: var(--primary-light);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background-color: var(--bg-primary) !important;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 0 !important;
}

.site-footer .container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.813rem;
}

/* Footer alignment variants */
.footer-content.text-left {
    justify-content: flex-start;
}

.footer-content.text-center {
    justify-content: center;
}

.footer-content.text-right {
    justify-content: flex-end;
}

/* Theme Switcher (Footer - Legacy) */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Theme Switcher Dropdown */
/* Theme Dropdown Button (Desktop) */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.theme-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.theme-toggle-btn::after {
    display: none !important;
}

.theme-toggle-btn .theme-icon {
    font-size: 1.125rem;
}

/* Theme Toggle Icon (Mobile/Tablet) */
.theme-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 38px;
    height: 38px;
    position: relative;
}

.theme-toggle-icon:hover {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--primary-color);
}

.theme-toggle-icon:focus {
    outline: none;
}

.theme-toggle-icon i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

/* Show moon icon in dark theme (default) */
.theme-icon-dark {
    display: block;
}

.theme-icon-light {
    display: none;
}

/* Show sun icon in light theme */
html.light-theme .theme-icon-dark {
    display: none;
}

html.light-theme .theme-icon-light {
    display: block;
}

.theme-dropdown {
    background-color: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0.25rem !important;
    margin-top: 0.5rem !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    min-width: 160px !important;
}

.theme-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.theme-dropdown .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.theme-dropdown .dropdown-item.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

.theme-dropdown .dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.theme-dropdown .dropdown-item span {
    font-weight: 500;
}

.theme-dropdown .theme-divider {
    margin: 0.25rem 0;
    border-color: var(--border-color);
    opacity: 0.5;
}


/* Powered By */
.powered-by {
    display: flex;
    align-items: center;
}

.powered-by span {
    font-size: 0.813rem;
    color: var(--text-muted);
}

/* Copyright */
.copyright {
    display: flex;
    align-items: center;
}

.copyright span {
    font-size: 0.813rem;
    color: var(--text-muted);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-content.text-left {
        align-items: flex-start;
    }
    
    .footer-content.text-center {
        align-items: center;
    }
    
    .footer-content.text-right {
        align-items: flex-end;
    }
}

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

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

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

.scroll-to-top:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-3px);
}

.scroll-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

/* Light theme scroll button */
html.light-theme .scroll-to-top {
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

html.light-theme .scroll-to-top:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

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

/* ========================================
   Utilities
   ======================================== */

.bg-gradient {
    background: linear-gradient(135deg, #1a2332 0%, #1e3a5f 100%);
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.bg-white {
    background-color: var(--bg-card) !important;
}

.bg-dark {
    background-color: var(--bg-primary) !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.border-top {
    border-top-color: var(--border-color) !important;
}

/* Hero Intro Section */
.hero-intro {
    background-color: var(--bg-primary);
    padding: 4rem 0 2rem 0 !important;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Section Headings */
.section-heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 2rem;
}

.section-divider {
    height: 1px;
    width: 100%;
    max-width: 450px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 20%, var(--secondary-color) 50%, var(--primary-color) 80%, transparent 100%);
    opacity: 0.6;
}

/* Responsive section divider */
@media (max-width: 767px) {
    .section-divider {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .section-divider {
        max-width: 220px;
    }
}

.title-underline {
    height: 4px;
    width: 100px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
    margin-top: 1rem;
}

.title-underline.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Featured & Recent Sections */
.featured-section,
.recent-section {
    background-color: var(--bg-primary);
}

/* Large Featured Post (Left Side) */
.large-featured-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.large-featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.25);
    border-color: var(--primary-color);
}

.large-featured-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.large-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.large-featured-card:hover .large-featured-image img {
    transform: scale(1.05);
}

.large-featured-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.large-featured-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.large-featured-excerpt {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.5;
    margin: 0;
}

.post-meta-featured {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    overflow: hidden;
}

.author-avatar i {
    font-size: 1.25rem;
}

.author-avatar .author-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.post-date-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Side Featured Posts (Right Side) */
.side-featured-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.side-featured-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.side-featured-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.25);
    border-color: var(--primary-color);
}

.side-featured-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.side-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.side-featured-card:hover .side-featured-image img {
    transform: scale(1.05);
}

.side-featured-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.side-featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.side-featured-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* Post Card Styling (for Most Recent Posts) */
.post-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.25);
    border-color: var(--primary-color);
}

.post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

.post-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-start;
}

.post-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-category {
    display: inline-block;
    color: #e6a502;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.post-category:hover {
    color: #ffc107;
    text-decoration: none;
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-date,
.post-read-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Load More Button */
.btn-outline-primary {
    border-width: 2px;
    padding: 0.75rem 2rem;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:active,
.btn-outline-primary:focus {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: none !important;
}

/* Pagination */
.pagination .page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.pagination .page-link:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========================================
   Additional Dark Theme Elements
   ======================================== */

/* Container backgrounds */
.container {
    position: relative;
}

/* List styling */
ul, ol {
    color: var(--text-primary);
}

/* Links in content */
main a {
    color: var(--primary-color);
}

main a:hover {
    color: var(--primary-light);
}

/* Selection color */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Small text elements */
small {
    color: var(--text-muted);
}

/* HR elements */
hr {
    border-color: var(--border-color);
    opacity: 1;
}

/* ========================================
   Featured Category Section (Like DigitalOcean Community)
   ======================================== */

.featured-category-section,
.category-page-hero {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.category-page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.category-header {
    margin-bottom: 2rem;
}

.category-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(5px);
}

.category-post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
}

.category-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.category-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-post-card:hover .category-post-image img {
    transform: scale(1.05);
}

.category-post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-post-card:hover .category-post-title {
    color: var(--primary-color);
}

.category-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.post-meta-divider {
    color: var(--text-muted);
}

/* Form elements (if needed) */
input, textarea, select {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(59, 157, 255, 0.25);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-heading {
        font-size: 1.75rem;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    /* Stack featured posts on mobile */
    .large-featured-image {
        height: 200px;
    }
    
    .large-featured-content {
        padding: 1.25rem;
    }
    
    .large-featured-title {
        font-size: 1.75rem;
    }
    
    .large-featured-excerpt {
        font-size: 1rem;
    }
    
    .side-featured-container {
        gap: 1rem;
    }
    
    .side-featured-image {
        height: 120px;
    }
    
    .side-featured-content {
        padding: 1rem;
    }
    
    .side-featured-title {
        font-size: 1.25rem;
    }
    
    .post-meta-featured {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth transitions for theme */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ========================================
   Single Post Page Styles
   ======================================== */

.single-post-header {
    background: var(--bg-primary);
    padding: 2rem 0 1.5rem;
}

.single-post-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 1.25rem;
}

.single-post-meta {
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
}

.single-post-meta .post-author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.single-post-meta .author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    flex-shrink: 0;
    overflow: hidden;
}

.single-post-meta .author-avatar i {
    font-size: 1.5rem;
}

.single-post-meta .author-avatar .author-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.single-post-meta .author-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.single-post-meta .author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.single-post-meta .post-date-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.single-post-image {
    margin-top: 2rem;
}

.featured-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.featured-image-wrapper .save-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(20, 30, 48, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.featured-image-wrapper .save-btn:hover {
    background: rgba(20, 30, 48, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.featured-image-wrapper .save-btn i {
    font-size: 1rem;
}

.single-post-image img {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.single-post-content {
    background: var(--bg-primary);
}

.single-post-content .post-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-primary);
    max-width: 100%;
}

.single-post-content .post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.single-post-content .post-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.single-post-content .post-content p {
    margin-bottom: 1.25rem;
}

.single-post-content .post-content ul,
.single-post-content .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.single-post-content .post-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.single-post-content .post-content code {
    background: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-color);
}

.single-post-content .post-content pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(168, 85, 247, 0.1);
    line-height: 1.6;
    position: relative;
}

/* Code block wrapper for copy button */
.code-block-wrapper {
    position: relative;
}

/* Copy button */
.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: var(--light);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    width: 2.2rem;
    height: 2.2rem;
}

.single-post-content .post-content pre:hover .copy-code-btn,
.post-body pre:hover .copy-code-btn,
.article-content pre:hover .copy-code-btn {
    opacity: 1;
    visibility: visible;
}

.copy-code-btn:hover {
    background: rgba(168, 85, 247, 0.4);
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(168, 85, 247, 0.3);
}

.copy-code-btn.copied {
    background: rgba(80, 250, 123, 0.3);
    border-color: #50fa7b;
    color: #50fa7b;
    opacity: 1;
    visibility: visible;
}

.copy-code-btn i {
    font-size: 1rem;
}

/* Scrollbar for single post content */
.single-post-content .post-content pre::-webkit-scrollbar {
    height: 8px;
}

.single-post-content .post-content pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.single-post-content .post-content pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.single-post-content .post-content pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

.single-post-content .post-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

/* Syntax Highlighting for Code Blocks - Vibrant Dark Theme */
.single-post-content .post-content pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
}

.single-post-content .post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
}

/* Generic text */
.chroma { color: #e8e8e8; }

/* Comments */
.chroma .c,   /* Comment */
.chroma .c1,  /* CommentSingle */
.chroma .cm,  /* CommentMultiline */
.chroma .cs   /* CommentSpecial */ {
    color: #7cc36e;
    font-style: italic;
}

/* Keywords */
.chroma .k,   /* Keyword */
.chroma .kd,  /* KeywordDeclaration */
.chroma .kp,  /* KeywordPseudo */
.chroma .kr,  /* KeywordReserved */
.chroma .kt   /* KeywordType */ {
    color: #ff79c6;
    font-weight: 500;
}

/* Import/Include */
.chroma .kn {
    color: #ff6ac1;
}

/* Strings */
.chroma .s,   /* String */
.chroma .s1,  /* StringSingle */
.chroma .s2,  /* StringDouble */
.chroma .sb,  /* StringBacktick */
.chroma .sc,  /* StringChar */
.chroma .sd,  /* StringDoc */
.chroma .se,  /* StringEscape */
.chroma .sh   /* StringHeredoc */ {
    color: #f1fa8c;
}

/* Numbers */
.chroma .m,   /* Number */
.chroma .mf,  /* NumberFloat */
.chroma .mi,  /* NumberInteger */
.chroma .mh,  /* NumberHex */
.chroma .mo   /* NumberOct */ {
    color: #bd93f9;
}

/* Functions */
.chroma .n,   /* Name */
.chroma .nf,  /* NameFunction */
.chroma .fm   /* NameFunctionMagic */ {
    color: #50fa7b;
}

/* Classes/Types */
.chroma .nc,  /* NameClass */
.chroma .nn,  /* NameNamespace */
.chroma .nt   /* NameTag */ {
    color: #8be9fd;
}

/* Variables and Identifiers */
.chroma .nv,  /* NameVariable */
.chroma .nx,  /* NameOther */
.chroma .vi,  /* NameVariableInstance */
.chroma .vg   /* NameVariableGlobal */ {
    color: #6fcaf0;
}

/* Operators */
.chroma .o,   /* Operator */
.chroma .ow   /* OperatorWord */ {
    color: #ff79c6;
}

/* Built-ins */
.chroma .nb,  /* NameBuiltin */
.chroma .bp   /* NameBuiltinPseudo */ {
    color: #8be9fd;
}

/* Constants */
.chroma .kc,  /* KeywordConstant */
.chroma .no   /* NameConstant */ {
    color: #bd93f9;
}

/* Decorators/Annotations */
.chroma .nd,  /* NameDecorator */
.chroma .ni   /* NameEntity */ {
    color: #ffb86c;
}

/* HTML/XML Tags */
.chroma .nt {  /* NameTag */
    color: #ff79c6;
}

/* HTML/XML Attributes */
.chroma .na {  /* NameAttribute */
    color: #50fa7b;
}

/* Property names (CSS/JSON) */
.chroma .nl,  /* NameLabel */
.chroma .py   /* NameProperty */ {
    color: #8be9fd;
}

/* Punctuation */
.chroma .p {   /* Punctuation */
    color: #f8f8f2;
}

/* Language variables (this, self, etc) */
.chroma .nb {
    color: #bd93f9;
}

/* Errors */
.chroma .err {
    color: #ff5555;
    font-weight: bold;
}

/* Generic emphasis */
.chroma .ge {
    font-style: italic;
}

/* Generic strong */
.chroma .gs {
    font-weight: bold;
}

/* Generic heading */
.chroma .gh {
    color: #bd93f9;
    font-weight: bold;
}

/* Generic subheading */
.chroma .gu {
    color: #8be9fd;
    font-weight: bold;
}

/* Shell prompts */
.chroma .gp {
    color: #6272a4;
}

/* Generic output */
.chroma .go {
    color: #e8e8e8;
}

/* Hide line numbers */
.single-post-content .post-content pre .line-number,
.single-post-content .post-content pre .ln,
pre .line-number,
pre .ln,
code .line-number,
code .ln {
    display: none !important;
}

.single-post-content .post-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.single-post-content .post-content a:hover {
    color: var(--primary-light);
}

/* Post Images Section */
.post-images-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 3rem;
}

.post-images-section .images-heading {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.post-image-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.post-image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.post-image-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image-item:hover img {
    transform: scale(1.05);
}

/* Post Tags Section */
.post-tags-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 3rem;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    display: inline-block;
    padding: 0.4rem 0.875rem;
    background: rgba(59, 157, 255, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag-link:hover {
    background: rgba(59, 157, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Share Section */
.post-share-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 2rem;
}

.share-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    background: rgba(59, 157, 255, 0.1);
}

.share-btn i {
    font-size: 1.125rem;
}

/* Post Navigation */
.post-navigation {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.nav-post-card {
    display: block;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 157, 255, 0.15);
}

.nav-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

/* Related Posts Section */
.related-posts-section {
    background: var(--bg-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 3rem;
}

.related-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.related-post-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    border: 1px solid transparent;
}

.related-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 157, 255, 0.15);
    border-color: rgba(59, 157, 255, 0.3);
}

.related-post-link {
    text-decoration: none;
    display: block;
}

.related-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.1);
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .single-post-title {
        font-size: 1.75rem;
    }
    
    .single-post-content .post-content {
        font-size: 1rem;
    }
    
    .single-post-content .post-content h2 {
        font-size: 1.5rem;
    }
    
    .single-post-content .post-content h3 {
        font-size: 1.25rem;
    }
    
    .post-image-item img {
        height: 200px;
    }
    
    .related-post-image {
        height: 180px;
    }
}

/* ========================================
   DigitalOcean Style - Single Post Page
   ======================================== */

/* Hero Section */
.single-post-hero {
    background-color: var(--bg-primary);
    padding: 40px 0 50px;
    border-bottom: 1px solid var(--border-color);
}

.hero-tag-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-tag-badge:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #d946a6 100%);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.hero-post-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--light);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.hero-author-avatar {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
    overflow: hidden;
}

.hero-author-avatar .author-profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.hero-author-avatar i {
    font-size: 2.5rem;
    color: var(--text-secondary);
}

.hero-author-info {
    text-align: left;
}

.hero-author-name {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.hero-author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.hero-author-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.hero-author-role {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.hero-post-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.hero-meta-separator {
    margin: 0 0.5rem;
}

/* Back Link */
.back-link-section {
    border-bottom: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link i {
    margin-right: 0.25rem;
}

/* Post Header */
.single-post-header {
    border-bottom: 1px solid var(--border-color);
}

.post-tags-top {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-light);
}

.single-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2rem;
}

/* Author Meta Section */
.author-meta-section {
    margin-bottom: 1.5rem;
}

.author-avatar-circle {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

.author-avatar-circle i {
    font-size: 2.5rem;
    color: var(--text-secondary);
}

.author-info-block {
    display: flex;
    flex-direction: column;
}

.author-name-role {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.author-name-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.author-name-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.author-role {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Post Meta Line */
.post-meta-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-separator {
    color: var(--text-muted);
}

/* Post Content */
.single-post-content {
    padding: 3rem 0;
}

.content-wrapper {
    max-width: 100%;
}

/* Sticky Sidebars */
.sticky-sidebar {
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

/* Left Sidebar - Table of Contents */
.toc-sidebar {
    padding-right: 1rem;
}

.back-link-sidebar {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.back-link-sidebar:hover {
    color: var(--primary-color);
}

.back-link-sidebar i {
    margin-right: 0.25rem;
}

.toc-wrapper {
    border-left: none;
    padding-left: 0;
    margin-top: 1rem;
}

.toc-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 1rem;
}

.toc-nav {
    font-size: 0.875rem;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Custom scrollbar for TOC */
.toc-nav::-webkit-scrollbar {
    width: 4px;
}

.toc-nav::-webkit-scrollbar-track {
    background: transparent;
}

.toc-nav::-webkit-scrollbar-thumb {
    background: var(--gray-dark);
    border-radius: 2px;
}

.toc-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* Reset all ul/li inside TOC */
.toc-nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 0.15rem;
}

/* Target the Hugo-generated nav wrapper */
#TableOfContents {
    margin: 0;
    padding: 0;
}

/* Main level (H2) links - Direct children of TableOfContents > ul */
#TableOfContents > ul > li > a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    line-height: 1.5;
    padding: 0.3rem 0;
    font-size: 0.875rem;
    font-weight: 400;
}

#TableOfContents > ul > li > a:hover {
    color: var(--light);
}

#TableOfContents > ul > li > a.active {
    color: var(--light);
    font-weight: 500;
}

/* Nested container (H3 items) - ul inside li */
#TableOfContents > ul > li > ul {
    padding-left: 1rem;
    margin-top: 0.15rem;
    margin-bottom: 0.3rem;
    margin-left: 0;
}

/* H3 list items */
#TableOfContents > ul > li > ul > li {
    margin-bottom: 0.15rem;
}

/* H3 links (nested) */
#TableOfContents > ul > li > ul > li > a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
    line-height: 1.5;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 400;
}

#TableOfContents > ul > li > ul > li > a:hover {
    color: var(--light);
}

#TableOfContents > ul > li > ul > li > a.active {
    color: var(--light);
    font-weight: 500;
}

/* Right Sidebar - Share */
.share-sidebar {
    padding-left: 2rem;
}

.share-widget {
    background-color: transparent;
    padding: 0;
}

.share-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.share-buttons-horizontal {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.share-icon-simple {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon-simple:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.tags-widget {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags-widget-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.tags-widget-badge:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-light);
    border-color: var(--primary-color);
}

/* Mobile Share Section */
.mobile-share-section {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.mobile-share-section h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tags-widget-mobile .tags-widget-badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
}

.share-widget-mobile .share-buttons-horizontal {
    border-bottom: none;
    padding-bottom: 0;
    gap: 1.25rem;
    justify-content: flex-start;
}

.share-widget-mobile .share-icon-simple {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.share-widget-mobile .share-icon-simple:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.post-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.post-body {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.post-body h2 {
    font-size: 1.875rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    scroll-margin-top: 100px;
}

.post-body h2:target {
    animation: highlight 2s ease-in-out;
}

.post-body h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    scroll-margin-top: 100px;
}

.post-body h3:target {
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(59, 157, 255, 0.2);
    }
    100% {
        background-color: transparent;
    }
}

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

.post-body ul, .post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

.post-body code {
    background-color: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9375rem;
    color: var(--primary-light);
}

.post-body pre {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 
                0 0 20px rgba(168, 85, 247, 0.1);
    line-height: 1.6;
}

/* Scrollbar for post-body */
.post-body pre::-webkit-scrollbar {
    height: 8px;
}

.post-body pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.post-body pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.post-body pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

.post-body pre code {
    background-color: transparent;
    padding: 0;
    color: var(--text-primary);
}

/* About the Author Section */
.about-author-section {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.about-author-heading {
    font-size: 1.5rem;
    color: var(--light);
    font-weight: 600;
}

.author-card {
    background-color: transparent;
}

.author-avatar-large {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

.author-avatar-large i {
    font-size: 4rem;
    color: var(--text-secondary);
}

.author-bio-content {
    flex: 1;
}

.author-name-title strong {
    font-size: 1.125rem;
    color: var(--light);
}

.author-title-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.author-role-detail {
    font-size: 0.9375rem;
}

.author-bio-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Share Section */
.share-section {
    border-top: 1px solid var(--border-color);
}

.share-title {
    font-size: 1.125rem;
    color: var(--light);
    font-weight: 600;
}

.share-buttons-group {
    display: flex;
    gap: 1rem;
}

.share-btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.share-btn-icon:hover {
    background-color: var(--primary-color);
    color: var(--light);
    transform: translateY(-2px);
}

/* Related Articles Section */
.related-articles-section {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.related-articles-section .container {
    max-width: 1400px;
}

.related-articles-heading {
    font-size: 1.75rem;
    color: var(--light);
    font-weight: 600;
    margin-bottom: 2rem;
}

.related-articles-section .post-card {
    margin-bottom: 0;
}

.related-article-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.25);
}

.related-article-image-link {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.related-article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-image-link:hover .related-article-image {
    transform: scale(1.05);
}

.related-article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-article-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    width: fit-content;
    transition: all 0.3s ease;
}

.related-article-tag:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-light);
}

.related-article-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-article-title a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-article-title a:hover {
    color: var(--primary-color);
}

.related-article-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.author-name-small {
    color: var(--text-secondary);
}

.date-small {
    color: var(--text-muted);
}

.read-more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: auto;
}

.read-more-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .single-post-hero {
        padding: 30px 0 40px;
    }
    
    .hero-post-title {
        font-size: 2rem;
    }
    
    .hero-author-section {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-author-info {
        margin-left: 0 !important;
        margin-top: 1rem;
        text-align: center;
    }
    
    .single-post-title {
        font-size: 2rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
    
    .post-body h2 {
        font-size: 1.5rem;
    }
    
    .post-body h3 {
        font-size: 1.25rem;
    }
    
    .author-card {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar-large {
        margin-bottom: 1rem;
    }
    
    .author-bio-content {
        margin-left: 0 !important;
    }
    
    .related-article-image {
        height: 180px;
    }
}

/* ========================================
   Tags Pages Styling
   ======================================== */

/* Breadcrumb */
.breadcrumb-section {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-custom {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item-custom {
    font-size: 0.9375rem;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.breadcrumb-separator,
.breadcrumb-divider {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

.breadcrumb-item-custom.active {
    color: var(--text-secondary);
}

/* Tag Page Header */
.tag-page-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.tag-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
}

.tag-page-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Tag Posts List */
.tag-posts-list {
    background-color: var(--bg-primary);
}

/* Tags List Page */
.tags-list-hero {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.tag-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.tag-icon i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.tags-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--light);
}

.tags-hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* All Tags Cloud */
.all-tags-section {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.all-tags-heading {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--light);
}

.all-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.tag-cloud-item {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tag-cloud-item:hover,
.tag-cloud-item.active {
    background-color: var(--primary-color);
    color: var(--light);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tag-count {
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Tags Grid Section */
.tags-grid-section {
    background-color: var(--bg-primary);
}

/* Modern Category/Tag Cards */
.category-card {
    display: block;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.25);
    background-color: var(--bg-card);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card-icon {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.category-card:hover .category-card-icon {
    transform: scale(1.1);
}

.category-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.category-card-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tag-grid-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-grid-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 157, 255, 0.2);
}

.tag-grid-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tag-grid-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 0.5rem;
}

.tag-grid-count {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tags-hero-title {
        font-size: 2rem;
    }
    
    .tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .tag-grid-card,
    .category-card {
        padding: 1.5rem;
    }
}

/* ========================================
   Pagefind Search Customization
   ======================================== */

/* Pagefind search container in navbar */
#search {
    min-width: 200px;
    position: static;
}

/* Pagefind wrapper - CRITICAL: must allow dropdown to escape */
.pagefind-ui {
    position: static !important;
}

/* Dark theme customization */
.pagefind-ui {
    --pagefind-ui-scale: 1;
    --pagefind-ui-primary: #0066cc;
    --pagefind-ui-text: #e4e6eb;
    --pagefind-ui-background: #1a1d23;
    --pagefind-ui-border: #3a3f47;
    --pagefind-ui-tag: #0066cc;
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 6px;
    --pagefind-ui-image-border-radius: 6px;
    --pagefind-ui-image-box-ratio: 3 / 2;
    --pagefind-ui-font: inherit;
}

/* Search form styling */
.pagefind-ui__form {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    background-color: rgba(50, 50, 55, 0.4) !important;
    border: 1px solid rgba(100, 100, 110, 0.3) !important;
    border-radius: 5px !important;
    padding: 0.35rem 0.65rem !important;
    transition: all 0.2s ease !important;
    min-width: 160px !important;
    max-width: 200px !important;
    height: 36px !important;
}

.pagefind-ui__form:focus-within {
    background-color: rgba(55, 55, 60, 0.5) !important;
    border-color: rgba(120, 120, 130, 0.4) !important;
    box-shadow: none !important;
}

/* Search input */
.pagefind-ui__search-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #cccccc !important;
    font-size: 0.875rem !important;
    padding: 0 !important;
    flex: 1 !important;
    min-width: 60px !important;
    font-weight: 400 !important;
    height: 100% !important;
}

.pagefind-ui__search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.pagefind-ui__search-input::placeholder {
    color: rgba(200, 200, 200, 0.5) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

/* Hide default clear button */
.pagefind-ui__search-clear {
    display: none !important;
}

/* Hide search icon */
.pagefind-ui__search-input::before,
.pagefind-ui__form::before,
.pagefind-ui__search-icon {
    display: none !important;
}

.pagefind-ui svg,
.pagefind-ui__search-input + svg {
    display: none !important;
}

/* Results drawer - THIS IS THE KEY */
.pagefind-ui__drawer {
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 0.25rem) !important;
    z-index: 9999 !important;
    background-color: rgba(20, 25, 30, 0.98) !important;
    border: 1px solid rgba(100, 100, 110, 0.4) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7) !important;
    max-height: 450px !important;
    overflow-y: auto !important;
    width: 500px !important;
    max-width: 90vw !important;
    min-width: unset !important;
}

/* Message */
.pagefind-ui__message {
    color: rgba(255, 255, 255, 0.5) !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.6875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    background-color: transparent !important;
    border-bottom: none !important;
    font-weight: 600 !important;
}

/* Results list */
.pagefind-ui__results {
    padding: 0.5rem 0 !important;
}

/* Individual result */
.pagefind-ui__result {
    border-bottom: none !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

.pagefind-ui__result::before {
    display: none !important;
}

.pagefind-ui__result:hover {
    background-color: rgba(40, 45, 55, 0.6) !important;
}

.pagefind-ui__result:hover::before {
    display: none !important;
}

.pagefind-ui__result:last-child {
    border-bottom: none !important;
}

/* Result link */
.pagefind-ui__result-link {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    display: block !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1 !important;
}

.pagefind-ui__result-link:hover {
    color: var(--text-primary) !important;
}

/* Result title */
.pagefind-ui__result-title {
    color: #ffffff !important;
    margin-bottom: 0.375rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    transition: color 0.2s ease !important;
}

.pagefind-ui__result:hover .pagefind-ui__result-title {
    color: var(--primary-color) !important;
}

/* Result excerpt */
.pagefind-ui__result-excerpt {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
}

/* Highlighted search terms in excerpt */
.pagefind-ui__result-excerpt mark {
    background-color: rgba(0, 102, 204, 0.3) !important;
    color: #66b3ff !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
}

/* Highlighted search terms in title */
.pagefind-ui__result-title mark {
    background-color: rgba(0, 102, 204, 0.3) !important;
    color: #66b3ff !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 600 !important;
}

/* Loading state */
.pagefind-ui__loading {
    color: var(--text-muted) !important;
    padding: 1rem !important;
    text-align: center !important;
}

/* Mobile search overlay improvements */
@media (max-width: 991px) {
    /* Add padding to search results area */
    .pagefind-ui__results-area {
        padding: 0.5rem 0 !important;
    }
    
    /* Style the message header */
    .pagefind-ui__message {
        background-color: transparent !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 0.75rem 0.5rem !important;
        margin-bottom: 0.75rem !important;
        color: var(--text-secondary) !important;
    }
    
    /* Improve result cards on mobile */
    .pagefind-ui__result {
        border: 1px solid var(--border-color) !important;
        transition: all 0.2s ease !important;
    }
    
    .pagefind-ui__result:hover {
        border-color: var(--primary-color) !important;
        box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15) !important;
    }
    
    /* Better touch targets */
    .pagefind-ui__result-link {
        padding: 0.25rem 0 !important;
        min-height: 44px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Large screens (desktops, 1200px and up) */
@media (max-width: 1199px) {
    .container {
        max-width: 100%;
        padding: 0 1.5rem;
    }
    
    .category-section {
        padding: 2rem 0;
    }
}

/* Medium screens (tablets, 992px and up) */
@media (max-width: 991px) {
    
    /* Search - Full width on mobile nav */
    #search {
        width: 100%;
        margin: 0.5rem 0;
        position: relative;
    }
    
    .pagefind-ui__form {
        max-width: 100% !important;
        width: 100% !important;
        background-color: rgba(30, 30, 35, 0.6) !important;
        border: 1px solid rgba(100, 100, 110, 0.4) !important;
        padding: 0.65rem 1rem !important;
        height: 44px !important;
        border-radius: 8px !important;
    }
    
    .pagefind-ui__search-input {
        font-size: 1rem !important;
    }
    
    /* Dropdown container positioned below search */
    .pagefind-ui__drawer {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 70vh !important;
        transform: none !important;
        border-radius: 12px !important;
        background-color: rgba(20, 25, 30, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(100, 100, 110, 0.4) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7) !important;
        overflow-y: auto !important;
        padding: 0.75rem !important;
        z-index: 9999 !important;
    }
    
    .pagefind-ui__results-area {
        margin-top: 1rem !important;
    }
    
    .pagefind-ui__result {
        padding: 1rem !important;
        border-radius: 8px !important;
        margin-bottom: 0.75rem !important;
        background-color: rgba(25, 25, 30, 0.6) !important;
    }
    
    .pagefind-ui__result:hover {
        background-color: rgba(35, 35, 45, 0.7) !important;
    }
    
    .pagefind-ui__result-title {
        font-size: 1rem !important;
    }
    
    .pagefind-ui__result-excerpt {
        font-size: 0.875rem !important;
    }
    
    /* Navigation */
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
    }
    
    /* Hero section */
    .hero-content {
        padding: 3rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
    }
    
    .hero-content .lead {
        font-size: 1rem !important;
    }
    
    /* Cards */
    .category-posts-grid,
    .tag-posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 1.25rem !important;
    }
    
    .post-card {
        padding: 1.25rem;
    }
    
    /* Category sections */
    .category-section {
        padding: 1.5rem 0;
    }
    
    .section-header {
        margin-bottom: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}

/* Small screens (phones in landscape, 768px and up) */
@media (max-width: 767px) {
    /* Typography */
    body {
        font-size: 0.9375rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .nav-link {
        font-size: 0.9375rem !important;
    }
    
    /* Hero section */
    .hero-content {
        padding: 2.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    /* Code blocks - ensure horizontal scroll on mobile */
    .post-content .content pre {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
    }

    
    .hero-content .lead {
        font-size: 0.9375rem !important;
    }
    
    .hero-meta {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .hero-tag-badge {
        padding: 0.375rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    /* Cards */
    .category-posts-grid,
    .tag-posts-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .post-card {
        padding: 1rem;
    }
    
    .post-card h3 {
        font-size: 1.125rem;
    }
    
    .post-card p {
        font-size: 0.875rem;
    }
    
    .post-meta {
        font-size: 0.8125rem;
    }
    
    /* Category sections */
    .category-section {
        padding: 1.25rem 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.375rem;
    }
    
    .view-all-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8125rem;
        padding: 0.5rem 0;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0;
        font-size: 0.875rem;
    }
    
    /* Search - Keep dropdown style but optimized for mobile */
    .pagefind-ui__form {
        background-color: rgba(25, 25, 30, 0.7) !important;
        height: 44px !important;
        padding: 0.625rem 1rem !important;
    }
    
    .pagefind-ui__search-input {
        font-size: 0.9375rem !important;
    }
    
    /* Dropdown container - positioned below search, takes most of screen */
    .pagefind-ui__drawer {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 200px) !important;
        transform: none !important;
        border-radius: 12px !important;
        background-color: rgba(20, 25, 30, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(100, 100, 110, 0.4) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8) !important;
        overflow-y: auto !important;
        padding: 0.75rem !important;
        z-index: 9999 !important;
    }
    
    .pagefind-ui__message {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .pagefind-ui__result {
        padding: 1rem 0.75rem !important;
        margin-bottom: 0.5rem !important;
        border-radius: 8px !important;
        background-color: rgba(30, 30, 35, 0.5) !important;
    }
    
    .pagefind-ui__result-title {
        font-size: 0.875rem !important;
    }
    
    .pagefind-ui__result-excerpt {
        font-size: 0.75rem !important;
    }
}

/* Extra small screens (phones in portrait, less than 576px) */
@media (max-width: 575px) {
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Hero */
    .hero-content {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem !important;
    }
    
    .hero-content .lead {
        font-size: 0.875rem !important;
    }
    
    /* Cards - ensure single column */
    .category-posts-grid,
    .tag-posts-grid {
        grid-template-columns: 1fr !important;
    }
    
    .post-card {
        padding: 0.875rem;
    }
    
    .post-card h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .post-card p {
        font-size: 0.8125rem;
        line-height: 1.5;
    }
    
    /* Section headers */
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    /* Buttons */
    .view-all-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    /* Meta information */
    .post-meta,
    .breadcrumb {
        font-size: 0.75rem;
    }
    
    /* Search */
    .pagefind-ui__search-input {
        font-size: 0.875rem !important;
        padding: 0.625rem 1rem !important;
    }
    
    .pagefind-ui__drawer {
        max-height: 70vh !important;
    }
}

/* Very small screens (less than 400px) */
@media (max-width: 399px) {
    .hero-content h1 {
        font-size: 1.375rem !important;
    }
    
    .section-header h2 {
        font-size: 1.125rem;
    }
    
    .post-card h3 {
        font-size: 0.9375rem;
    }
    
    .navbar-brand {
        font-size: 1.125rem !important;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-content {
        padding: 1.5rem 0;
    }
    
    .pagefind-ui__drawer {
        max-height: 80vh !important;
    }
    
    .category-section {
        padding: 1rem 0;
    }
}

/* ========================================
   MOBILE TOUCH & ACCESSIBILITY
   ======================================== */

/* Improve touch targets on mobile */
@media (max-width: 767px) {
    /* Minimum 44x44px touch targets */
    .nav-link,
    .view-all-btn,
    .hero-tag-badge,
    button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Better tap feedback */
    a, button, .post-card {
        -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
    }
    
    /* Prevent text selection on double tap */
    .post-card h3,
    .nav-link,
    button {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* Smooth scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus (iOS) */
    input[type="text"],
    input[type="search"],
    textarea {
        font-size: 16px !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Responsive spacing utilities */
.mobile-mt-1 { margin-top: 0.5rem; }
.mobile-mt-2 { margin-top: 1rem; }
.mobile-mt-3 { margin-top: 1.5rem; }
.mobile-mb-1 { margin-bottom: 0.5rem; }
.mobile-mb-2 { margin-bottom: 1rem; }
.mobile-mb-3 { margin-bottom: 1.5rem; }

@media (min-width: 768px) {
    .mobile-mt-1,
    .mobile-mt-2,
    .mobile-mt-3,
    .mobile-mb-1,
    .mobile-mb-2,
    .mobile-mb-3 {
        margin: 0 !important;
    }
}

/* Text truncation utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hide/Show on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce animations on mobile for better performance */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
    .post-card:hover {
        transform: translateY(-3px) !important; /* Reduced from -5px */
    }
    
    /* Faster transitions */
    a,
    button,
    .post-card,
    .view-all-btn {
        transition-duration: 0.2s !important;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .post-card:hover {
        transform: none !important;
    }
}

/* Dark mode media query support (for browsers that don't support by default) */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but ensures consistency */
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
}

/* ========================================
   LIGHT THEME SPECIFIC OVERRIDES
   ======================================== */

html.light-theme body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* Typography in light theme */
html.light-theme h1,
html.light-theme h2,
html.light-theme h3,
html.light-theme h4,
html.light-theme h5,
html.light-theme h6 {
    color: var(--text-primary);
    font-weight: 700;
}

html.light-theme p,
html.light-theme span,
html.light-theme div {
    color: var(--text-primary);
}

html.light-theme .lead,
html.light-theme .hero-content .lead {
    color: var(--text-secondary) !important;
}

html.light-theme .text-muted {
    color: var(--text-muted) !important;
}

/* Header & Navigation */
html.light-theme .site-header {
    background-color: var(--bg-primary);
    border-bottom-color: var(--border-color);
}

/* Switch logo for light theme */
html.light-theme .navbar-brand .logo-light {
    display: block;
    opacity: 1;
}

html.light-theme .navbar-brand .logo-dark {
    display: none;
    opacity: 0;
}

html.light-theme .navbar-brand,
html.light-theme .nav-link {
    color: var(--text-primary) !important;
}

html.light-theme .nav-link:hover,
html.light-theme .nav-link.active {
    color: var(--primary-color) !important;
}

html.light-theme .nav-separator {
    color: var(--border-color);
    opacity: 0.6;
}

/* Hero Section */
html.light-theme .hero-section {
    background-color: var(--bg-primary);
}

html.light-theme .hero-content h1 {
    color: var(--text-primary) !important;
}

html.light-theme .hero-meta span,
html.light-theme .post-meta {
    color: var(--text-secondary) !important;
}

html.light-theme .hero-tag-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards */
html.light-theme .post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.light-theme .post-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

html.light-theme .post-card h3 {
    color: var(--text-primary) !important;
}

html.light-theme .post-card p {
    color: var(--text-secondary) !important;
}

html.light-theme .category-post-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.light-theme .category-post-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

html.light-theme .category-post-title {
    color: var(--text-primary) !important;
}

html.light-theme .category-post-meta {
    color: var(--text-secondary) !important;
}

html.light-theme .card-title a {
    color: var(--text-primary) !important;
}

html.light-theme .card-title a:hover {
    color: var(--primary-color) !important;
}

html.light-theme .post-category {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.light-theme .post-category:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateX(3px);
}

html.light-theme .category-post-content {
    background-color: var(--bg-card);
}

/* Featured Cards - Enhanced shadows */
html.light-theme .featured-card,
html.light-theme .category-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

html.light-theme .featured-card:hover,
html.light-theme .category-card:hover {
    box-shadow: 0 12px 32px rgba(168, 85, 247, 0.12), 0 6px 12px rgba(0, 0, 0, 0.06);
    border-color: rgba(168, 85, 247, 0.3);
}

/* Section Headers */
html.light-theme .section-header h2,
html.light-theme .category-section-title,
html.light-theme .tags-hero-title {
    color: var(--text-primary) !important;
}

html.light-theme .tags-hero-subtitle {
    color: var(--text-secondary) !important;
}

/* View All Button */
html.light-theme .view-all-btn {
    background-color: var(--bg-card);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html.light-theme .view-all-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* Breadcrumb */
html.light-theme .breadcrumb {
    color: var(--text-secondary);
}

html.light-theme .breadcrumb a {
    color: var(--primary-color);
}

/* Search */
html.light-theme .pagefind-ui__form {
    background-color: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

html.light-theme .pagefind-ui__form:focus-within {
    background-color: var(--bg-card) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1) !important;
}

html.light-theme .pagefind-ui__search-input {
    color: var(--text-primary) !important;
}

html.light-theme .pagefind-ui__search-input::placeholder {
    color: var(--text-muted) !important;
}

html.light-theme .pagefind-ui__drawer {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

html.light-theme .pagefind-ui__result {
    background-color: var(--bg-tertiary) !important;
    border: 1px solid transparent !important;
}

html.light-theme .pagefind-ui__result:hover {
    background-color: var(--bg-card) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15) !important;
}

html.light-theme .pagefind-ui__result-title {
    color: var(--text-primary) !important;
}

html.light-theme .pagefind-ui__result-excerpt {
    color: var(--text-secondary) !important;
}

html.light-theme .pagefind-ui__message {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-color) !important;
}

/* Footer */
html.light-theme .site-footer {
    background-color: var(--bg-primary) !important;
    border-top-color: var(--border-color);
}

html.light-theme .theme-switcher {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

html.light-theme .theme-toggle-btn {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

html.light-theme .theme-toggle-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

html.light-theme .theme-dropdown {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
}

html.light-theme .theme-dropdown .dropdown-item {
    color: var(--text-secondary);
}

html.light-theme .theme-dropdown .dropdown-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

html.light-theme .theme-dropdown .dropdown-item.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

html.light-theme .theme-dropdown .theme-divider {
    border-color: var(--border-color);
    opacity: 0.7;
}

/* Documentation Dropdown - Light Theme */
html.light-theme .dropdown-menu.docs-menu {
    background-color: transparent;
}

html.light-theme .docs-menu-title {
    color: var(--text-primary);
}

html.light-theme .docs-menu-title:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

html.light-theme .docs-menu-link {
    color: var(--text-secondary);
    border-left-color: transparent;
}

html.light-theme .docs-menu-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

html.light-theme .docs-menu-link.active {
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

html.light-theme .docs-menu-link.active i {
    color: var(--primary-color);
}

html.light-theme .docs-menu-link i {
    color: var(--text-muted);
}

/* Light theme - section highlight effect */
html.light-theme .docs-body h1:target,
html.light-theme .docs-body h2:target,
html.light-theme .docs-body h3:target,
html.light-theme .docs-body h4:target,
html.light-theme .docs-body h5:target,
html.light-theme .docs-body h6:target {
    animation: sectionHighlightLight 2.5s ease-in-out;
}

@keyframes sectionHighlightLight {
    0%, 15% {
        background-color: rgba(168, 85, 247, 0.15);
        box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08);
    }
    100% {
        background-color: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}

html.light-theme .powered-by span,
html.light-theme .copyright span {
    color: var(--text-muted) !important;
}

/* Mobile Share Section */
html.light-theme .mobile-share-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

html.light-theme .mobile-share-section h6 {
    color: var(--text-primary) !important;
}

html.light-theme .share-widget-mobile .share-icon-simple {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

html.light-theme .share-widget-mobile .share-icon-simple:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

/* Tags */
html.light-theme .tags-widget-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html.light-theme .tags-widget-badge:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

html.light-theme .hero-tag-badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

html.light-theme .hero-tag-badge:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #d946a6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
    transform: translateY(-2px);
}

/* Article Content */
html.light-theme .post-content,
html.light-theme .article-content {
    color: var(--text-primary);
}

html.light-theme .post-content h1,
html.light-theme .post-content h2,
html.light-theme .post-content h3,
html.light-theme .post-content h4,
html.light-theme .post-content h5,
html.light-theme .post-content h6 {
    color: var(--text-primary) !important;
}

html.light-theme .post-content p,
html.light-theme .post-content li {
    color: var(--text-primary) !important;
}

html.light-theme .post-content a {
    color: var(--primary-color);
}

html.light-theme .post-content code {
    background-color: var(--bg-tertiary);
    color: #2563eb;
}

/* Light theme copy button */
html.light-theme .copy-code-btn {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--primary-color);
}

html.light-theme .copy-code-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

html.light-theme .copy-code-btn.copied {
    background: rgba(34, 134, 58, 0.15);
    border-color: #22863a;
    color: #22863a;
    opacity: 1;
    visibility: visible;
}

/* Light theme for all code blocks */
html.light-theme pre,
html.light-theme .single-post-content pre,
html.light-theme .post-body pre {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html.light-theme pre code,
html.light-theme .single-post-content pre code,
html.light-theme .post-body pre code {
    color: #2d3748 !important;
}

html.light-theme .post-content pre {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

html.light-theme .post-content pre code {
    color: #2d3748;
}

/* Syntax highlighting colors for light theme - Vibrant Light Theme */
html.light-theme .chroma {
    color: #24292e !important;
}

/* Comments */
html.light-theme .chroma .c,
html.light-theme .chroma .c1,
html.light-theme .chroma .cm,
html.light-theme .chroma .cs {
    color: #22863a !important;
    font-style: italic;
}

/* Keywords */
html.light-theme .chroma .k,
html.light-theme .chroma .kd,
html.light-theme .chroma .kn,
html.light-theme .chroma .kp,
html.light-theme .chroma .kr,
html.light-theme .chroma .kt {
    color: #d73a49 !important;
    font-weight: 500;
}

/* Import/Include */
html.light-theme .chroma .kn {
    color: #6f42c1 !important;
}

/* Strings */
html.light-theme .chroma .s,
html.light-theme .chroma .s1,
html.light-theme .chroma .s2,
html.light-theme .chroma .sb,
html.light-theme .chroma .sc,
html.light-theme .chroma .sd,
html.light-theme .chroma .se,
html.light-theme .chroma .sh {
    color: #032f62 !important;
}

/* Numbers */
html.light-theme .chroma .m,
html.light-theme .chroma .mf,
html.light-theme .chroma .mi,
html.light-theme .chroma .mh,
html.light-theme .chroma .mo {
    color: #005cc5 !important;
}

/* Functions */
html.light-theme .chroma .n,
html.light-theme .chroma .nf,
html.light-theme .chroma .fm {
    color: #6f42c1 !important;
}

/* Classes/Types */
html.light-theme .chroma .nc,
html.light-theme .chroma .nn,
html.light-theme .chroma .nt {
    color: #22863a !important;
    font-weight: 600;
}

/* Variables and Identifiers */
html.light-theme .chroma .nv,
html.light-theme .chroma .nx,
html.light-theme .chroma .vi,
html.light-theme .chroma .vg {
    color: #e36209 !important;
}

/* Operators */
html.light-theme .chroma .o,
html.light-theme .chroma .ow {
    color: #d73a49 !important;
}

/* Built-ins */
html.light-theme .chroma .nb,
html.light-theme .chroma .bp {
    color: #005cc5 !important;
}

/* Constants */
html.light-theme .chroma .kc,
html.light-theme .chroma .no {
    color: #005cc5 !important;
}

/* Decorators/Annotations */
html.light-theme .chroma .nd,
html.light-theme .chroma .ni {
    color: #e36209 !important;
}

/* HTML/XML Tags */
html.light-theme .chroma .nt {
    color: #22863a !important;
}

/* HTML/XML Attributes */
html.light-theme .chroma .na {
    color: #6f42c1 !important;
}

/* Property names (CSS/JSON) */
html.light-theme .chroma .nl,
html.light-theme .chroma .py {
    color: #005cc5 !important;
}

/* Punctuation */
html.light-theme .chroma .p {
    color: #24292e !important;
}

/* Errors */
html.light-theme .chroma .err {
    color: #cb2431 !important;
    font-weight: bold;
}

/* Generic emphasis */
html.light-theme .chroma .ge {
    font-style: italic;
}

/* Generic strong */
html.light-theme .chroma .gs {
    font-weight: bold;
}

/* Generic heading */
html.light-theme .chroma .gh {
    color: #005cc5 !important;
    font-weight: bold;
}

/* Generic subheading */
html.light-theme .chroma .gu {
    color: #22863a !important;
    font-weight: bold;
}

/* Shell prompts */
html.light-theme .chroma .gp {
    color: #6a737d !important;
}

/* Generic output */
html.light-theme .chroma .go {
    color: #24292e !important;
}

/* Light theme scrollbar */
html.light-theme .post-content pre::-webkit-scrollbar {
    height: 8px;
}

html.light-theme .post-content pre::-webkit-scrollbar-track {
    background: rgba(168, 85, 247, 0.05);
    border-radius: 4px;
}

html.light-theme .post-content pre::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

html.light-theme .post-content pre::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
}

html.light-theme .post-content blockquote {
    border-left-color: var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
}

/* Share Sidebar */
html.light-theme .share-widget-title {
    color: var(--text-primary) !important;
}

html.light-theme .share-icon-simple {
    color: var(--text-secondary);
}

html.light-theme .share-icon-simple:hover {
    color: var(--primary-color);
}

/* Table of Contents Light Theme */
html.light-theme .toc-wrapper {
    border-left: none;
}

html.light-theme .toc-title {
    color: var(--text-primary);
}

html.light-theme .toc-nav::-webkit-scrollbar-thumb {
    background: var(--gray-dark);
}

html.light-theme .toc-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

html.light-theme #TableOfContents > ul > li > a {
    color: var(--text-secondary);
}

html.light-theme #TableOfContents > ul > li > a:hover {
    color: var(--text-primary);
}

html.light-theme #TableOfContents > ul > li > a.active {
    color: var(--primary-color);
    font-weight: 600;
}

html.light-theme #TableOfContents > ul > li > ul > li > a {
    color: var(--text-muted);
}

html.light-theme #TableOfContents > ul > li > ul > li > a:hover {
    color: var(--text-primary);
}

html.light-theme #TableOfContents > ul > li > ul > li > a.active {
    color: var(--primary-color);
    font-weight: 600;
}

html.light-theme .back-link-sidebar {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

html.light-theme .back-link-sidebar:hover {
    color: var(--primary-color);
}

/* ========================================
   GitHub-style Light/Dark Mode Images
   ======================================== */

/* Default state - hide light mode images, show dark mode images */
img[src*="#gh-light-mode-only"] {
    display: none !important;
}

img[src*="#gh-dark-mode-only"] {
    display: block !important;
}

/* Light theme - show light mode images, hide dark mode images */
html.light-theme img[src*="#gh-light-mode-only"],
html[data-theme="light"] img[src*="#gh-light-mode-only"] {
    display: block !important;
}

html.light-theme img[src*="#gh-dark-mode-only"],
html[data-theme="light"] img[src*="#gh-dark-mode-only"] {
    display: none !important;
}

/* System preference light mode */
@media (prefers-color-scheme: light) {
    html:not(.dark-theme):not([data-theme="dark"]) img[src*="#gh-light-mode-only"] {
        display: block !important;
    }
    
    html:not(.dark-theme):not([data-theme="dark"]) img[src*="#gh-dark-mode-only"] {
        display: none !important;
    }
}

/* Ensure images maintain proper styling */
img[src*="#gh-light-mode-only"],
img[src*="#gh-dark-mode-only"] {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}
