/* Practical Work - Clean Template Styles */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
}

/* Header */
.practical-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e6ed;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.practical-header .header-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.practical-header .logo {
    height: 40px;
}

.practical-header .back-link {
    color: #5a6c7d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.practical-header .back-link:hover {
    color: #191c64;
}

/* Main Content */
.practical-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========================================
   FLOATING NAVIGATION
   ======================================== */

.practical-nav {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 50;
}

.practical-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.practical-nav li {
    margin: 0;
}

.practical-nav a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: #5a6c7d;
    text-decoration: none;
    border-left: 2px solid #e0e6ed;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.practical-nav a:hover {
    color: #191c64;
    border-left-color: #191c64;
    background: #f8f9fa;
}

.practical-nav a.active {
    color: #6d126e;
    border-left-color: #6d126e;
    font-weight: 600;
    background: #faf8fb;
}

/* Level 2 navigation (h3 subsections) */
.practical-nav ul ul,
.practical-nav .nav-subsections {
    margin: 0;
    padding: 0;
    list-style: none;
}

.practical-nav ul ul a,
.practical-nav ul a.nav-subsection {
    padding: 0.35rem 1rem 0.35rem 1.5rem;
    font-size: 0.75rem;
    border-left: 2px solid transparent;
    color: #7a8a9a;
}

.practical-nav ul ul a:hover,
.practical-nav ul a.nav-subsection:hover {
    color: #191c64;
    border-left-color: transparent;
    background: #f8f9fa;
}

.practical-nav ul ul a.active,
.practical-nav ul a.nav-subsection.active {
    color: #6d126e !important;
    border-left-color: #6d126e !important;
    font-weight: 600;
    background: #faf8fb;
}

/* Scrollbar styling for nav */
.practical-nav::-webkit-scrollbar {
    width: 4px;
}

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

.practical-nav::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 2px;
}

.practical-nav::-webkit-scrollbar-thumb:hover {
    background: #5a6c7d;
}

/* Navigation toggle button */
.nav-toggle {
    display: none;
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #191c64;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 60;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.nav-toggle:hover {
    background: #6d126e;
    transform: scale(1.05);
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
}

.nav-toggle .icon-close {
    display: none;
}

.nav-toggle.active .icon-menu {
    display: none;
}

.nav-toggle.active .icon-close {
    display: block;
}

/* Responsive navigation */
@media (max-width: 1600px) {
    .nav-toggle {
        display: flex;
    }

    .practical-nav {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 260px;
        max-height: 100vh;
        height: 100vh;
        background: white;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transform: none;
        padding: 5rem 0 2rem 0;
        transition: left 0.3s ease;
        border-radius: 0;
    }

    .practical-nav.open {
        left: 0;
    }

    .practical-nav ul {
        padding: 0 0.5rem;
    }

    .practical-nav a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .practical-nav ul ul a {
        padding: 0.4rem 1rem 0.4rem 1.75rem;
        font-size: 0.8rem;
    }
}

/* Overlay when nav is open on mobile */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.visible {
    display: block;
    opacity: 1;
}

/* Work Header */
.work-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e6ed;
}

.work-number {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6d126e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.work-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #191c64;
    margin: 0 0 0.75rem 0;
}

.work-subtitle {
    font-size: 1.1rem;
    color: #5a6c7d;
    margin: 0;
}

/* Meta Information */
.work-meta {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

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

.meta-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #5a6c7d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #191c64;
}

/* Sections */
.work-section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.work-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #191c64;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e0e6ed;
}

.work-section p {
    margin: 0 0 1rem 0;
}

.work-section p:last-child {
    margin-bottom: 0;
}

/* Lists */
.work-section ul,
.work-section ol {
    margin: 0;
    padding-left: 1.5rem;
}

.work-section li {
    margin-bottom: 0.5rem;
}

.work-section li:last-child {
    margin-bottom: 0;
}

/* Steps */
.step {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    padding-left: 1.75rem;
    border-left: 4px solid #6d126e;
    background: linear-gradient(to right, rgba(109, 18, 110, 0.03), transparent);
    border-radius: 0 8px 8px 0;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #6d126e, #191c64);
    border-radius: 4px 0 0 4px;
}

.step:last-child {
    margin-bottom: 0;
}

.step + .step {
    margin-top: 2rem;
}

.step h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #191c64;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6d126e;
    border-radius: 50%;
    flex-shrink: 0;
}

.step p {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.step > *:last-child {
    margin-bottom: 0;
}

/* Code Blocks - Same style as slides, uses nord.css for syntax highlighting */
.work-section pre {
    margin: 1.5rem 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: visible;
    position: relative;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.work-section pre code {
    display: block;
    padding: 1rem 1.25rem;
    padding-top: 2.5rem;
    overflow-x: auto;
    font-family: inherit;
}

/* Let highlight.js handle colors via nord.css */
.work-section pre code,
.work-section pre code *,
.work-section pre span {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

/* Scrollbar styling */
.work-section pre code::-webkit-scrollbar {
    height: 8px;
}

.work-section pre code::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.work-section pre code::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.work-section pre code::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Copy Button */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    color: #666;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

.code-copy-btn svg {
    width: 14px;
    height: 14px;
}

.work-section pre:hover .code-copy-btn,
.code-with-legend pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.code-copy-btn.copied {
    background: #50a14f;
    border-color: #50a14f;
    color: white;
}

.code-copy-btn.copied:hover {
    background: #50a14f;
}

/* Callout Markers in Code - same style as slides */
.callout-marker,
.code-callout {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 20px !important;
    height: 20px !important;
    margin: 0 6px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    font-family: 'SF Mono', 'Consolas', monospace !important;
    border-radius: 5px !important;
    vertical-align: middle !important;
    text-align: center !important;
    line-height: 1 !important;
    padding: 0 5px !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.35) !important;
    cursor: help;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.callout-marker:hover,
.code-callout:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 6px rgba(102, 126, 234, 0.5) !important;
}

/* Inline Code */
.work-section code:not([class]) {
    background: #f1f3f4;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #6d126e;
}

/* Tables */
.work-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.work-section th,
.work-section td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e6ed;
}

.work-section th {
    font-weight: 600;
    color: #191c64;
    background: #f8f9fa;
}

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

/* Bonus Section */
.work-section.bonus {
    background: #faf8fb;
    border: 1px dashed #d4c4d9;
}

.work-section.bonus h2 {
    color: #6d126e;
    border-bottom-color: #d4c4d9;
}

/* Notes and Warnings */
.note {
    padding: 1rem 1.25rem;
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.note p {
    margin: 0;
    color: #2c3e50;
}

.warning {
    padding: 1rem 1.25rem;
    background: #fef9e7;
    border-left: 4px solid #f39c12;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.warning p {
    margin: 0;
    color: #2c3e50;
}

/* Mermaid Diagrams */
.mermaid {
    margin: 1.5rem 0;
    text-align: center;
}

.mermaid svg {
    max-width: 100%;
}

/* Footer */
.practical-footer {
    text-align: center;
    padding: 2rem;
    color: #5a6c7d;
    font-size: 0.85rem;
    border-top: 1px solid #e0e6ed;
    margin-top: 2rem;
}

.practical-footer p {
    margin: 0;
}

/* Print Styles */
@media print {
    .practical-header {
        position: relative;
    }

    .work-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e0e6ed;
    }

    .practical-footer {
        display: none;
    }
}

/* ========================================
   CODE CALLOUTS & LEGENDS
   ======================================== */

/* Callout numbers in code - modern pill style */
.code-callout {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin: 0 4px;
    background: #6d126e;
    color: white;
    font-weight: 600;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    border-radius: 50%;
    vertical-align: middle;
    text-align: center;
    line-height: 18px;
}

/* Container for code block + legend side-by-side */
.code-with-legend {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px;
    width: 100% !important;
    align-items: stretch !important;
    margin: 1.5rem 0 !important;
    flex-shrink: 0 !important;
    background: #f8f9fc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

/* Code block takes ~60% of width with scrollbar if needed */
.code-with-legend pre {
    flex: 1 1 60% !important;
    margin: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 60% !important;
    overflow: auto !important;
}

/* Legend takes ~40% of width */
.code-legend {
    flex: 1 1 35% !important;
    max-width: 35% !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
    font-size: 0.88rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Individual legend item */
.code-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.code-legend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.code-legend-item:first-child {
    padding-top: 0;
}

/* Number in legend - same style as callout markers */
.code-legend-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 11px;
    font-family: 'SF Mono', 'Consolas', monospace;
    border-radius: 5px;
    text-align: center;
    flex-shrink: 0;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.35);
}

/* Legend text */
.code-legend-text {
    color: #374151;
    flex: 1;
    line-height: 1.5;
    font-size: 0.9em;
}

/* ========================================
   ADDITIONAL CALLOUTS (Info, Success, Danger)
   ======================================== */

.info {
    padding: 1rem 1.25rem;
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.info p {
    margin: 0;
    color: #2c3e50;
}

.success {
    padding: 1rem 1.25rem;
    background: #e8f8f0;
    border-left: 4px solid #27ae60;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.success p {
    margin: 0;
    color: #2c3e50;
}

.danger {
    padding: 1rem 1.25rem;
    background: #fdedec;
    border-left: 4px solid #e74c3c;
    border-radius: 0 8px 8px 0;
    margin: 1rem 0;
}

.danger p {
    margin: 0;
    color: #2c3e50;
}

/* ========================================
   DEFINITION LISTS
   ======================================== */

.work-section dl {
    margin: 1rem 0;
}

.work-section dt {
    font-weight: 600;
    color: #191c64;
    margin-top: 1rem;
}

.work-section dt:first-child {
    margin-top: 0;
}

.work-section dd {
    margin: 0.25rem 0 0 1.5rem;
    color: #5a6c7d;
}

/* ========================================
   BLOCKQUOTES
   ======================================== */

.work-section blockquote {
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid #191c64;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #5a6c7d;
}

.work-section blockquote p {
    margin: 0;
}

.work-section blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9em;
    font-style: normal;
    color: #191c64;
}

/* ========================================
   KEYBOARD SHORTCUTS
   ======================================== */

kbd {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    color: #2c3e50;
    background: #f8f9fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 #d0d7de;
}

/* ========================================
   BADGES & TAGS
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: #191c64;
    color: white;
}

.badge-secondary {
    background: #6d126e;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

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

.badge-info {
    background: #3498db;
    color: white;
}

/* ========================================
   FILE TREES
   ======================================== */

.file-tree {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.file-tree ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
}

.file-tree > ul {
    padding-left: 0;
}

.file-tree li {
    position: relative;
    margin: 0.25rem 0;
}

.file-tree li::before {
    content: "├── ";
    color: #5a6c7d;
}

.file-tree li:last-child::before {
    content: "└── ";
}

.file-tree .folder {
    color: #191c64;
    font-weight: 600;
}

.file-tree .file {
    color: #2c3e50;
}

/* ========================================
   RESPONSIVE - CODE CALLOUTS
   ======================================== */

@media (max-width: 768px) {
    .code-with-legend {
        flex-direction: column !important;
        gap: 15px;
    }

    .code-with-legend pre {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .code-legend {
        flex: 1 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 0.9em;
    }

    .code-callout {
        font-size: 1.05em;
    }
}

/* ========================================
   FIGURES & ILLUSTRATIONS
   ======================================== */

figure {
    margin: 1.5rem 0;
    padding: 0;
}

/* Visual illustration container */
.visual-illustration {
    background: #f8f9fc;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.visual-illustration-title {
    font-weight: 600;
    color: #191c64;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
}

.visual-illustration-caption {
    font-size: 0.85rem;
    color: #5a6c7d;
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
}

/* Gradient image visualization */
.gradient-image-demo {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    /* Blue increases top to bottom, Green increases left to right */
    background: linear-gradient(to bottom,
        linear-gradient(to right, #000000, #00ff00),
        linear-gradient(to right, #0000ff, #00ffff)
    );
    background:
        linear-gradient(to right, rgba(0, 255, 0, 0), rgba(0, 255, 0, 1)),
        linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 255, 1));
    background-blend-mode: screen;
}

/* MNIST digit grid */
.mnist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 320px;
    margin: 0 auto;
}

.mnist-digit {
    aspect-ratio: 1;
    background: #1a1a2e;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mnist-digit-image {
    width: 80%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 2rem;
    color: #e8e8e8;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    font-weight: normal;
}

.mnist-digit-label {
    font-size: 0.65rem;
    color: #888;
    position: absolute;
    bottom: 2px;
}

/* Bar chart visualization */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 180px;
    padding: 0 1rem;
}

.bar-chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 45px;
}

.bar-chart-bar {
    width: 100%;
    background: linear-gradient(to top, #4a69bd, #6a89cc);
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 20px;
}

.bar-chart-value {
    font-size: 0.6rem;
    color: #5a6c7d;
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.bar-chart-label {
    font-size: 0.75rem;
    color: #2c3e50;
    margin-top: 4px;
    font-weight: 500;
}

/* Bar chart axis */
.bar-chart-container {
    position: relative;
    padding-bottom: 2rem;
}

.bar-chart-axis-label {
    text-align: center;
    font-size: 0.8rem;
    color: #5a6c7d;
    margin-top: 0.5rem;
}

/* Console output simulation */
.console-output {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #d4d4d4;
    line-height: 1.6;
    overflow-x: auto;
}

.console-output .prompt {
    color: #6a9955;
}

.console-output .output {
    color: #dcdcaa;
}

.console-output .value {
    color: #b5cea8;
}

/* Histogram visualization */
.histogram {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 120px;
    gap: 1px;
    padding: 0 0.5rem;
    background: #f8f9fc;
    border-radius: 4px;
}

.histogram-bar {
    flex: 1;
    max-width: 8px;
    background: linear-gradient(to top, #4a69bd, #6a89cc);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
}

.histogram-container {
    margin: 0.5rem 0;
}

.histogram-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #191c64;
    text-align: center;
    margin-bottom: 0.5rem;
}

.histogram-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #5a6c7d;
    padding: 0.25rem 0.5rem 0;
}

.histogram-median {
    position: absolute;
    top: 0;
    bottom: 20px;
    width: 2px;
    background: #e74c3c;
    z-index: 1;
}

/* RGB color bar chart */
.rgb-chart {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 1rem 0;
}

.rgb-chart-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rgb-chart-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.rgb-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 100px;
}

.rgb-bar {
    width: 24px;
    border-radius: 3px 3px 0 0;
    position: relative;
}

.rgb-bar.red { background: linear-gradient(to top, #c0392b, #e74c3c); }
.rgb-bar.green { background: linear-gradient(to top, #27ae60, #2ecc71); }
.rgb-bar.blue { background: linear-gradient(to top, #2980b9, #3498db); }

.rgb-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: #5a6c7d;
    white-space: nowrap;
}

/* Image sample cards */
.image-sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.image-sample-card {
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
}

.image-sample-preview {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #666;
    background: linear-gradient(135deg, #e8ecf4 0%, #d0d7e2 100%);
}

.image-sample-preview.cat {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #6c5ce7;
}

.image-sample-preview.dog {
    background: linear-gradient(135deg, #dfe6e9 0%, #b2bec3 100%);
    color: #d63031;
}

.image-sample-name {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: #5a6c7d;
    background: white;
}

/* Data split visualization */
.data-split-visual {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
    margin: 1rem 0;
}

.data-split-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.data-split-segment.train {
    flex: 70;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.data-split-segment.val {
    flex: 15;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.data-split-segment.test {
    flex: 15;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.data-split-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.data-split-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #2c3e50;
}

.data-split-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.data-split-legend-color.train { background: #27ae60; }
.data-split-legend-color.val { background: #3498db; }
.data-split-legend-color.test { background: #e74c3c; }

/* Augmentation grid visualization */
.augmentation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.augmentation-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.augmentation-cell.original {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 2px solid #2980b9;
}

.augmentation-cell.augmented {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.augmentation-cell-label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    background: rgba(0,0,0,0.4);
    padding: 2px;
}

.augmentation-cell-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

/* Transform effect indicators */
.augmentation-cell.flipped .augmentation-cell-icon { transform: scaleX(-1); }
.augmentation-cell.rotated .augmentation-cell-icon { transform: rotate(15deg); }
.augmentation-cell.bright .augmentation-cell-icon { filter: brightness(1.3); }
.augmentation-cell.dark .augmentation-cell-icon { filter: brightness(0.7); }

/* Before/After comparison */
.before-after-comparison {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.comparison-item {
    text-align: center;
    flex: 1;
    min-width: 120px;
    max-width: 150px;
}

.comparison-image {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.comparison-image.before {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.comparison-image.after {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    color: white;
}

.comparison-image.after.effect-flip {
    transform: scaleX(-1);
}

.comparison-image.after.effect-rotate {
    transform: rotate(12deg);
}

.comparison-image.after.effect-bright {
    filter: brightness(1.4) contrast(1.1);
}

.comparison-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
}

.comparison-arrow {
    font-size: 1.5rem;
    color: #5a6c7d;
    padding: 0 0.5rem;
}

/* Performance/Benchmark chart */
.benchmark-chart {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-end;
    height: 150px;
    padding: 1rem;
}

.benchmark-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.benchmark-bar {
    width: 60px;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
}

.benchmark-bar.train {
    background: linear-gradient(to top, #e67e22, #f39c12);
}

.benchmark-bar.val {
    background: linear-gradient(to top, #27ae60, #2ecc71);
}

.benchmark-label {
    font-size: 0.8rem;
    color: #2c3e50;
    font-weight: 500;
}

/* Tensor shape visualization */
.tensor-shape-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    color: #2c3e50;
    padding: 1rem;
    background: #f8f9fc;
    border-radius: 8px;
    margin: 1rem 0;
}

.tensor-dim {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

.tensor-dim-label {
    font-size: 0.7rem;
    color: #5a6c7d;
    display: block;
    margin-top: 0.25rem;
}

.tensor-sep {
    color: #5a6c7d;
    font-weight: bold;
}

/* Training curves visualization */
.training-curves {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.curve-chart {
    background: #f8f9fc;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.curve-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #191c64;
    text-align: center;
    margin-bottom: 0.5rem;
}

.curve-chart-area {
    position: relative;
    height: 100px;
    border-left: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
    margin-left: 25px;
}

.curve-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.curve-line svg {
    width: 100%;
    height: 100%;
}

.curve-axis-y {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #5a6c7d;
    text-align: right;
    padding-right: 4px;
}

.curve-axis-x {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #5a6c7d;
    margin-left: 25px;
    margin-top: 4px;
}

.curve-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.curve-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.curve-legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.curve-legend-line.train { background: #3498db; }
.curve-legend-line.val { background: #e74c3c; }

/* Confusion matrix visualization */
.confusion-matrix-container {
    overflow-x: auto;
}

.confusion-matrix {
    display: inline-grid;
    gap: 2px;
    font-size: 0.6rem;
}

.confusion-matrix-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-weight: 500;
}

.confusion-matrix-cell.diagonal {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.confusion-matrix-cell.off-diagonal {
    background: #e8ecf4;
    color: #666;
}

.confusion-matrix-cell.off-diagonal.medium {
    background: #ffeaa7;
    color: #2d3436;
}

.confusion-matrix-cell.off-diagonal.high {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.confusion-matrix-cell.header {
    background: transparent;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.55rem;
}

/* CIFAR-10 sample grid */
.cifar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 350px;
    margin: 0 auto;
}

.cifar-sample {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    text-align: center;
    padding: 4px;
}

.cifar-sample.airplane { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.cifar-sample.automobile { background: linear-gradient(135deg, #fd79a8, #e84393); }
.cifar-sample.bird { background: linear-gradient(135deg, #55efc4, #00b894); }
.cifar-sample.cat { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); color: #2d3436; }
.cifar-sample.deer { background: linear-gradient(135deg, #b2bec3, #636e72); }
.cifar-sample.dog { background: linear-gradient(135deg, #fab1a0, #e17055); }
.cifar-sample.frog { background: linear-gradient(135deg, #81ecec, #00cec9); }
.cifar-sample.horse { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.cifar-sample.ship { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.cifar-sample.truck { background: linear-gradient(135deg, #ff7675, #d63031); }

/* Misclassified examples grid */
.misclassified-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

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

.misclassified-image {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
    border: 2px solid #e74c3c;
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
}

.misclassified-labels {
    font-size: 0.6rem;
    line-height: 1.3;
}

.misclassified-true {
    color: #27ae60;
}

.misclassified-pred {
    color: #e74c3c;
}

/* CNN layer visualization */
.cnn-layers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem;
}

.cnn-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.cnn-layer-box {
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 500;
    color: white;
    text-align: center;
}

.cnn-layer-box.input { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.cnn-layer-box.conv { background: linear-gradient(135deg, #3498db, #2980b9); }
.cnn-layer-box.pool { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.cnn-layer-box.dense { background: linear-gradient(135deg, #e67e22, #d35400); }
.cnn-layer-box.output { background: linear-gradient(135deg, #e74c3c, #c0392b); }

.cnn-layer-label {
    font-size: 0.6rem;
    color: #5a6c7d;
}

.cnn-arrow {
    color: #5a6c7d;
    font-size: 1rem;
}

/* Transfer learning visualizations */
.transfer-model {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.transfer-block {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    position: relative;
}

.transfer-block.frozen {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border: 2px dashed rgba(255,255,255,0.5);
}

.transfer-block.frozen::after {
    content: "FROZEN";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    background: #2d3436;
    padding: 1px 4px;
    border-radius: 2px;
}

.transfer-block.trainable {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.transfer-block.pretrained {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
}

.transfer-arrow {
    color: #5a6c7d;
    font-size: 1.2rem;
}

/* Strategy comparison bars */
.strategy-comparison {
    display: flex;
    justify-content: center;
    gap: 2rem;
    align-items: flex-end;
    height: 200px;
    padding: 1rem;
}

.strategy-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.strategy-bar {
    width: 80px;
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.strategy-bar.feature { background: linear-gradient(to top, #e67e22, #f39c12); }
.strategy-bar.finetune { background: linear-gradient(to top, #3498db, #74b9ff); }
.strategy-bar.progressive { background: linear-gradient(to top, #27ae60, #2ecc71); }

.strategy-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.strategy-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.strategy-name {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #5a6c7d;
    text-align: center;
    line-height: 1.3;
}

.strategy-bar-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #2c3e50;
    text-align: center;
    font-weight: 500;
}

.strategy-bar-time {
    font-size: 0.65rem;
    color: #5a6c7d;
}

/* Progressive unfreezing stages */
.unfreezing-stages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.unfreezing-stage {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #f8f9fc;
}

.unfreezing-stage-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.unfreezing-stage-num.s1 { background: linear-gradient(135deg, #e67e22, #f39c12); }
.unfreezing-stage-num.s2 { background: linear-gradient(135deg, #3498db, #74b9ff); }
.unfreezing-stage-num.s3 { background: linear-gradient(135deg, #27ae60, #2ecc71); }

.unfreezing-stage-content {
    flex: 1;
}

.unfreezing-stage-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.unfreezing-stage-details {
    font-size: 0.75rem;
    color: #5a6c7d;
    margin-top: 0.25rem;
}

.unfreezing-stage-layers {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
}

.layer-block {
    height: 8px;
    flex: 1;
    border-radius: 2px;
}

.layer-block.frozen { background: #74b9ff; }
.layer-block.trainable { background: #00b894; }

/* Transfer learning legend */
.transfer-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e6ed;
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.legend-box.frozen {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border: 2px dashed rgba(255,255,255,0.5);
}

.legend-box.trainable {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

/* Stage labels for unfreezing */
.stage-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.stage-info {
    font-size: 0.7rem;
    color: #5a6c7d;
    text-align: center;
    margin-top: 0.5rem;
}

figure img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #5a6c7d;
    text-align: center;
    font-style: italic;
}

/* Expected output visualization placeholder */
.expected-output {
    background: linear-gradient(135deg, #f8f9fc 0%, #e8ecf4 100%);
    border: 2px dashed #c5d0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}

.expected-output-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.expected-output-title {
    font-weight: 600;
    color: #191c64;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.expected-output-description {
    color: #5a6c7d;
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

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

.expected-outputs-grid .expected-output {
    margin: 0;
    padding: 1.5rem;
}

.expected-outputs-grid .expected-output-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.expected-outputs-grid .expected-output-title {
    font-size: 1rem;
}

.expected-outputs-grid .expected-output-description {
    font-size: 0.85rem;
}

/* Illustration with side-by-side layout */
.illustration-row {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.illustration-row > * {
    flex: 1;
    min-width: 250px;
}

/* Architecture diagram style */
.architecture-diagram {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.architecture-diagram-title {
    font-weight: 600;
    color: #191c64;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.architecture-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.architecture-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    min-width: 100px;
}

.architecture-box.input {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.architecture-box.output {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.architecture-box.process {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.architecture-arrow {
    color: #5a6c7d;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Sample images grid */
.sample-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.sample-image-item {
    text-align: center;
}

.sample-image-placeholder {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e8ecf4 0%, #d0d7e2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.sample-image-label {
    font-size: 0.8rem;
    color: #5a6c7d;
    font-weight: 500;
}

/* Chart placeholder */
.chart-placeholder {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chart-placeholder-title {
    font-weight: 600;
    color: #191c64;
    margin-bottom: 0.5rem;
}

.chart-placeholder-description {
    color: #5a6c7d;
    font-size: 0.9rem;
    text-align: center;
}

/* ========================================
   DEPLOYMENT VISUALIZATIONS (Module 6)
   ======================================== */

/* API Response Visual */
.api-response-visual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.api-endpoint-card {
    background: #2d3436;
    border-radius: 8px;
    overflow: hidden;
}

.endpoint-header {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    font-family: monospace;
}

.endpoint-header.get {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.endpoint-header.post {
    background: linear-gradient(135deg, #3498db, #74b9ff);
    color: white;
}

.endpoint-body {
    padding: 1rem;
}

.json-display {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.json-brace {
    color: #dfe6e9;
}

.json-line {
    padding-left: 1rem;
}

.json-key {
    color: #74b9ff;
}

.json-string {
    color: #55efc4;
}

.json-number {
    color: #ffeaa7;
}

.json-bool {
    color: #fd79a8;
}

/* Deployment Flow */
.deployment-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.flow-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flow-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
}

.flow-icon.client { background: linear-gradient(135deg, #636e72, #2d3436); }
.flow-icon.server { background: linear-gradient(135deg, #00b894, #00cec9); }
.flow-icon.router { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.flow-icon.preprocess { background: linear-gradient(135deg, #e17055, #fdcb6e); }
.flow-icon.model { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.flow-icon.response { background: linear-gradient(135deg, #00b894, #55efc4); }

.flow-label {
    font-size: 0.7rem;
    color: #5a6c7d;
    text-align: center;
}

.flow-arrow {
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, #dfe6e9, #b2bec3);
    position: relative;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    border: 4px solid transparent;
    border-left-color: #b2bec3;
}

/* Docker Container Visual */
.docker-container-visual {
    max-width: 400px;
    margin: 0 auto;
    background: #f8f9fc;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #0db7ed;
}

.docker-header {
    background: linear-gradient(135deg, #0db7ed, #384d54);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.docker-icon {
    background: white;
    color: #0db7ed;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.docker-name {
    color: white;
    font-family: monospace;
    font-size: 0.85rem;
}

.docker-layers {
    padding: 0.5rem;
}

.docker-layer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 6px;
    font-size: 0.75rem;
}

.docker-layer.base { background: #e8f4fc; }
.docker-layer.deps { background: #e8fcf4; }
.docker-layer.app { background: #fcf4e8; }
.docker-layer.model { background: #f4e8fc; }

.layer-name {
    font-weight: 600;
    color: #2c3e50;
}

.layer-value {
    color: #5a6c7d;
    font-family: monospace;
    font-size: 0.7rem;
}

.docker-port {
    background: #2c3e50;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.port-label {
    color: #95a5a6;
    font-size: 0.7rem;
}

.port-value {
    color: #2ecc71;
    font-family: monospace;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .practical-content {
        padding: 1rem;
    }

    .work-header h1 {
        font-size: 1.75rem;
    }

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

    .work-section {
        padding: 1.5rem;
    }

    .illustration-row {
        flex-direction: column;
    }

    .expected-outputs-grid {
        grid-template-columns: 1fr;
    }

    .architecture-flow {
        flex-direction: column;
    }

    .architecture-arrow {
        transform: rotate(90deg);
    }
}

/* ========================================
   MERMAID DIAGRAM CONTROLS
   ======================================== */

/* Container for mermaid diagram with controls */
.mermaid-container {
    position: relative;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.mermaid-container .mermaid {
    display: flex;
    justify-content: center;
    overflow: auto;
    max-width: 100%;
}

/* Controls bar */
.mermaid-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mermaid-controls button {
    width: 36px;
    height: 36px;
    border: 1px solid #e0e6ed;
    background: white;
    color: #5b2c6f;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.15s ease;
}

.mermaid-controls button:hover {
    background: #5b2c6f;
    color: white;
    border-color: #5b2c6f;
}

.mermaid-controls button:active {
    transform: scale(0.95);
}

/* Zoom level indicator */
.mermaid-zoom-level {
    font-size: 12px;
    color: #666;
    min-width: 45px;
    text-align: center;
    font-family: 'Fira Code', 'Monaco', monospace;
    background: #f0f0f0;
    padding: 6px 10px;
    border-radius: 4px;
}

/* Fullscreen overlay */
.mermaid-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    animation: mermaidFadeIn 0.2s ease;
}

@keyframes mermaidFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fullscreen diagram container */
.mermaid-fullscreen-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: auto;
}

.mermaid-fullscreen-overlay svg {
    max-width: 95vw;
    max-height: 85vh;
    width: auto;
    height: auto;
}

/* Fullscreen controls */
.mermaid-fullscreen-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10001;
}

.mermaid-fullscreen-controls button {
    width: 44px;
    height: 44px;
    border: none;
    background: #5b2c6f;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(91, 44, 111, 0.3);
}

.mermaid-fullscreen-controls button:hover {
    background: #d35400;
    transform: scale(1.05);
}

/* Fullscreen zoom level */
.mermaid-fullscreen-controls .mermaid-zoom-level {
    background: white;
    color: #333;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 44px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Fullscreen hint */
.mermaid-fullscreen-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10001;
    transition: opacity 0.5s ease;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .mermaid-container {
        padding: 0.75rem;
    }

    .mermaid-controls {
        flex-wrap: wrap;
    }

    .mermaid-fullscreen-overlay {
        padding: 20px;
    }

    .mermaid-fullscreen-controls button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
