:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --bg: #f9fafb;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-700);
    line-height: 1.8;
    font-size: 16px;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 2rem 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.nav-section {
    padding: 0.5rem 1rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 3rem 4rem;
    max-width: 1000px;
}

/* Header */
.report-header {
    text-align: center;
    padding: 3rem 0 4rem;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 3rem;
}

.report-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.report-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.report-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.hero-cta {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    margin-bottom: 1rem;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
    background: var(--primary-dark);
}

.hero-subcta {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.report-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    text-align: center;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--gray-700);
    font-weight: 500;
}

/* Sections */
.section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
    position: relative;
}

/* Section Decorative Separator */
.section::after {
    content: '';
    display: block;
    margin-top: 4rem;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23e5e7eb' fill-opacity='0.5' d='M0,32L48,37.3C96,43,192,53,288,48C384,43,480,21,576,16C672,11,768,21,864,32C960,43,1056,53,1152,48C1248,43,1344,21,1392,10.7L1440,0L1440,60L1392,60C1344,60,1248,60,1152,60C1056,60,960,60,864,60C768,60,672,60,576,60C480,60,384,60,288,60C192,60,96,60,48,60L0,60Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.6;
}

.section:last-of-type::after {
    display: none;
}

/* Alternate wave colors for visual variety */
.section:nth-child(even)::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%232563eb' fill-opacity='0.08' d='M0,24L60,26.7C120,29,240,35,360,37.3C480,40,600,40,720,34.7C840,29,960,19,1080,18.7C1200,19,1320,29,1380,34.7L1440,40L1440,60L1380,60C1320,60,1200,60,1080,60C960,60,840,60,720,60C600,60,480,60,360,60C240,60,120,60,60,60L0,60Z'%3E%3C/path%3E%3C/svg%3E");
    background-size: cover;
}

.section-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.75rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
}

.subsection-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 2rem 0 1rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Lists */
ul,
ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

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

tr:hover {
    background: var(--gray-100);
}

/* Code Blocks */
pre {
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Info Boxes */
.info-box {
    padding: 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box.note {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--primary);
}

.info-box.success {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--success);
}

.info-box.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--warning);
}

.info-box-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

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

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: transparent;
    box-shadow:
        0 20px 40px rgba(37, 99, 235, 0.15),
        0 8px 16px rgba(124, 58, 237, 0.1);
}

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

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.2) rotate(-5deg);
}

.card h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

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

.card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0;
    text-align: left;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.team-member {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.team-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.team-member p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
    text-align: center;
}

/* Architecture Diagram */
.architecture {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.arch-layer {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.arch-layer-name {
    font-weight: 600;
    color: var(--dark);
    min-width: 140px;
}

.arch-layer-desc {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.arch-layer-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

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

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

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .report-title {
        font-size: 1.75rem;
    }

    .report-meta {
        flex-direction: column;
        gap: 1rem;
    }

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

/* Print Styles */
@media print {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .section {
        page-break-inside: avoid;
    }
}

/* Dark Mode */
body.dark-mode {
    --bg: #0f172a;
    --white: #1e293b;
    --dark: #f8fafc;
    --gray-900: #f1f5f9;
    --gray-700: #e2e8f0;
    --gray-600: #cbd5e1;
    --gray-500: #94a3b8;
    --gray-400: #64748b;
    --gray-200: #334155;
    --gray-100: #1e293b;
}

body.dark-mode .sidebar {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode pre {
    background: #0f172a;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-700);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

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

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--primary);
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 9999;
    transition: width 0.1s;
}

/* Mobile Hamburger */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 200;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
}

.hamburger {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    transition: all 0.3s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
        display: block;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        padding-top: 80px;
    }
}

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

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-modal.open {
    display: flex;
}

.search-box {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.search-input {
    width: 100%;
    padding: 1.25rem;
    border: none;
    font-size: 1.1rem;
    background: transparent;
    color: var(--dark);
    outline: none;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    border-top: 1px solid var(--gray-200);
}

.search-result-item {
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--gray-100);
}

.search-hint {
    padding: 0.75rem 1.25rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Mermaid Diagram */
.mermaid-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

/* Screenshot placeholder */
.screenshot-placeholder {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    color: var(--gray-500);
    margin: 1.5rem 0;
}

.screenshot-placeholder .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
}

.timeline-item h4 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.timeline-item .date {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

/* Screenshot Images */
.screenshot-placeholder {
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.screenshot-placeholder:hover {
    border-color: var(--primary);
    background: var(--white);
}

.screenshot-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    transition: transform 0.3s ease;
}

.screenshot-img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}



/* FAQ Accordion */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item[open] {
    background: rgba(37, 99, 235, 0.02);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--gray-600);
}

.faq-answer p {
    margin: 0;
    text-align: left;
}

/* Dark Mode Enhancements */
body.dark-mode .info-box.note {
    background: rgba(37, 99, 235, 0.15);
}

body.dark-mode .info-box.success {
    background: rgba(16, 185, 129, 0.15);
}

body.dark-mode .info-box.warning {
    background: rgba(245, 158, 11, 0.15);
}

body.dark-mode .faq-item {
    background: var(--gray-100);
}

body.dark-mode .faq-item[open] {
    background: rgba(37, 99, 235, 0.1);
}



/* Prism.js Dark Mode Override */
body.dark-mode pre[class*="language-"],
body.dark-mode code[class*="language-"] {
    background: #0f172a;
}

/* Section Fade-in Animation */
.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

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

/* Staggered animation delays */
.section:nth-child(1) {
    animation-delay: 0.1s;
}

.section:nth-child(2) {
    animation-delay: 0.15s;
}

.section:nth-child(3) {
    animation-delay: 0.2s;
}

.section:nth-child(4) {
    animation-delay: 0.25s;
}

.section:nth-child(5) {
    animation-delay: 0.3s;
}

/* Team Card Enhancements */
.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.team-member {
    transition: all 0.3s ease;
}

/* Mobile scroll margin fix */
@media (max-width: 1024px) {
    .section {
        scroll-margin-top: 80px;
    }
}

/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1001;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary-600), var(--primary-400));
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.4);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Enhanced Sidebar Active State */
.nav-link.active {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
    border-left: 3px solid var(--primary-600);
    padding-left: calc(1rem - 3px);
    position: relative;
    overflow: hidden;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    background: var(--primary-400);
    animation: sidePulse 2s infinite;
}

@keyframes sidePulse {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

/* Dark Mode Overrides for New Elements */
body.dark-mode .nav-link.active {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-400);
    border-color: var(--primary-500);
}

body.dark-mode .reading-progress-bar {
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.6);
}

/* Premium Stat Box Hover */
.stat-box {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

body.dark-mode .stat-box:hover {
    background: var(--gray-800);
    border-color: var(--primary-700);
}

/* ============================================
   TOOLTIP HOVER CARDS
   ============================================ */

/* Tooltip trigger - technical terms */
.tooltip-term {
    position: relative;
    display: inline;
    border-bottom: 2px dotted var(--primary);
    color: var(--primary);
    cursor: help;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tooltip-term:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tooltip card container */
.tooltip-term::before,
.tooltip-term::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    pointer-events: none;
}

/* Tooltip arrow */
.tooltip-term::before {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 8px solid transparent;
    border-top-color: var(--gray-900);
}

/* Tooltip content box */
.tooltip-term::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 250px;
    max-width: 320px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--gray-900) 0%, #1e293b 100%);
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    border-radius: 10px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Tooltip with title (optional) */
.tooltip-term[data-tooltip-title]::after {
    content: attr(data-tooltip-title) "\A\A" attr(data-tooltip);
    white-space: pre-wrap;
}

/* Show tooltip on hover */
.tooltip-term:hover::before,
.tooltip-term:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip accent bar */
.tooltip-term[data-tooltip]::after {
    border-top: 3px solid;
    border-image: linear-gradient(90deg, var(--primary), var(--accent)) 1;
}

/* Tooltip icon indicator */
.tooltip-term::marker {
    content: '💡';
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .tooltip-term::after {
        min-width: 200px;
        max-width: 280px;
        font-size: 0.8rem;
        left: 0;
        transform: translateX(0) translateY(10px);
    }

    .tooltip-term:hover::after {
        transform: translateX(0) translateY(0);
    }

    .tooltip-term::before {
        left: 20px;
    }
}

/* Dark mode tooltip adjustments */
body.dark-mode .tooltip-term {
    border-bottom-color: var(--primary-400);
    color: var(--primary-400);
}

body.dark-mode .tooltip-term::after {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* CAROUSEL INLINES CLEANUP */
/* Search Trigger in Sidebar */
.search-trigger {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    text-align: left;
    color: var(--gray-500);
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    /* Fixes font rendering */
    appearance: none;
    /* Removes default OS styling */
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-trigger:hover {
    background: var(--gray-200);
    color: var(--dark);
    border-color: var(--gray-300);
}

/* Keyboard Shortcut Badge */
.kbd-shortcut {
    background: var(--white);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    font-family: inherit;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Mobile Search Icon */
.mobile-search-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
}

.mobile-search-btn:active {
    transform: scale(0.95);
}

/* Figure Captions */
.figure-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: -1.5rem;
    font-style: italic;
}

/* Footer Note */
.footer-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Dark Mode Overrides for new classes */
body.dark-mode .search-trigger {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

body.dark-mode .search-trigger:hover {
    background: var(--gray-200);
}

body.dark-mode .kbd-shortcut {
    background: var(--gray-200);
    border-color: var(--gray-400);
    color: var(--gray-600);
}