/**
 * Slides System Custom CSS - Global Website Customization
 * Personnalisation globale pour toutes les présentations du site
 * Utilise Montserrat et un thème violet/orange avec décorations arc-en-ciel
 */

/* Import de la police Montserrat depuis Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   VARIABLES CSS - THÈME GLOBAL
   ======================================== */

:root {
    /* Couleurs principales */
    --primary-color: #5b2c6f;        /* Violet foncé */
    --secondary-color: #d35400;      /* Orange */
    --tertiary-color: #8e44ad;       /* Magenta/Violet clair */
    --background-color: #ffffff;
    --text-color: #2c3e50;

    /* Theme-specific blur colors */
    --accent-orange: rgba(251, 146, 60, 0.6);
    --accent-amber: rgba(245, 158, 11, 0.6);
    --accent-cyan: rgba(34, 211, 238, 0.6);
    --accent-blue: rgba(59, 130, 246, 0.6);
    --accent-purple: rgba(168, 85, 247, 0.6);
    --accent-rose: rgba(244, 63, 94, 0.6);
    
    /* Couleurs pour les cards */
    --card-blue: #3498db;
    --card-orange: #e67e22;
    --card-purple: #9b59b6;
    --card-green: #27ae60;
    --card-red: #e74c3c;
    
    /* Couleurs des bordures */
    --border-blue: #3498db;
    --border-orange: #f39c12;
    --border-purple: #a569bd;
    
    /* Arrière-plans */
    --card-bg: #ffffff;
    --card-shadow: 0 4px 15px rgba(0,0,0,0.08);
    --notice-bg: #fff9e6;
    --notice-border: #f39c12;
    
    /* Typographie - Montserrat */
    --font-family: 'Montserrat', 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    --font-family-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-size-base: 20px;
    --font-size-h1: 3em;
    --font-size-h2: 2.4em;
    --font-size-h3: 1.9em;
    
    /* Espacements optimisés */
    --spacing-small: 10px;
    --spacing-medium: 20px;
    --spacing-large: 35px;
    
    /* Effets */
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

/* Appliquer Montserrat partout SAUF code */
body, html {
    font-family: var(--font-family);
}

h1, h2, h3, h4, h5, h6,
p, span, div, section,
ul, ol, li,
table, thead, tbody, td, th,
a, button,
.slide, .card, .notice {
    font-family: var(--font-family);
}

/* Code et pre utilisent TOUJOURS une police monospace */
code, pre, pre *, .csv-content, .csv-content * {
    font-family: var(--font-family-mono) !important;
}

/* ========================================
   PERSONNALISATION DES SLIDES
   ======================================== */

.slide {
    background-color: var(--background-color);
    padding: 40px 100px 40px 100px;
    position: relative;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 10px;
}

/* Zone de sécurité pour éviter les décorations */
.slide > * {
    max-width: calc(100% - 40px);
}

/* Contenu texte ne shrink pas, images/tables prennent l'espace restant */
.slide > h1,
.slide > h2,
.slide > h3,
.slide > p,
.slide > ul,
.slide > ol,
.slide > pre,
.slide > .notice {
    flex-shrink: 0;
    flex-grow: 0;
}

/* Images, tables, schémas prennent l'espace disponible */
.slide > .schema,
.slide > img,
.slide > svg,
.slide > iframe,
.slide > table {
    flex: 1 1 auto;
    min-height: 0;
}

/* Décorations arc-en-ciel dans les coins avec deco.png */
.slide::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 180px;
    height: 180px;
    background-image: url('deco.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top left;
    transform: rotate(90deg);
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

.slide::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 180px;
    height: 180px;
    background-image: url('deco.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom right;
    transform: rotate(270deg);
    opacity: 0.6;
    pointer-events: none;
    z-index: -1;
}

/* Assurer que tout le contenu est au-dessus des décorations */
.slide > *,
.slide > *:not(::before):not(::after) {
    position: relative;
    z-index: 10;
}

/* Container global pour éviter overlap */
.presentation-container {
    position: relative;
    z-index: 1;
}

/* ========================================
   TYPOGRAPHIE
   ======================================== */

/* Titres - toujours positionnés en haut avec Montserrat */
.slide h1, .slide h2.with-subtitle {
    font-size: var(--font-size-h1);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: var(--spacing-medium);
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 0;
    width: 100%;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.slide h2 {
    font-size: var(--font-size-h2);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-small);
    margin-top: 0;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

/* Sticky title when scrolling - only for regular slides, not title slides */
.slide:not(.title-slide) h2 {
    position: sticky;
    top: 0;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 20px;
    padding-right: 20px;
    z-index: 100;
    /* Limit to text width */
    width: fit-content;
    max-width: 100%;
}

/* Faded background behind sticky title - doesn't affect text */
.slide:not(.title-slide) h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-color: var(--background-color);
    -webkit-mask-image:
        linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 25%, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%),
        linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 25%, rgba(0,0,0,1) 75%, rgba(0,0,0,0) 100%),
        linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0) 100%);
    mask-composite: intersect;
}

.slide h3 {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-small);
    flex-shrink: 0;
}

.slide p {
    font-size: 1.25em;
    line-height: 1.7;
    margin-bottom: var(--spacing-small);
    color: var(--text-color);
    font-weight: 400;
}

/* Strong et bold */
strong, b {
    font-weight: 700;
    font-size: 1.45em;
}

/* Bold inside list items should inherit list size */
li strong, li b {
    font-size: inherit;
}

/* Italic */
em, i {
    font-weight: 400;
    font-style: italic;
}

/* Sous-titre stylisé */
.slide h2.with-subtitle::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: var(--spacing-small) 0 0 0;
    border-radius: 2px;
}

/* ========================================
   TABLEAUX
   ======================================== */

table {
    border-collapse: collapse;
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-medium);
    font-size: 1.15em;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    overflow: auto;
    width: auto;
    min-width: 50%;
    display: table;
    max-height: 100%;
    flex: 1 1 auto;
}

/* Réaligner les listes, textes et divs à gauche, laisser tables et images centrées */
.slide ul,
.slide ol,
.slide p,
.slide h1,
.slide h2,
.slide h3,
.slide div:not(.schema):not(.side-by-side):not(.code-with-legend),
.slide pre:not(.code-with-legend pre),
.slide .notice,
.slide .card,
.slide .features-grid {
    align-self: flex-start;
    width: 100%;
}

/* Tables et images restent centrées */
.slide table,
.slide .schema,
.slide img:not(.slide-header img),
.slide > svg {
    align-self: center;
}

/* Scrollbars hidden globally - only show for code blocks */

thead {
    background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
    color: white;
}

thead th {
    padding: 20px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 1.15em;
}

tbody tr {
    background: white;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody td {
    padding: 18px;
    color: var(--text-color);
    font-size: 1.05em;
    font-weight: 400;
}

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

/* ========================================
   CODE ET PRE - Laisser highlight.js gérer les styles
   ======================================== */

/* Style minimal pour code inline uniquement */
code:not(pre code) {
    background: #f4f6f7;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-family-mono) !important;
    font-size: 0.9em;
    color: var(--secondary-color);
}

/* Container pre - juste layout, pas de couleurs */
pre {
    padding: 0px;
    border: 1px solid #eee;
    border-radius: 3px;
    overflow: auto;
    margin: var(--spacing-medium) 0;
    font-family: var(--font-family-mono) !important;
    font-size: 1em;
    line-height: 1.4;
    box-shadow: var(--card-shadow);
    flex: 1 1 auto;
    max-height: 100%;
    min-height: 0;
}

/* Laisser highlight.js gérer complètement le code dans pre */
pre code,
pre code *,
pre span,
pre * {
    font-family: var(--font-family-mono) !important;
}

pre code {
    display: block;
}

/* Scrollbar pour pre */
pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

pre::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

/* Copy code button */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, transform 0.1s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: #555;
}

pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: #fff;
    border-color: #bbb;
    transform: scale(1.05);
}

.code-copy-btn:active {
    transform: scale(0.95);
}

.code-copy-btn.copied {
    background: #d4edda;
    border-color: #28a745;
}

.code-copy-btn.copied svg {
    stroke: #28a745;
}

/* ========================================
   LISTES
   ======================================== */

ul, ol {
    margin-left: var(--spacing-large);
    margin-bottom: var(--spacing-small);
    margin-top: var(--spacing-small);
    padding-right: var(--spacing-medium);
    flex: 0 1 auto;
}

li {
    margin-bottom: 12px;
    line-height: 1.7;
    font-size: 1.45em;
    padding-right: var(--spacing-small);
    font-weight: 400;
}

p {
    font-size: 1.35em;
    line-height: 1.7;
    margin-bottom: 12px;
}

ul li::marker {
    color: var(--secondary-color);
    font-size: 1.1em;
}

/* Listes imbriquées légèrement plus petites */
li ul li, li ol li {
    font-size: 0.92em;
    margin-bottom: 8px;
}

/* Listes compactes pour slides avec beaucoup de contenu */
.slide.compact ul, .slide.compact ol {
    margin-bottom: var(--spacing-small);
}

.slide.compact li {
    margin-bottom: 6px;
    font-size: 1.05em;
    line-height: 1.5;
}

/* ========================================
   NOTICES / ALERTES
   ======================================== */

.notice {
    background: var(--notice-bg);
    border-left: 4px solid var(--notice-border);
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.95em;
    line-height: 1.45;
    flex: 0 1 auto;
}

.notice strong {
    color: var(--secondary-color);
    font-size: 0.95em;
}

.notice ul,
.notice ol {
    margin: 8px 0;
    padding-left: 1.5em;
}

.notice li {
    margin-bottom: 4px;
}

/* Supprimer les espaces vides inutiles */
.slide br {
    display: none;
}

/* ========================================
   CARTES (3 COLONNES)
   ======================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-large);
    width: 100%;
    margin-top: var(--spacing-large);
    padding: var(--spacing-medium);
}

.card, .feature-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: var(--spacing-large);
    border: 3px solid transparent;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
}

/* Bordures colorées pour les cartes */
.card:nth-child(1), .feature-item:nth-child(1) {
    border-color: var(--border-blue);
}

.card:nth-child(2), .feature-item:nth-child(2) {
    border-color: var(--border-orange);
}

.card:nth-child(3), .feature-item:nth-child(3) {
    border-color: var(--border-purple);
}

.card:nth-child(4) {
    border-color: var(--card-green);
}

.card:nth-child(5) {
    border-color: var(--card-red);
}

.card:nth-child(6) {
    border-color: var(--border-blue);
}

.card:hover, .feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Titres dans les cartes avec couleurs correspondantes */
.card:nth-child(1) h3, .feature-item:nth-child(1) h3 {
    color: var(--card-blue);
}

.card:nth-child(2) h3, .feature-item:nth-child(2) h3 {
    color: var(--secondary-color);
}

.card:nth-child(3) h3, .feature-item:nth-child(3) h3 {
    color: var(--tertiary-color);
}

/* ========================================
   SCHÉMAS ET SVG
   ======================================== */

.schema {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-medium) auto;
    width: 100%;
    overflow: visible;
    flex: 1 1 auto;
    min-height: 0;
}

.schema svg, .schema img {
    width: auto;
    height: 100%;
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
    flex: 1 1 auto;
}

.schema cite {
    margin-top: var(--spacing-small);
    font-size: 0.9em;
    color: #7f8c8d;
    font-style: italic;
}

/* SVG directement dans les slides */
.slide > svg {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 100%;
    margin: var(--spacing-medium) auto;
    display: block;
    flex: 1 1 auto;
    object-fit: contain;
}

/* Images centrées - prennent l'espace disponible */
.slide img:not(.slide-header img) {
    display: block;
    margin: var(--spacing-medium) auto;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
    flex: 1 1 auto;
}

/* Iframes dans les slides - prennent l'espace restant */
.slide iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--border-radius);
    margin: var(--spacing-medium) 0;
    flex: 1 1 auto;
}

/* ========================================
   CSV CONTENT
   ======================================== */

.csv-content {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: var(--spacing-medium);
    font-family: var(--font-family-mono) !important;
    font-size: 0.95em;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    margin: var(--spacing-medium) 0;
    white-space: pre;
}

/* Tous les enfants de csv-content en monospace */
.csv-content * {
    font-family: var(--font-family-mono) !important;
}

.csv-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.csv-content::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

.csv-content::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.csv-content::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ========================================
   CITATION
   ======================================== */

cite {
    display: block;
    margin-top: var(--spacing-small);
    font-size: 0.9em;
    color: #95a5a6;
    font-style: italic;
}

cite a {
    color: var(--secondary-color);
    text-decoration: none;
}

cite a:hover {
    text-decoration: underline;
}

/* ========================================
   SIDE BY SIDE
   ======================================== */

.side-by-side-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2%;
    width: 100%;
    align-self: flex-start;
    flex-shrink: 0;
    flex-grow: 0;
}

.side-by-side {
    display: block;
    width: 48%;
    flex-shrink: 0;
    flex-grow: 0;
}

.side-by-side:last-child {
    margin-right: 0;
}

/* Pre blocks inside side-by-side can grow to use available space */
.side-by-side pre {
    flex: 1 1 auto;
    max-height: 100%;
    min-height: 0;
    margin: 10px 0;
}

/* ========================================
   CLASSES UTILITAIRES
   ======================================== */

.longtext {
    font-size: 1em;
    max-width: 1000px;
    margin: 0 auto;
    line-height: 1.8;
}

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

.slide.full-height {
    justify-content: flex-start;
    padding-top: 40px;
}

body {
    font-size: var(--font-size-base);
}

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

@media screen and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-medium);
    }

    .slide {
        padding: 40px 70px;
        overflow-x: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    li {
        font-size: 1.2em;
    }
    
    table {
        width: auto;
        min-width: 400px;
        display: table;
    }
    
    /* Décorations plus petites en tablet */
    .slide::before,
    .slide::after {
        width: 140px;
        height: 140px;
        opacity: 0.5;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --font-size-h1: 2.2em;
        --font-size-h2: 1.8em;
        --font-size-h3: 1.5em;
        --spacing-large: 25px;
        --font-size-base: 18px;
    }

    .slide {
        padding: 70px 25px 50px 25px;
        min-height: 100vh;
        height: auto;
        position: relative;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        opacity: 1 !important;
        overflow-x: auto;
        overflow-y: visible;
        /* Hide scrollbars */
        scrollbar-width: none;
        -ms-overflow-style: none;
        /* Ensure white background covers previous slide */
        background-color: #ffffff;
        /* Contain paint to prevent visual bleeding between slides */
        contain: paint;
    }

    .slide::-webkit-scrollbar {
        display: none;
    }

    /* Add extra spacing to first element to prevent title overlap */
    .slide > h1:first-child,
    .slide > h2:first-child {
        margin-top: 0;
        padding-top: 10px;
    }

    /* Cacher complètement les décorations en mobile */
    .slide::before,
    .slide::after {
        display: none;
    }
    
    /* Full width content on mobile */
    .slide > * {
        max-width: 100%;
        /* Reset z-index since decorations are hidden on mobile */
        z-index: auto;
    }

    /* Mobile-friendly tables with horizontal scroll */
    .slide {
        overflow-x: auto;
    }

    table {
        font-size: 0.85em;
        width: 100%;
        min-width: 0;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    thead, tbody, tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    thead th {
        padding: 10px 8px;
        font-size: 0.95em;
        word-wrap: break-word;
    }

    tbody td {
        padding: 8px;
        font-size: 0.9em;
        word-wrap: break-word;
    }

    pre {
        font-size: 0.9em;
        padding: 0;
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }

    /* Notice/tip titles smaller on mobile */
    .notice strong {
        font-size: 0.9em;
    }
    
    /* Forcer monospace en mobile aussi */
    pre, pre *, code, code * {
        font-family: var(--font-family-mono) !important;
    }

    li {
        font-size: 1.15em;
        margin-bottom: 12px;
    }

    .side-by-side-wrapper {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .side-by-side {
        display: block !important;
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 15px;
    }

    /* Stack any inline flex containers on mobile */
    .slide > div[style*="display: flex"],
    .slide > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .slide > div[style*="display: flex"] > div[style*="flex"],
    .slide > div[style*="display:flex"] > div[style*="flex"] {
        width: 100% !important;
        flex: none !important;
    }

    .schema img, .schema svg {
        width: auto;
        height: auto;
    }
    
    .slide iframe {
        height: 400px;
        width: 100%;
    }
    
    /* Images en mobile */
    .slide img:not(.slide-header img) {
        max-width: 100%;
        width: auto;
    }
    
    /* Disable sticky headers on mobile */
    .slide:not(.title-slide) h2 {
        position: static;
        padding-left: 0;
        padding-right: 0;
    }

    .slide:not(.title-slide) h2::before {
        display: none;
    }

    /* Réaligner les textes à gauche en mobile */
    .slide ul,
    .slide ol,
    .slide p,
    .slide h1,
    .slide h2,
    .slide h3,
    .slide pre:not(.code-with-legend pre),
    .slide .notice {
        align-self: flex-start;
        width: 100%;
    }
    
    /* Tables et images centrées en mobile */
    .slide table,
    .slide .schema,
    .slide img:not(.slide-header img) {
        align-self: center;
    }
}

/* ========================================
   TITLE SLIDE WITH ANIMATED BACKGROUND
   ======================================== */

/* Title slide custom layout avec logo à droite - 66/33 split */
body .title-slide.slide.active,
.slide.title-slide-with-bg {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100vh !important;
    position: relative !important;
    overflow: hidden !important;
    background: #fafbfc !important;
}

/* Energy canvas for animated flowing strings */
.energy-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    min-width: 100vw !important;
    z-index: 0;
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Ensure no scrollbar causes gap */
.title-slide-with-bg {
    overflow: hidden;
}

/* Title layout - flexbox with content left, logo right */
.title-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2em;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    position: relative;
    z-index: 10;
}

.title-content,
.title-logo-right {
    position: relative;
    z-index: 100;
}

.glow-letter,
.glow-word {
    position: relative;
    z-index: 101;
}

/* Title content - takes ~66% of space */
.title-content {
    flex: 0 0 66%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Hide main title on animated title slides */
.title-slide-with-bg .main-title {
    display: none;
}

/* Subtitle styling for animated background */
.title-slide-with-bg .subtitle {
    color: #6d126e;
    font-size: 3.8em;
    font-weight: 700;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 1),
        0 0 20px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(255, 255, 255, 0.7);
}

/* Description styling for animated background */
.title-slide-with-bg .lecture-descrription {
    color: #5a6c7d;
    font-size: 2em;
    font-weight: 500;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 1),
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 25px rgba(255, 255, 255, 0.7);
}

/* Letter glow effect - word and character wrappers */
.title-slide-with-bg .subtitle,
.title-slide-with-bg .lecture-descrription {
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    -webkit-hyphens: none !important;
    word-wrap: normal !important;
}

.glow-word {
    display: inline-block;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.glow-letter {
    display: inline;
    transition: color 0.1s ease-out;
    white-space: nowrap;
}

/* Title logo - takes ~33% of space, right side */
.title-logo-right {
    flex: 0 0 33%;
    display: flex;
    align-items: center;
    justify-content: center;
}

body .title-logo-right .way-up-logo {
    height: auto;
    max-height: 10em;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: none;
}

/* Title footer with CC license */
.title-footer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 1.875em;
    border-top: 1px solid rgba(255,255,255,0.3);
    width: 100%;
}

.title-footer .cc-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-footer .cc-logo {
    height: 31px;
    width: auto;
}

.title-footer .cc-text {
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

.title-footer .cc-text p {
    margin: 0;
    font-size: 1em;
}

.title-footer .cc-text a {
    color: var(--secondary-color);
    text-decoration: none;
}

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

.title-footer .copyright {
    font-size: 0.9em;
    color: #888;
}

/* Footer positioning on animated background - centered */
body .slide.title-slide-with-bg .title-footer,
.title-slide-with-bg .title-footer {
    position: absolute !important;
    bottom: 1.5em !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: none !important;
    z-index: 20 !important;
    border-top: none !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
}

.title-slide-with-bg .title-footer .cc-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.title-slide-with-bg .title-footer .cc-logo {
    height: 24px;
    width: auto;
    opacity: 0.9;
}

.title-slide-with-bg .title-footer .copyright,
.title-slide-with-bg .title-footer .cc-license {
    color: #191c64;
    font-size: 0.85em;
    text-shadow:
        0 0 8px rgba(250, 251, 252, 0.9),
        0 0 15px rgba(250, 251, 252, 0.8),
        0 0 25px rgba(250, 251, 252, 0.7);
}

.title-slide-with-bg .title-footer .copyright a,
.title-slide-with-bg .title-footer .cc-license a {
    color: #191c64;
    text-decoration: none;
}

.title-slide-with-bg .title-footer .copyright a:hover,
.title-slide-with-bg .title-footer .cc-license a:hover {
    text-decoration: underline;
}

/* Dual logos layout */
.title-logos-dual {
    flex-direction: column;
    gap: 1em;
}

.logo-separator {
    font-size: 1.5em;
    color: rgba(109, 18, 110, 0.5);
    font-weight: 300;
}

.partner-title-logo {
    max-height: 10em;
    height: auto;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

body .title-logo-right .partner-title-logo {
    max-height: 10em;
}

/* Mobile responsive for animated title slide */
@media (max-width: 768px) {
    .title-slide-with-bg .subtitle {
        font-size: 1.8em !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    .title-slide-with-bg .lecture-descrription {
        font-size: 1.3em !important;
    }

    body .title-slide-with-bg {
        background: #fafbfc !important;
    }

    body .title-layout {
        flex-direction: column;
        text-align: center;
        justify-content: flex-start;
        padding-top: 1em;
    }

    body .title-content {
        align-items: center;
        order: 1;
        flex: 1;
        justify-content: flex-start;
        padding-top: 1.5em;
        background: transparent;
        padding: 1.5em 1.5em;
        border-radius: 1em;
        margin: 0 0.5em;
    }

    body .title-logo-right {
        padding: 1em 1.5em;
        order: 2;
        flex: 0 0 auto;
    }

    body .title-slide-with-bg .title-footer,
    body .slide.title-slide-with-bg .title-footer {
        position: absolute !important;
        bottom: 0.8em !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        border-top: none !important;
        background: transparent !important;
        z-index: 20 !important;
        width: auto !important;
    }

    body .title-slide-with-bg .title-footer .cc-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    body .title-slide-with-bg .title-footer .cc-logo {
        height: 20px;
    }

    body .title-slide-with-bg .title-footer .cc-text,
    body .title-slide-with-bg .title-footer .cc-license {
        font-size: 0.7em;
        color: #191c64;
    }

    body .title-slide-with-bg .title-footer .cc-license a {
        color: #191c64;
    }

    body .title-slide-with-bg .title-footer .copyright,
    body .title-slide-with-bg .title-footer .copyright a {
        color: #191c64;
        font-size: 0.75em;
    }

    body .title-logo-right .way-up-logo {
        max-height: 4em;
    }

    .title-logos-dual {
        flex-direction: row;
        align-items: center;
        gap: 0.8em;
    }

    .title-logos-dual .way-up-logo {
        max-height: 3.5em !important;
    }

    .title-logos-dual .partner-title-logo {
        max-height: 3.5em !important;
    }

    .logo-separator {
        font-size: 1em;
    }

    /* Title slide full viewport on mobile */
    body .presentation-container .slide.title-slide {
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        padding-bottom: 3em; /* Space for footer */
        box-sizing: border-box;
    }
}

/* Print styles for animated title */
@media print {
    .title-slide-with-bg {
        background: #fafbfc !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .energy-canvas {
        display: none !important;
    }
}

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

/* Callout numbers in code - modern badge style */
.code-callout,
pre .code-callout,
pre code .code-callout,
code .code-callout,
.hljs .code-callout,
.hljs span.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;
    -webkit-text-fill-color: #fff !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    font-family: 'SF Mono', 'Fira Code', '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;
    opacity: 1 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

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

/* Container for code block + legend side-by-side */
.code-with-legend {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px;
    width: 100% !important;
    align-items: flex-start !important;
    margin: var(--spacing-medium) 0 !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
}

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

/* Legend takes ~40% of width */
.code-legend {
    flex: 1 1 35% !important;
    max-width: 38%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0 !important;
    font-family: var(--font-family);
    font-size: 0.9em;
    align-self: flex-start;
}

/* Individual legend items */
.code-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Badge number in legend - matches code callout style */
.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', 'Fira Code', 'Consolas', monospace;
    border-radius: 5px;
    text-align: center;
    line-height: 1;
    padding: 0 5px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.35);
}

/* Legend text */
.code-legend-text {
    color: var(--text-color);
    font-weight: 400;
    flex: 1;
    line-height: 1.5;
}

/* Ensure container aligns properly in slides */
.slide .code-with-legend {
    align-self: flex-start;
    width: 100%;
}

/* Mobile responsive adjustments - stack vertically */
@media screen and (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;
        padding: 0;
    }

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

/* ========================================
   MERMAID DIAGRAMS
   ======================================== */

/* Base mermaid diagram styling */
.mermaid {
    display: block;
    width: 100%;
    text-align: center;
}

/* Wrapper classes for mermaid diagrams - applied on parent div */
.diagram-small {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -20%;
}

.diagram-medium {
    transform: scale(0.7);
    transform-origin: top center;
    margin-bottom: -10%;
}

.diagram-large {
    transform: scale(0.9);
    transform-origin: top center;
    margin-bottom: -5%;
}

/* Mermaid container wrapper */
.mermaid-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: 200px;
    margin: var(--spacing-medium) 0;
}

/* Mermaid diagram - no scrollbars, centered */
pre.mermaid {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

/* Mermaid SVG styling */
pre.mermaid svg {
    max-width: 100%;
    max-height: 100%;
    height: auto !important;
    overflow: visible;
}

/* Mermaid controls toolbar */
.mermaid-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mermaid-container:hover .mermaid-controls {
    opacity: 1;
}

/* Control buttons */
.mermaid-controls button {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-color);
    transition: all 0.15s ease;
    padding: 0;
}

.mermaid-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

/* Zoom level indicator */
.mermaid-zoom-level {
    font-size: 11px;
    color: #666;
    min-width: 40px;
    text-align: center;
    line-height: 32px;
    font-family: var(--font-family-mono);
}

/* 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 */
.mermaid-fullscreen-overlay .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: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(91, 44, 111, 0.3);
}

.mermaid-fullscreen-controls button:hover {
    background: var(--tertiary-color);
    transform: scale(1.05);
}

/* Fullscreen zoom level */
.mermaid-fullscreen-controls .mermaid-zoom-level {
    background: white;
    color: var(--text-color);
    border-radius: 8px;
    padding: 0 12px;
    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;
}

/* Mobile adjustments for mermaid */
@media screen and (max-width: 768px) {
    .mermaid-controls {
        opacity: 1;
        position: relative;
        margin-bottom: 10px;
    }

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

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

/* ========================================
   CODE TYPING EFFECT
   ======================================== */

/* Typing cursor */
.typing-cursor {
    display: inline;
    color: var(--secondary-color);
    font-weight: 400;
    animation: cursorBlink 0.7s infinite;
    margin-left: 1px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Ensure code block doesn't jump during typing */
pre code {
    display: block;
    min-height: 1em;
}

/* ========================================
   VISUAL ILLUSTRATIONS FOR SLIDES
   ======================================== */

/* Container for visual illustrations in slides */
.slide-illustration {
    background: #f8f9fc;
    border: 1px solid #e0e6ed;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
    text-align: center;
}

.slide-illustration-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.slide-illustration-caption {
    font-size: 0.7rem;
    color: #5a6c7d;
    margin-top: 0.5rem;
    font-style: italic;
}

/* MNIST Grid for slides */
.slide-mnist-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 350px;
    margin: 0 auto;
}

.slide-mnist-digit {
    background: #1a1a2e;
    border-radius: 6px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slide-mnist-digit-image {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2d2d44, #1a1a2e);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e0e0e0;
    font-family: var(--font-family-mono);
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.slide-mnist-label {
    font-size: 0.55rem;
    color: #8a9bae;
    margin-top: 4px;
}

/* Console output visualization for slides */
.slide-console {
    background: #1e1e2e;
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-family-mono);
    font-size: 0.75rem;
    color: #cdd6f4;
    text-align: left;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

.slide-console .value {
    color: #89dceb;
    font-weight: 600;
}

.slide-console .comment {
    color: #6c7086;
}

/* Gradient image demo for slides */
.slide-gradient-demo {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 8px;
    background: linear-gradient(to bottom,
        rgb(0, 0, 0) 0%,
        rgb(0, 128, 128) 50%,
        rgb(0, 255, 255) 100%
    );
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image tensor visual */
.slide-tensor-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.slide-tensor-dim {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.slide-tensor-box {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

.slide-tensor-box.height { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.slide-tensor-box.width { background: linear-gradient(135deg, #3498db, #2980b9); }
.slide-tensor-box.channels { background: linear-gradient(135deg, #27ae60, #1e8449); }

.slide-tensor-label {
    font-size: 0.65rem;
    color: #5a6c7d;
    font-weight: 600;
}

.slide-tensor-multiply {
    font-size: 1.2rem;
    color: #5a6c7d;
    font-weight: 300;
}

/* Bar chart for slides (class distribution) */
.slide-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 100px;
    padding: 0.5rem;
}

.slide-bar {
    width: 24px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(to top, var(--primary-color), var(--tertiary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.slide-bar-label {
    position: absolute;
    bottom: -18px;
    font-size: 0.6rem;
    color: #5a6c7d;
    font-weight: 600;
}

/* Image representation visual (pixel grid) */
.slide-pixel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    max-width: 80px;
    margin: 0 auto;
    background: #2c3e50;
    padding: 4px;
    border-radius: 4px;
}

.slide-pixel {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    font-size: 0.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CV Tasks visual comparison */
.slide-cv-task-visual {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.slide-task-example {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fc;
    border-radius: 8px;
    min-width: 100px;
}

.slide-task-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-task-icon.classification {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.slide-task-icon.detection {
    background: linear-gradient(135deg, #e67e22, #d35400);
    position: relative;
}

.slide-task-icon.detection::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px dashed white;
    border-radius: 4px;
}

.slide-task-icon.segmentation {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    overflow: hidden;
}

.slide-task-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ========================================
   AI/ML/DL/CV HIERARCHY VISUAL (Nested Diagram)
   ======================================== */

.ai-nested-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.ai-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 50%;
    padding-top: 8px;
    position: relative;
}

.ai-ring-label {
    font-weight: 700;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.ai-ring-desc {
    font-size: 0.5rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 4px;
}

/* Outer AI ring */
.ai-outer {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
}

/* ML ring */
.ml-ring {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 16px rgba(17, 153, 142, 0.3);
}

/* DL ring */
.dl-ring {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

/* CV core */
.ai-core {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 16px rgba(79, 172, 254, 0.5);
}

.ai-core-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.ai-core-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Legacy flat hierarchy (kept for compatibility) */
.ai-hierarchy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
}

.ai-hierarchy-level {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-hierarchy-level.ai {
    background: linear-gradient(135deg, #667eea, #764ba2);
    width: 220px;
    justify-content: center;
}

.ai-hierarchy-level.ml {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    width: 190px;
    justify-content: center;
}

.ai-hierarchy-level.dl {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    width: 160px;
    justify-content: center;
}

.ai-hierarchy-level.cv {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    width: 130px;
    justify-content: center;
}

.ai-hierarchy-arrow {
    color: #b0b0b0;
    font-size: 1rem;
}

/* ========================================
   CV TASKS VISUAL (Classification/Detection/Segmentation)
   ======================================== */

.cv-tasks-visual {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
}

.cv-task-card {
    text-align: center;
    padding: 1rem;
    background: #f8f9fc;
    border-radius: 12px;
    min-width: 120px;
    border: 1px solid #e0e6ed;
}

.cv-task-demo {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* Classification demo - single label */
.cv-task-demo.classification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-task-demo.classification::after {
    content: 'CAT';
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Detection demo - bounding boxes */
.cv-task-demo.detection {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
}

.cv-task-demo.detection::before,
.cv-task-demo.detection::after {
    content: '';
    position: absolute;
    border: 2px solid white;
    border-radius: 3px;
}

.cv-task-demo.detection::before {
    width: 35px;
    height: 45px;
    top: 10px;
    left: 8px;
}

.cv-task-demo.detection::after {
    width: 25px;
    height: 30px;
    bottom: 12px;
    right: 10px;
}

/* Segmentation demo - pixel regions */
.cv-task-demo.segmentation {
    background: #2c3e50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 1px;
    padding: 4px;
}

.seg-pixel {
    border-radius: 2px;
}

.seg-pixel.sky { background: #74b9ff; }
.seg-pixel.tree { background: #00b894; }
.seg-pixel.road { background: #636e72; }
.seg-pixel.car { background: #e17055; }

.cv-task-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.cv-task-output {
    font-size: 0.65rem;
    color: #5a6c7d;
}

/* ========================================
   SEGMENTATION TYPES VISUAL
   ======================================== */

.segmentation-types {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
}

.seg-type-card {
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fc;
    border-radius: 10px;
    min-width: 100px;
}

.seg-type-demo {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.5rem;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 1px;
    padding: 3px;
    background: #2c3e50;
}

.seg-type-label {
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-color);
}

/* Segmentation pixel colors */
.seg-px {
    border-radius: 2px;
}
.seg-px.sky { background: #74b9ff; }
.seg-px.tree { background: #00b894; }
.seg-px.road { background: #636e72; }
.seg-px.car { background: #e17055; }
.seg-px.bg { background: #dfe6e9; }
.seg-px.car1 { background: #e17055; }
.seg-px.car2 { background: #d63031; }

/* ========================================
   BACKGROUND BLUR EFFECTS FOR PRESENTATIONS
   ======================================== */

.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.bg-gradient-blur {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatBlur 20s ease-in-out infinite;
}

@keyframes floatBlur {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-15px, 15px) scale(0.95); }
    75% { transform: translate(-20px, -10px) scale(1.02); }
}

/* Theme-specific blur lights */
.bg-gradient-blur.orange {
    width: 500px;
    height: 500px;
    background: var(--accent-orange);
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.bg-gradient-blur.amber {
    width: 450px;
    height: 450px;
    background: var(--accent-amber);
    bottom: 20%;
    right: 15%;
    opacity: 0.35;
    animation-delay: -3s;
}

.bg-gradient-blur.cyan {
    width: 550px;
    height: 550px;
    background: var(--accent-cyan);
    top: 20%;
    right: 10%;
    opacity: 0.45;
    animation-delay: -1s;
}

.bg-gradient-blur.blue {
    width: 480px;
    height: 480px;
    background: var(--accent-blue);
    bottom: 25%;
    left: 20%;
    opacity: 0.4;
    animation-delay: -5s;
}

.bg-gradient-blur.purple {
    width: 520px;
    height: 520px;
    background: var(--accent-purple);
    top: 40%;
    left: 50%;
    opacity: 0.3;
    animation-delay: -7s;
}

.bg-gradient-blur.rose {
    width: 550px;
    height: 550px;
    background: var(--accent-rose);
    top: 10%;
    left: 15%;
    opacity: 0.4;
    animation-delay: -2s;
}
