/* ============================================
   BLOG SPECIFIC STYLES
============================================ */

/* Enhanced Design System Variables */
:root {
    --sidebar-bg: rgba(15, 15, 35, 0.95);
    --sidebar-accent: #00ff9f;
    --sidebar-hover: rgba(0, 255, 159, 0.1);
    --toc-active-bg: rgba(0, 255, 159, 0.15);
    --series-complete: #00ff9f;
    --series-current: #ff6b00;
    --series-pending: #666;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 360px;
}

/* Blog Hero Section */
.blog-hero {
    padding: 150px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.blog-description {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Blog Search */
.blog-search-wrapper {
    max-width: 600px;
    margin: 2rem auto 0;
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 50;
}

.blog-search-input {
    flex-grow: 1;
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.search-filter-btn {
    flex-shrink: 0;
    width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-filter-btn:hover, .search-filter-btn.active {
    background: var(--sidebar-accent);
    color: #000;
    border-color: var(--sidebar-accent);
}

/* Tags Dropdown */
.tags-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    z-index: 100;
}

.tags-dropdown.show {
    display: grid;
    animation: fadeInDown 0.2s ease forwards;
}

.tags-dropdown-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.tag-option {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tag-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-accent);
}

.tag-count-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Global Tooltip */
#global-series-tooltip {
    position: fixed;
    background: rgba(10, 10, 15, 0.95);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 255, 159, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translate(-50%, 10px);
    white-space: normal;
    max-width: 250px;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}

#global-series-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

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

.light-mode .blog-search-input {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
}

.light-mode .blog-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results i {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
}

/* Tag Cloud */
.tag-cloud-section {
    margin-bottom: 3rem;
    text-align: center;
}

.tag-cloud-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.tag-cloud-item {
    padding: 0.5rem 1.25rem;
    background: rgba(0, 255, 65, 0.1);
    border: 2px solid rgba(0, 255, 65, 0.3);
    border-radius: 25px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-cloud-item:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 255, 65, 0.3);
}

.tag-cloud-item.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.tag-count {
    font-size: 0.85rem;
    opacity: 0.8;
}

.light-mode .tag-cloud {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-sm);
}

.light-mode .tag-cloud-item {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--accent-primary);
}

.light-mode .tag-cloud-item:hover,
.light-mode .tag-cloud-item.active {
    background: var(--accent-primary);
    color: #ffffff;
}

/* Blog Section */
.blog-section {
    padding: 80px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

/* ============================================
   SERIES SHELF (Blog Index)
============================================ */
.series-shelf {
    margin: 2rem 0 3rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, rgba(0, 255, 159, 0.08), rgba(15, 15, 35, 0.5));
    border: 1px solid rgba(0, 255, 159, 0.2);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.series-shelf::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0, 255, 159, 0.18), transparent 45%);
    pointer-events: none;
}

.series-shelf-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.series-shelf-header h3 {
    font-size: 1.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.series-shelf-header p {
    color: var(--text-secondary);
    margin: 0;
}

.series-shelf-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    align-items: stretch;
}

.series-folder {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 20px;
    background: rgba(15, 15, 35, 0.7);
    border: 1px solid rgba(0, 255, 159, 0.18);
    backdrop-filter: blur(14px);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
    /* overflow: hidden; Removed to allow tooltips to popup */
    position: relative;
    z-index: 1; 
}

.series-folder:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 255, 159, 0.45);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    z-index: 10; /* Bring to front on hover */
}

.series-card-image {
    height: 140px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 20px 20px 0 0; /* Match card radius manually */
}

.series-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(15, 15, 35, 0.9));
}

.series-icon-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-accent);
    border: 1px solid rgba(0, 255, 159, 0.3);
}

.series-folder-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.series-folder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.series-folder-title {
    flex-grow: 1;
}

.series-folder-title h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.series-folder-count {
    font-size: 0.75rem;
    color: var(--sidebar-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    background: rgba(0, 255, 159, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
}

.series-folder-desc {
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.series-timeline-container {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.series-timeline-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 12px;
    margin-bottom: 0.5rem;
}

/* The connecting line */
.series-timeline-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    z-index: 0;
}

.series-timeline-dot {
    width: 12px;
    height: 12px;
    background: #1a1f2e;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.series-timeline-dot:hover {
    background: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
}

/* Tooltip on Hover */
/* Tooltip removed in favor of global JS tooltip
.series-timeline-dot::after {
    display: none;
} */

/* Tooltip Hover removed */

.series-timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.series-folder-actions {
    margin-top: auto;
}

/* Series Sidebar Badge Card */
.series-badge-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.01) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1.5rem 1rem 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.4s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.series-badge-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.02) 100%
    );
    border-color: rgba(255, 255, 255, 0.2);
}

/* Materialistic Badge Image Styles */
.series-sidebar-badge {
    width: 100%;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
    
    /* Rounded Corners */
    border-radius: 20px;
    
    /* Materialistic Real Badge Edges - Thick Acrylic/Glass Block */
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(255, 255, 255, 0.15);
    
    box-shadow: 
        /* 1. Sharp top/left highlight (Chamfered Glass Edge) */
        inset 1px 1px 0 rgba(255, 255, 255, 0.4),
        inset -1px -1px 0 rgba(0, 0, 0, 0.5),
        
        /* 2. Inner depth */
        inset 0 0 20px rgba(0, 0, 0, 0.4),
        
        /* 3. Physical dark rim */
        0 0 0 1px rgba(10, 10, 15, 0.9),
        
        /* 4. Metallic second rim */
        0 0 0 3px rgba(255, 255, 255, 0.08),
        
        /* 5. Deep Ambient Shadow */
        0 10px 25px rgba(0, 0, 0, 0.6);

    margin-bottom: 1rem;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.series-badge-card:hover .series-sidebar-badge {
    transform: scale(1.02) translateY(-2px);
    
    /* Active State: Neon Bezel */
    box-shadow: 
        inset 1px 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 0 20px rgba(0, 255, 65, 0.1), /* Inner Glow */
        0 0 0 1px #000,
        0 0 0 3px var(--accent-primary), /* Neon Ring */
        0 0 25px rgba(0, 255, 65, 0.4); /* Outer Glow */
        
    border-color: rgba(255, 255, 255, 0.5);
}

/* Mirror Shine Effect */
.badge-shimmer {
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.0) 30%,
        rgba(255, 255, 255, 0.4) 50%, /* Stronger reflection */
        rgba(255, 255, 255, 0.0) 70%,
        transparent 100%
    );
    transform: skewX(-25deg);
    z-index: 3;
    pointer-events: none;
}

.series-badge-card:hover .badge-shimmer {
    animation: mirrorShine 1.2s forwards;
}

@keyframes mirrorShine {
    0% { left: -150%; opacity: 0; }
    30% { opacity: 1; }
    100% { left: 150%; opacity: 0; }
}

/* Glass Button Footer */
.badge-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 14px 20px;
    border-radius: 12px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

/* Liquid/Neon fill on hover for button */
.badge-card-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    transform: translateX(-101%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.badge-card-footer i {
    color: var(--accent-primary);
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.badge-card-footer span {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.series-badge-card:hover .badge-card-footer {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.series-badge-card:hover .badge-card-footer::before {
    transform: translateX(0);
}

.series-badge-card:hover .badge-card-footer span,
.series-badge-card:hover .badge-card-footer i {
    color: #000;
}

/* Badge Modal */
.badge-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.badge-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.badge-modal-content {
    background: linear-gradient(135deg, rgba(15, 15, 20, 0.95) 0%, rgba(10, 10, 15, 0.98) 100%);
    width: 100%;
    max-width: 850px;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(0, 255, 65, 0.3);
    box-shadow: 0 0 60px rgba(0, 255, 65, 0.1), inset 0 0 30px rgba(0, 255, 65, 0.03);
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.badge-modal-overlay.visible .badge-modal-content {
    transform: translateY(0) scale(1);
}

.badge-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.badge-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Landscape Form Layout */
.cert-form-layout {
    display: flex;
    gap: 2.5rem;
    align-items: stretch;
}

.cert-form-left {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(0, 255, 65, 0.08) 0%, rgba(0, 255, 65, 0.02) 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 65, 0.15);
}

.cert-form-left .badge-preview {
    text-align: center;
}

.badge-trophy-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.4));
    animation: float 3s ease-in-out infinite;
}

.modal-badge-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 255, 65, 0.3));
    transition: transform 0.3s ease;
}

.modal-badge-image:hover {
    transform: scale(1.08);
}

.series-complete-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1rem 0 0.25rem;
    text-align: center;
}

.badge-congrats {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.cert-form-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cert-form-right .form-header {
    margin-bottom: 1.25rem;
}

.cert-form-right .form-header h2 {
    color: var(--text-primary);
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.cert-form-right .form-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
}

.cert-form-row {
    display: flex;
    gap: 1rem;
}

.cert-form-row .cert-form-group {
    flex: 1;
}

.cert-form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

.cert-form-newsletter {
    margin: 0;
}

.badge-usage-policy {
    background: rgba(0, 255, 65, 0.03);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: left;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 255, 65, 0.1);
}

.badge-usage-policy h4 {
    color: var(--accent-primary);
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-usage-policy ul {
    margin: 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.badge-usage-policy li + li {
    margin-top: 0.5rem;
}

.badge-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.badge-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.download-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-2px);
}

.share-btn-linkedin {
    background: #0077b5;
    color: #fff;
    border: 1px solid #0077b5;
    box-shadow: 0 4px 15px rgba(0, 119, 181, 0.3);
}

.share-btn-linkedin:hover {
    background: #006097;
    border-color: #006097;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 181, 0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   CERTIFICATE CLAIM FORM STYLES
============================================ */

/* Modal size adjustment for certificate flow */
.badge-modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Certificate Steps */
.cert-step {
    display: none;
}

.cert-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Certificate Claim Form */
.cert-claim-form {
    text-align: left;
}

.cert-form-group {
    margin-bottom: 0.9rem;
}

.cert-form-group label {
    display: block;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.cert-form-group label i {
    margin-right: 0.4rem;
}

.cert-form-group input[type="text"],
.cert-form-group input[type="email"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.25);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cert-form-group input[type="text"]:focus,
.cert-form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
}

.cert-form-group input[type="text"]::placeholder,
.cert-form-group input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

/* Checkbox Styling */
.cert-form-agreement,
.cert-form-newsletter {
    margin: 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid rgba(0, 255, 65, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--accent-primary);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: #000;
    font-weight: bold;
    font-size: 14px;
}

.cert-form-agreement a {
    color: var(--accent-primary);
    text-decoration: none;
}

.cert-form-agreement a:hover {
    text-decoration: underline;
}

/* Policy Details */
.cert-policy-details {
    background: rgba(0, 255, 65, 0.03);
    border: 1px solid rgba(0, 255, 65, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: left;
}

.cert-policy-details h4 {
    color: var(--accent-primary);
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.cert-policy-details ul {
    margin: 0;
    padding-left: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Generate Button */
.cert-generate-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #00ff41, #00cc33);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
}

.cert-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 65, 0.3);
}

.cert-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Certificate Preview - Modal for preview step */
.cert-step-preview .badge-modal-content {
    max-width: 1100px;
}

.cert-preview-container {
    margin: 1rem 0 1.25rem;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.cert-preview-container canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Credential Display */
.cert-credential-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 10px;
    padding: 0.9rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.cert-credential-box label {
    display: block;
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.credential-display {
    display: flex;
    gap: 0.5rem;
}

.credential-display input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    color: #00ff41;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
}

.copy-credential-btn {
    padding: 0.75rem 1rem;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-credential-btn:hover {
    background: var(--accent-primary);
    color: #000;
}

.credential-hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.credential-hint a {
    color: var(--accent-primary);
    text-decoration: none;
}

.credential-hint a:hover {
    text-decoration: underline;
}

/* Badge Actions for Certificate Flow */
.badge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.badge-action-btn.secondary-btn {
    background: transparent;
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: var(--accent-primary);
}

.badge-action-btn.secondary-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--accent-primary);
}

/* Back Button */
.cert-back-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.cert-back-btn:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .badge-modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    
    .badge-actions {
        flex-direction: column;
    }
    
    .badge-action-btn {
        width: 100%;
    }
    
    .credential-display {
        flex-direction: column;
    }
    
    .credential-display input {
        font-size: 0.65rem;
    }
}

.series-btn {
    padding: 0.55rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 180ms ease;
}

.series-btn.primary {
    background: var(--sidebar-accent);
    color: #0a0a0a;
    border-color: transparent;
}

.series-btn:hover {
    transform: translateY(-2px);
    border-color: var(--sidebar-accent);
    color: var(--sidebar-accent);
}

.series-btn.primary:hover {
    color: #0a0a0a;
    filter: brightness(0.92);
}

/* ============================================
   INDIVIDUAL POSTS SECTION
============================================ */
.posts-section {
    margin: 3rem 0 2rem;
}

.posts-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.posts-section-header h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.posts-section-header p {
    margin: 0;
    color: var(--text-secondary);
}

/* Blog Card */
.blog-card {
    overflow: hidden;
    transition: all var(--transition-normal);
}

.blog-card:hover {
    transform: translateY(-8px);
}

.blog-card-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.blog-card:hover .blog-overlay {
    opacity: 1;
}

.read-more-btn {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.read-more-btn:hover {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 2rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.blog-date {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-category {
    padding: 0.25rem 0.75rem;
    background: rgba(0, 255, 65, 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.blog-card-title {
    margin-bottom: 1rem;
}

.blog-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: color var(--transition-fast);
}

.blog-card-title a:hover {
    color: var(--accent-primary);
}

.blog-card-excerpt {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.7;
    margin-bottom: 1rem;
    opacity: 1;
    letter-spacing: -0.02em;
}

.light-mode .blog-card-excerpt {
    color: var(--text-primary);
    font-weight: 700;
    opacity: 1;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.blog-read-more {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.blog-read-more:hover {
    gap: 0.75rem;
}

/* No Posts Message */
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts i {
    font-size: 4rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.no-posts h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-posts p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ============================================
   BLOG POST PAGE
============================================ */

.blog-main {
    padding-top: 80px;
    min-height: 100vh;
    overflow: visible;
}

.blog-post,
.blog-post-content {
    padding-bottom: 4rem;
}

/* Post Header */
.post-header {
    padding: 80px 0 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.post-meta span {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.post-excerpt {
    font-size: 1.3rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 800px;
}

.post-featured-image {
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Post Content */
.post-content {
    padding: 60px 0;
}

.post-content .container {
    max-width: 1400px;
}

.content-wrapper {
    max-width: 850px; /* Constrain width for better readability */
    margin: 0 auto; /* Center alignment */
    position: relative;
    z-index: 2;
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6 {
    color: var(--text-primary);
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 800; /* Bolder headers */
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.content-wrapper h1 {
    font-size: 2.5rem;
    color: var(--accent-primary); /* Highlight H1 */
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.content-wrapper h2 {
    font-size: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-wrapper h3 {
    font-size: 1.5rem;
}

.content-wrapper h4 {
    font-size: 1.25rem;
}

.content-wrapper p {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-secondary); /* Slightly softer than pure white for readability */
    line-height: 1.8; /* Relaxed line height */
    margin-bottom: 2rem; /* More breathing room */
    font-size: 1.15rem; /* Larger body text */
    font-weight: 400;
    letter-spacing: 0.01em;
}

.content-wrapper strong {
    color: #fff;
    font-weight: 700;
}

.content-wrapper a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-primary);
    transition: all var(--transition-fast);
}

.content-wrapper a:hover {
    color: var(--accent-secondary);
    border-bottom-style: solid;
}

.content-wrapper ul,
.content-wrapper ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.content-wrapper li {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.8;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    position: relative;
    padding-left: 0.5rem;
}

.content-wrapper ul {
    list-style: none; /* Custom bullets */
}

.content-wrapper ul li::before {
    content: "•";
    color: var(--accent-primary);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 1.5em; /* Larger bullet */
    line-height: 1; /* Fix alignment */
    vertical-align: sub;
}

.content-wrapper ol li::marker {
    color: var(--accent-primary);
    font-weight: 700;
    font-family: var(--font-code);
}

/* Custom List Markers */

.content-wrapper blockquote {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-primary);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.content-wrapper code {
    background: rgba(100, 255, 218, 0.1); /* Subtle green tint */
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: var(--accent-primary);
    font-size: 0.9em;
}

.content-wrapper pre {
    background: #0a0a16; /* Darker distinct background */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.content-wrapper pre code {
    background: none;
    padding: 0;
    color: #e6e6e6;
    font-size: 0.95em;
    font-family: 'Fira Code', 'Consolas', monospace;
    line-height: 1.5;
}

.content-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2.5rem 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Image Captions */
.content-wrapper img + em {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    font-style: normal;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.post-content th,
.post-content td {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.post-content th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-weight: 600;
}

.post-content td {
    color: var(--text-secondary);
}

/* Post Footer */
.post-footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-share {
    text-align: center;
    margin-bottom: 3rem;
}

.post-share h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.linkedin {
    background: #0077B5;
}

.share-btn.facebook {
    background: #1877F2;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.prev-post,
.next-post {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prev-post:hover,
.next-post:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.nav-label {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

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

/* ============================================
   RESPONSIVE
============================================ */

@media (max-width: 768px) {
    .blog-title {
        font-size: 2.5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

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

    .share-buttons {
        flex-wrap: wrap;
    }
}

/* ============================================
   NEW USER-FRIENDLY FEATURES
============================================ */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--gradient-primary);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

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

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb-separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Reading Time */
.post-reading-time,
.blog-reading-time {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* View Count */
.post-view-count {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.post-view-count i {
    color: var(--accent-primary);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 255, 65, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.4);
}

/* ============================================
   THREE-COLUMN BLOG POST LAYOUT - COLLAPSIBLE SIDEBARS
============================================ */

/* Main wrapper */
.post-content {
    position: relative;
    padding-top: 60px;
    overflow: visible; /* Don't clip fixed elements */
    z-index: 1; /* Below toggle buttons (1050) */
}

/* Container for center content - full width by default */
.post-main-area {
    padding-left: 0;
    padding-right: 0;
    transition: padding var(--transition-normal);
}

/* Override default container max-width for blog posts */
.post-main-area .container {
    max-width: none !important;
    width: 100%;
    padding: 0 2rem;
}

/* Main content - centered within available space */
.post-main-content {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   SIDEBAR BOOKMARK TABS
============================================ */
.sidebar-tab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 180px;
    border: none;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, rgba(15, 15, 35, 0.98) 100%);
    border: 2px solid var(--sidebar-accent);
    border-radius: 0 12px 12px 0;
    color: var(--sidebar-accent);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
    z-index: 980; /* Below navbar (1000) and same level as sidebars */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 15px 8px;
}

.sidebar-tab .tab-label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    writing-mode: horizontal-tb;
    transform: rotate(-90deg);
}

/* TOC Tab - sticks out from left sidebar */
.toc-tab {
    left: 0;
    border-left: none;
    border-radius: 0 12px 12px 0;
}

/* Series Tab - sticks out from right sidebar */
.series-tab {
    right: 0;
    border-right: none;
    border-radius: 12px 0 0 12px;
    writing-mode: vertical-lr;
}

.sidebar-tab:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 6px 0 20px rgba(0, 255, 159, 0.4);
    background: var(--sidebar-accent);
    color: #0a0a0a;
    filter: brightness(1.1);
}

.sidebar-tab .tab-text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-tab .tab-icon {
    font-size: 1.2rem;
    margin: 8px 0;
}

/* Hide tabs when sidebar is expanded */
.toc-sidebar.expanded + .toc-tab,
.series-sidebar.expanded + .series-tab {
    opacity: 0;
    pointer-events: none;
}

/* OLD TOGGLE BUTTON STYLES - REMOVE */
.sidebar-toggle {
    position: fixed;
    top: 120px;
    z-index: 950; /* Reduced from 1050 to be below navbar */
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid var(--sidebar-accent);
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    color: var(--sidebar-accent);
    cursor: pointer;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    pointer-events: all !important;
    visibility: visible !important;
    
    /* Hidden by default, show after scroll */
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Show buttons after scrolling */
.sidebar-toggle.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Hide TOC button when TOC sidebar is open */
.toc-sidebar.expanded ~ .toc-toggle,
.toc-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

/* Hide Series button when Series sidebar is open */
.series-sidebar.expanded ~ .series-toggle,
.series-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.sidebar-toggle:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: rgba(15, 15, 35, 0.98);
}

.sidebar-toggle i {
    font-size: 1.2rem;
}

.sidebar-toggle .toggle-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-toggle.series-badge {
    position: relative;
}

.sidebar-toggle .series-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--series-current);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

.toc-toggle {
    left: 20px;
}

.series-toggle {
    right: 20px;
}

.sidebar-toggle.active {
    opacity: 1;
    background: var(--sidebar-accent);
    color: #0a0a0a;
}

/* Old Collapsible Sidebars Removed - See Mobile Off-Canvas styles below */


/* Backdrop */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    z-index: 1030; /* Above navbar (1000), below sidebars (1040) */
    opacity: 0;
    pointer-events: none !important;
    transition: opacity var(--transition-normal);
}

.sidebar-backdrop.active {
    opacity: 0;
    pointer-events: none !important;
}

/* Hide empty TOC sidebar */
.toc-sidebar .toc-inner:empty {
    display: none;
}

#toc-container:empty {
    display: none;
}

/* Share Buttons Below Title (Header) */
.share-buttons-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem 0;
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.share-btn-small {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.share-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn-small.twitter {
    background: #1DA1F2;
}

.share-btn-small.twitter:hover {
    background: #0d8ddb;
}

.share-btn-small.linkedin {
    background: #0077B5;
}

.share-btn-small.linkedin:hover {
    background: #006399;
}

.share-btn-small.facebook {
    background: #1877F2;
}

.share-btn-small.facebook:hover {
    background: #0c63d4;
}

.share-btn-small.copy {
    background: #6c757d;
}

.share-btn-small.copy:hover {
    background: #5a6268;
}

/* Floating Share Buttons - REMOVED (now in header) */

/* Post Navigation (Prev/Next) */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-prev,
.nav-next {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

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

.nav-prev:hover,
.nav-next:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.nav-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-title {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE LAYOUT
============================================ */

/* Collapsible sidebars - no padding changes needed on desktop */
@media (max-width: 1400px) {
    :root {
        --sidebar-width: 340px;
    }
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 320px;
    }
}

@media (max-width: 992px) {
    /* Hide toggle buttons on mobile */
    .sidebar-toggle {
        display: none;
    }
    
    /* Sidebars become relative, stack at top */
    .toc-sidebar,
    .series-sidebar {
        position: relative;
        transform: translateX(0) !important;
        width: 100%;
        height: auto;
        max-height: 400px;
        margin-bottom: 2rem;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        pointer-events: all !important;
    }
    
    .toc-sidebar.collapsed,
    .series-sidebar.collapsed {
        display: block;
        pointer-events: all;
    }
    
    .sidebar-backdrop {
        display: none;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
    }
    
}

@media (max-width: 768px) {
    .nav-prev,
    .nav-next {
        padding: 1rem;
    }
    
    .nav-title {
        font-size: 0.9rem;
    }
}

/* ============================================
   OTHER SERIES SECTION (Footer)
============================================ */
.other-series-section {
    margin: 4rem 0 3rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.other-series-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.other-series-section h3 i {
    color: var(--accent-primary);
}

.other-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.other-series-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.other-series-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.other-series-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.other-series-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.other-series-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.other-series-meta {
    margin-bottom: 1.5rem;
}

.series-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.other-series-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-decoration: none;
    transition: gap var(--transition-fast);
}

.other-series-link:hover {
    gap: 0.75rem;
}

.other-series-link i {
    transition: transform var(--transition-fast);
}

.other-series-link:hover i {
    transform: translateX(4px);
}

/* ============================================
   OLD LAYOUT STYLES (Keep for backward compatibility)
============================================ */
.post-layout {
    display: block;
    width: 100%;
}

.post-layout.has-series {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 3rem;
    align-items: start;
}

.post-main-content {
    min-width: 0;
    max-width: 850px;
}

/* ============================================
   SERIES NAVIGATION SIDEBAR (Fixed to Right)
============================================ */
/* ============================================
   SERIES NAVIGATION - ENHANCED WITH COMPLETION STATES
============================================ */
.series-description {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--series-current);
}

.series-description p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.series-progress {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-text {
    font-family: var(--font-mono);
    color: var(--series-current);
    font-size: 0.95rem;
    font-weight: 700;
}

.progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--series-current), var(--series-complete));
    border-radius: 10px;
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.series-list {
    margin-bottom: 1.5rem;
}

.series-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.series-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background var(--transition-fast);
}

.series-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.series-item.completed {
    opacity: 0.8;
}

.series-item.completed::before {
    background: var(--series-complete);
}

.series-item.current {
    background: rgba(255, 107, 0, 0.15);
    border-color: var(--series-current);
}

.series-item.current::before {
    background: var(--series-current);
}

.series-item.pending {
    opacity: 0.6;
}

.series-item.pending:hover {
    opacity: 0.8;
}

.series-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.series-item.completed .series-item-icon {
    background: rgba(0, 255, 159, 0.2);
    color: var(--series-complete);
}

.series-item.completed .completed-icon {
    font-size: 1.1rem;
}

.series-item.current .series-item-icon {
    background: rgba(255, 107, 0, 0.3);
    color: var(--series-current);
    animation: pulse 2s ease-in-out infinite;
}

.series-item.current .current-icon {
    font-size: 1.2rem;
}

.series-item.pending .series-item-icon {
    background: rgba(255, 255, 255, 0.05);
    color: var(--series-pending);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(255, 107, 0, 0);
    }
}

.series-item-content {
    flex: 1;
    min-width: 0;
}

.series-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.series-item-title .part-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.series-item-title:hover {
    color: var(--sidebar-accent);
}

.series-item.current .series-item-title {
    color: var(--series-current);
    cursor: default;
}

.current-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--series-current);
    background: rgba(255, 107, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-badge i {
    font-size: 0.65rem;
}

/* Quick Navigation Buttons */
.series-quick-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.quick-nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 5;
    cursor: pointer;
}

.quick-nav-btn:hover {
    background: var(--sidebar-hover);
    border-color: var(--sidebar-accent);
    color: var(--sidebar-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-nav-btn.prev i {
    order: -1;
}

.quick-nav-btn.next i {
    order: 1;
}

/* Responsive adjustments for series sidebar */
@media (max-width: 1200px) {
    .post-layout.has-series {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .series-sidebar {
        top: 90px;
    }
}

@media (max-width: 992px) {
    .post-layout.has-series {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .series-sidebar {
        position: relative;
        top: auto;
        max-height: none;
        margin-bottom: 2rem;
        order: -1; /* Show sidebar above content on mobile */
    }
}

@media (max-width: 768px) {
    .series-header h3 {
        font-size: 1rem;
    }
    
    .series-item {
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .series-item-number {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    .series-item-title {
        font-size: 0.9rem;
    }
    
    .series-item-excerpt {
        font-size: 0.75rem;
    }
}

/* ============================================
   TABLE OF CONTENTS (TOC) - ENHANCED WITH SCROLL SPY
============================================ */
.toc-wrapper {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--sidebar-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toc-list {
    list-style: none;
    padding-left: 0;
}

.toc-list li {
    margin-bottom: 0;
    font-weight: 500;
    position: relative;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.toc-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--sidebar-accent);
    transition: height var(--transition-fast);
    border-radius: 2px;
}

.toc-list a:hover {
    color: var(--text-primary);
    background: var(--sidebar-hover);
    transform: translateX(4px);
}

.toc-list a:hover::before {
    height: 60%;
}

.toc-list a.active {
    color: var(--sidebar-accent);
    background: var(--toc-active-bg);
    font-weight: 700;
}

.toc-list a.active::before {
    height: 80%;
}

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

.toc-list ul a {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* Author Bio */
.author-bio {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 3rem 0;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.author-role {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

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

.author-social {
    display: flex;
    gap: 1rem;
}

.author-social a {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.author-social a:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

/* Related Posts */
.related-posts {
    margin: 4rem 0;
}

.related-posts h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-post-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: block;
}

.related-post-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.related-post-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

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

.related-post-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Code Copy Button */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-code-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.copy-code-btn.copied {
    background: var(--success);
    border-color: var(--success);
}


/* Share Menu */
.share-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 2000; /* Above sidebar backdrop and all UI */
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-normal);
    min-width: 320px;
}

.share-menu.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
}

.share-menu h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    text-align: center;
}

.share-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.share-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.share-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.share-option i {
    font-size: 1.5rem;
}

.share-option span {
    font-size: 0.85rem;
    font-weight: 600;
}

.share-option.twitter {
    background: rgba(29, 161, 242, 0.2);
    border-color: #1DA1F2;
}

.share-option.twitter:hover {
    background: #1DA1F2;
}

.share-option.linkedin {
    background: rgba(0, 119, 181, 0.2);
    border-color: #0077B5;
}

.share-option.linkedin:hover {
    background: #0077B5;
}

.share-option.facebook {
    background: rgba(24, 119, 242, 0.2);
    border-color: #1877F2;
}

.share-option.facebook:hover {
    background: #1877F2;
}

.share-option.copy {
    background: rgba(108, 117, 125, 0.2);
    border-color: #6c757d;
}

.share-option.copy:hover {
    background: #6c757d;
}

.share-option.copy.copied {
    background: var(--series-complete);
    border-color: var(--series-complete);
}

.share-option.copy.copied span::after {
    content: ' ✓';
}

/* Reader Mode */
body.reader-mode .post-header,
body.reader-mode .sidebar-toggle,
body.reader-mode .reading-progress-bar,
body.reader-mode .post-navigation,
body.reader-mode .comments-section,
body.reader-mode .breadcrumb,
body.reader-mode footer {
    display: none !important;
}

body.reader-mode .content-wrapper {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Print Button - Legacy (kept for compatibility) */
.print-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    display: none; /* Hide in favor of FAB */
}

.print-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

/* Newsletter Subscription */
.newsletter-box {
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.1) 0%, rgba(0, 204, 51, 0.1) 100%);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin: 3rem 0;
    text-align: center;
}

.newsletter-box h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.newsletter-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.newsletter-input::placeholder {
    color: var(--text-secondary);
}

.newsletter-btn {
    padding: 0.75rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--bg-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.newsletter-btn:hover {
    transform: scale(1.05);
}

/* Light Mode Adjustments */
.light-mode .toc-wrapper,
.light-mode .author-bio,
.light-mode .related-post-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-sm);
}

.light-mode .breadcrumb a {
    color: var(--text-secondary);
}

.light-mode .newsletter-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-color: var(--accent-primary);
}

/* ============================================
   PUSH NOTIFICATION POPUP
============================================ */
.notification-popup {
    position: fixed;
    bottom: -500px;
    right: 2rem;
    max-width: 400px;
    width: calc(100% - 4rem);
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 255, 65, 0.3);
    z-index: 10000;
    transition: bottom var(--transition-slow);
    backdrop-filter: blur(10px);
}

.notification-popup.show {
    bottom: 2rem;
}

.notification-popup-content {
    padding: 2rem;
    text-align: center;
    position: relative;
}

.notification-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.notification-icon {
    font-size: 3rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

.notification-popup h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.notification-popup p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.notification-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.notification-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-size: 0.95rem;
}

.notification-btn.primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(0, 255, 65, 0.3);
}

.notification-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.4);
}

.notification-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Light Mode */
.light-mode .notification-popup {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.3);
}

.light-mode .notification-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

.light-mode .notification-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .notification-popup {
        right: 1rem;
        width: calc(100% - 2rem);
        max-width: none;
    }
    
    .notification-popup.show {
        bottom: 1rem;
    }
    
    .notification-buttons {
        flex-direction: column;
    }
    
    .notification-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .toc-wrapper {
        position: relative;
        top: 0;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   SYNTAX HIGHLIGHTING CUSTOMIZATION
============================================ */
/* Override Prism.js theme with cybersecurity colors */
pre[class*="language-"] {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem !important;
    margin: 1.5rem 0;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

code[class*="language-"] {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Line numbers */
.line-numbers .line-numbers-rows {
    border-right: 1px solid rgba(0, 255, 65, 0.3);
    padding-right: 0.8rem;
    margin-right: 0.8rem;
}

.line-numbers-rows > span:before {
    color: var(--accent-primary);
    opacity: 0.5;
}

/* Syntax token colors - cybersecurity theme */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a9955;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #00ff41;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #ce9178;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d4d4d4;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #569cd6;
}

.token.function,
.token.class-name {
    color: #dcdcaa;
}

.token.regex,
.token.important,
.token.variable {
    color: #d16969;
}

/* Light mode syntax highlighting */
.light-mode pre[class*="language-"] {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode code[class*="language-"] {
    color: #333333;
}

.light-mode .token.comment {
    color: #008000;
}

.light-mode .token.property,
.light-mode .token.tag,
.light-mode .token.number {
    color: #0070c1;
}

.light-mode .token.string {
    color: #a31515;
}

.light-mode .token.keyword {
    color: #0000ff;
}

.light-mode .token.function {
    color: #795e26;
}


/* ============================================
   NEW GRID LAYOUT STYLES
============================================ */
.blog-layout-container {
    max-width: 1800px; /* Wide container for 3 columns */
    margin: 0 auto;
    padding: 0 20px;
}

.blog-layout-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr); /* Default 2 columns (TOC + Content) */
    gap: 40px;
    align-items: start; /* KEEP START to prevent sidebars from stretching vertically */
    position: relative;
    padding-top: 40px;
    padding-bottom: 60px;
}

.blog-layout-grid.has-series-sidebar {
    grid-template-columns: 300px minmax(0, 1fr) 350px; /* 3 columns when Series exists */
}

/* FIX: Sticky Sidebars require height to stick within */
/* We apply sticky to the sidebar wrapper itself now, instead of inner */
.toc-sidebar-static,
.series-sidebar-static {
    display: block; 
    height: fit-content; /* Ensure it takes only needed space */
    background: transparent;
    box-shadow: none;
    position: -webkit-sticky;
    position: sticky;
    top: 100px; /* Stick to top */
    z-index: 10;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none; /* Hidden scrollbar */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Force hide scrollbars for Chrome, Safari and Opera with !important */
.toc-sidebar-static::-webkit-scrollbar,
.series-sidebar-static::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

/* Remove inner sticky behavior as we moved it to parent */
.sidebar-inner-sticky {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

/* Ensure inner container doesn't generate scrollbars either */
.sidebar-inner-sticky::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Sidebar Header Static */
.sidebar-header-static {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header-static h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main Column */
.post-main-column {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 0; /* Prevents grid blowout */
}

/* Series Box Static Styles */
.series-box-static {
    background: rgba(15, 15, 35, 0.5);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Sidebar Toggles */
.mobile-sidebar-toggle {
    display: none; /* Hidden on desktop */
    position: fixed;
    z-index: 1050;
    background: rgba(15, 15, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 40px;
    height: 48px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.toc-toggle { 
    top: 100px; 
    left: 0; 
    border-radius: 0 8px 8px 0;
}

.series-toggle { 
    top: 100px; 
    right: 0; 
    border-radius: 8px 0 0 8px;
}

.mobile-sidebar-toggle:hover,
.mobile-sidebar-toggle:active {
    width: 50px;
    background: var(--sidebar-accent);
    color: #000;
}

/* Responsive Breakpoints */
@media (max-width: 1600px) {
    .blog-layout-grid.has-series-sidebar {
        grid-template-columns: 280px minmax(0, 1fr) 300px;
        gap: 30px;
    }
}

@media (max-width: 1400px) {
    /* Show Mobile Toggles */
    .mobile-sidebar-toggle {
        display: flex;
    }

    /* Convert Grid to Single Column */
    .blog-layout-grid,
    .blog-layout-grid.has-series-sidebar {
        display: block;
        padding-top: 20px;
    }
    
    .post-main-column {
        max-width: 100%;
        margin: 0;
        border: none;
        background: transparent;
        padding: 0;
    }

    /* Convert Static Sidebars to Off-Canvas Drawers */
    .toc-sidebar-static,
    .series-sidebar-static {
        display: block; /* Ensure visible for transition */
        position: fixed;
        top: 0;
        bottom: 0;
        width: 85%; /* Max width for mobile */
        max-width: 320px;
        background: #0f0f23;
        z-index: 1100;
        padding: 0;
        box-shadow: var(--shadow-xl);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        height: 100vh;
    }
    
    /* Initially Hidden */
    .toc-sidebar-static {
        left: 0;
        transform: translateX(-100%);
    }
    
    .series-sidebar-static {
        right: 0;
        transform: translateX(100%);
    }

    /* Expanded State */
    .toc-sidebar-static.mobile-expanded {
        transform: translateX(0);
    }
    
    .series-sidebar-static.mobile-expanded {
        transform: translateX(0);
    }
    
    /* Adjust Inner Sticky to fill Drawer */
    .sidebar-inner-sticky {
        position: relative;
        top: 0;
        height: 100%;
        max-height: 100%;
        padding: 20px;
        overflow-y: auto;
    }
    
    .sidebar-header-static {
        margin-top: 40px; /* Space for close button if we had one, or just breathing room */
    }
}

/* ============================================
   ADVANCED TYPOGRAPHY & ELEMENT STYLING
============================================ */

/* Text Selection */
::selection {
    background: rgba(0, 255, 159, 0.3);
    color: #fff;
}

/* Horizontal Rule */
.content-wrapper hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 4rem 0;
}

/* Keyboard Inputs <kbd> */
.content-wrapper kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-code);
    font-size: 0.85em;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Task Lists [ ] */
.content-wrapper .task-list-item {
    list-style: none;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.content-wrapper .task-list-item-checkbox {
    margin: 0;
    appearance: none;
    width: 1.2em;
    height: 1.2em;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
}

.content-wrapper .task-list-item-checkbox::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--accent-primary);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.content-wrapper .task-list-item-checkbox:checked::before {
    transform: scale(1);
}

/* Enhanced Tables */
.content-wrapper table {
    width: 100%;
    margin: 2.5rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-wrapper th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--accent-primary);
    font-weight: 700;
    padding: 1.2rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.content-wrapper td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.01);
    transition: background 0.2s;
}

.content-wrapper tr:last-child td {
    border-bottom: none;
}

.content-wrapper tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Scrollable Tables wrapper (for mobile) */
.table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Callout Boxes / Admonitions (Blockquote variants) */
/* Usage: > [!NOTE] Text */
.content-wrapper blockquote.callout {
    border-left-width: 5px;
    position: relative;
    padding-left: 3.5rem;
}

.content-wrapper blockquote.callout::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 1.2rem;
    top: 1.8rem;
    font-size: 1.2rem;
}

/* Note */
.content-wrapper blockquote.note {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}
.content-wrapper blockquote.note::before { content: "\f05a"; color: #3b82f6; }

/* Warning */
.content-wrapper blockquote.warning {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}
.content-wrapper blockquote.warning::before { content: "\f071"; color: #f59e0b; }

/* Tip */
.content-wrapper blockquote.tip {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}
.content-wrapper blockquote.tip::before { content: "\f0eb"; color: #10b981; }

/* Danger */
.content-wrapper blockquote.danger {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}
.content-wrapper blockquote.danger::before { content: "\f00d"; color: #ef4444; }



/* ============================================
   INTEGRATED COMMENTS SECTION
============================================ */
.integrated-comments {
    max-width: 850px; /* Match content wrapper */
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.integrated-comments h4 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.integrated-comments h4::before {
    content: "\f086"; /* FontAwesome comment icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--accent-primary);
}

/* Giscus Customization */
.giscus {
    margin-top: 1rem;
}


/* ============================================
   MOBILE TYPOGRAPHY REFINEMENTS
============================================ */
@media (max-width: 768px) {
    .content-wrapper h1 {
        font-size: 1.8rem; /* Smaller H1 for mobile */
        margin-top: 2rem;
    }

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

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

    .content-wrapper p, 
    .content-wrapper li {
        font-size: 1rem; /* Standard readable size */
        line-height: 1.7;
    }

    .blog-layout-container {
        padding: 0 15px; /* Slightly less padding on small screens */
    }

    .blog-layout-grid {
        padding-top: 20px;
        padding-bottom: 40px;
    }
    
    /* Ensure sidebars cover full width on small phones */
    .toc-sidebar-static,
    .series-sidebar-static {
        width: 85vw;
        max-width: 300px;
    }
}

/* ============================================
   CHATBOT WIDGET STYLES (Cyberpunk Glass)
============================================ */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
}

/* Toggle Button */
.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(15, 15, 20, 0.9);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    backdrop-filter: blur(5px);
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.6);
}

/* Pulse Animation */
.chat-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--accent-primary);
    animation: chatPulse 2s infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes chatPulse {
    0% { width: 100%; height: 100%; opacity: 0.8; }
    100% { width: 160%; height: 160%; opacity: 0; }
}

/* Chat Interface (The Glass Card) */
.chat-interface {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: rgba(15, 15, 25, 0.85); /* Dark Glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
}

.chat-interface.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(0, 255, 65, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info i {
    font-size: 1.5rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 5px var(--accent-primary));
}

.chat-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.chat-status {
    font-size: 0.7rem;
    color: var(--accent-primary);
    display: block;
}

.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.chat-close-btn:hover {
    color: #fff;
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.size-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.size-dot {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.size-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.size-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.dot-sm { width: 8px; height: 8px; }
.dot-md { width: 12px; height: 12px; }
.dot-lg { width: 16px; height: 16px; }

.chat-interface.size-1x {
    width: 350px;
    height: 500px;
}
.chat-interface.size-2x {
    width: 500px;
    height: 650px;
}
.chat-interface.size-3x {
    width: 800px;
    height: 80vh;
    max-width: 95vw;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.message {
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.message-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Bot Message */
.bot-message {
    align-self: flex-start;
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.08); /* Glassy Grey */
    color: #eee;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* User Message */
.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: rgba(0, 255, 65, 0.15);
    color: #fff;
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.05);
}

.message-time {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    margin-left: 4px;
}

.user-message .message-time {
    text-align: right;
    margin-right: 4px;
}

/* Input Area */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

#chat-form {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.chat-send-btn {
    background: var(--accent-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #000;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

/* Typing Animation */
.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    margin-right: 3px;
    animation: typing 1s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

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

/* Mobile Responsive & Optimization */
@media (max-width: 768px) {
    /* Force Full Screen on Mobile regardless of size selection */
    .chat-interface.size-1x,
    .chat-interface.size-2x,
    .chat-interface.size-3x {
        width: 100% !important;
        height: 100% !important;
        max-width: 100vw !important;
        max-height: 100dvh !important; /* Use dynamic viewport height */
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        border: none;
        background: rgba(10, 10, 15, 0.98); /* Less transparent on mobile for readability */
    }

    /* Adjust initial transform for slide-up effect */
    .chat-interface {
        transform: translateY(110%) !important;
        transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1) !important;
    }

    .chat-interface.visible {
        transform: translateY(0) !important;
    }

    /* Hide resize dots on mobile */
    .size-controls {
        display: none;
    }

    /* Reposition toggle button */
    .chat-widget-container {
        bottom: 20px;
        right: 20px;
        z-index: 100000;
    }

    .chat-toggle-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    /* Better spacing on mobile */
    .chat-messages {
        padding: 15px 10px;
    }

    .message {
        max-width: 90%;
    }
}

/* Markdown Styling for Chatbot */
.message-content h1, 
.message-content h2, 
.message-content h3, 
.message-content h4 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: #fff;
    font-weight: 700;
}

.message-content h3 { font-size: 1.1em; }
.message-content h4 { font-size: 1em; }

.message-content p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.message-content ul, 
.message-content ol {
    margin-bottom: 8px;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
}

.message-content strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.message-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: #a5d6ff;
}

.message-content p > code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    color: #ff7b72;
}

.message-content hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 12px 0;
}

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

.message-content blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 10px;
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

