/* =====================================
   TS-RaMIA AAAI Slides Stylesheet
   Moderately sized fonts for readability
   4 layout templates
   ===================================== */

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --slide-bg: #FFFFFF;
    --slide-text: #212529;
    --slide-accent: #DE8F05;
    --slide-primary: #0173B2;
    --slide-success: #029E73;
    --slide-purple: #9B59B6;
    --slide-red: #D55E00;
    --slide-muted: #6C757D;
    --slide-border: #DEE2E6;
    --slide-light-bg: #F8F9FA;
    
    /* Typography - Moderately larger than original */
    --font-size-title: clamp(44px, 4vw, 56px);
    --font-size-subtitle: clamp(28px, 2.5vw, 36px);
    --font-size-body: clamp(24px, 2vw, 30px);
    --font-size-caption: clamp(16px, 1.5vw, 22px);
    --font-size-tiny: clamp(12px, 1vw, 16px);
    
    --font-primary: 'Inter', -apple-system, sans-serif;
    
    /* Spacing */
    --slide-padding: 3.5rem;
    
    /* Transitions */
    --transition-slide: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-primary);
    background: #1a1a1a;
    color: var(--slide-text);
    overflow: hidden;
}

/* ========== Slide Container ========== */
#slide-deck {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.slide-container {
    width: 90vw;
    height: 90vh;
    max-width: 1600px;
    max-height: 900px;
    aspect-ratio: 16 / 9;
    background: var(--slide-bg);
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* ========== Individual Slides ========== */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: var(--slide-padding);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity var(--transition-slide), transform var(--transition-slide);
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 10;
}

.slide.prev {
    opacity: 0;
    transform: translateX(-100px);
}

/* ========== HUD (Heads-Up Display) ========== */
.slide-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem var(--slide-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-tiny);
    color: var(--slide-muted);
    z-index: 20;
}

.hud-brand {
    font-weight: 600;
}

.hud-page {
    font-weight: 500;
}

/* ========== Progress Bar ========== */
#progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    background: var(--slide-accent);
    transition: width 0.3s ease;
    z-index: 100;
}

/* ========== Layout Templates ========== */

/* Layout A: Split (Left 42% text / Right 58% visual) */
.slide.layout-split .slide-content {
    display: grid;
    grid-template-columns: 42fr 58fr;
    gap: 3rem;
    flex: 1;
}

.slide.layout-split .content-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide.layout-split .content-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Layout B: Split Reverse (Left 58% visual / Right 42% text) */
.slide.layout-split-reverse .slide-content {
    display: grid;
    grid-template-columns: 58fr 42fr;
    gap: 3rem;
    flex: 1;
}

.slide.layout-split-reverse .content-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.layout-split-reverse .content-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Layout C: Center (Centered title + big visual + small bullets) */
.slide.layout-center .slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

/* Layout D: 2-row (Top text row / Bottom wide visual row) */
.slide.layout-2row .slide-content {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    flex: 1;
}

.slide.layout-2row .content-top {
    display: flex;
    flex-direction: column;
}

.slide.layout-2row .content-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Typography ========== */
.slide-title {
    font-size: var(--font-size-title);
    font-weight: 700;
    color: var(--slide-primary);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.slide-subtitle {
    font-size: var(--font-size-subtitle);
    font-weight: 400;
    color: var(--slide-muted);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.slide-bullets {
    list-style: none;
    margin: 1.5rem 0;
}

.slide-bullets li {
    font-size: var(--font-size-body);
    margin-bottom: 1.2rem;
    padding-left: 2.5rem;
    position: relative;
    line-height: 1.4;
    opacity: 0;
    animation: fadeInLeft 0.5s ease forwards;
}

.slide-bullets li:nth-child(1) { animation-delay: 0.1s; }
.slide-bullets li:nth-child(2) { animation-delay: 0.2s; }
.slide-bullets li:nth-child(3) { animation-delay: 0.3s; }
.slide-bullets li:nth-child(4) { animation-delay: 0.4s; }

.slide-bullets li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--slide-accent);
    font-weight: 700;
    font-size: 2rem;
    top: -2px;
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
    from {
        transform: translateX(-20px);
    }
}

/* ========== Callouts ========== */
.slide-callouts {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.callout-chip {
    padding: 0.6rem 1.5rem;
    background: var(--slide-accent);
    color: white;
    border-radius: 20px;
    font-size: var(--font-size-caption);
    font-weight: 600;
}

/* Position callouts based on layout */
.slide.layout-center .slide-callouts {
    justify-content: center;
}

/* ========== Visual Container ========== */
.slide-visual {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-visual svg {
    max-width: 100%;
    max-height: 100%;
}

/* ========== Title Slide Variant ========== */
.slide.slide-title .slide-title {
    font-size: clamp(52px, 5vw, 64px);
    margin-bottom: 1rem;
}

.slide.slide-title .slide-subtitle {
    font-size: clamp(32px, 3vw, 40px);
    margin-bottom: 2.5rem;
}

.slide.slide-title .slide-bullets li {
    font-size: clamp(20px, 1.8vw, 26px);
    text-align: center;
    padding-left: 0;
    color: var(--slide-muted);
}

.slide.slide-title .slide-bullets li::before {
    display: none;
}

/* ========== TOC Overlay ========== */
#toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#toc-overlay.active {
    display: flex;
}

.toc-content {
    max-width: 1400px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
}

.toc-header {
    color: white;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

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

.toc-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.toc-item:hover {
    background: rgba(222, 143, 5, 0.3);
    border-color: var(--slide-accent);
    transform: translateY(-4px);
}

.toc-item.current {
    border-color: var(--slide-primary);
    background: rgba(1, 115, 178, 0.3);
}

.toc-item-number {
    font-size: 1rem;
    color: var(--slide-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.toc-item-title {
    font-size: 1.3rem;
    color: white;
    font-weight: 500;
    line-height: 1.3;
}

.toc-close-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2rem;
    font-size: 1rem;
}

/* ========== Speaker Notes Panel ========== */
#notes-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 2.5rem;
    z-index: 900;
    overflow-y: auto;
    transition: right 0.4s ease;
    border-left: 4px solid var(--slide-accent);
}

#notes-panel.active {
    right: 0;
}

.notes-header {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--slide-accent);
}

.notes-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.notes-close-hint {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== Fullscreen Mode ========== */
body.fullscreen .slide-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* ========== Keyboard Shortcuts Indicator ========== */
#shortcuts-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 0.95rem;
    z-index: 800;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#shortcuts-hint.show {
    opacity: 1;
}

#shortcuts-hint kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.7rem;
    border-radius: 5px;
    font-family: monospace;
    margin: 0 0.4rem;
    font-size: 0.9rem;
}

/* ========== Next Hint Arrow ========== */
.next-hint {
    position: absolute;
    bottom: 2rem;
    right: 3rem;
    font-size: 2.5rem;
    color: var(--slide-muted);
    opacity: 0.5;
    animation: pulseArrow 2s ease-in-out infinite;
}

@keyframes pulseArrow {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(8px); opacity: 0.8; }
}

/* ========== Chart Containers ========== */
.chart-container {
    width: 100%;
    height: 100%;
}

.chart-container svg {
    width: 100%;
    height: 100%;
}

/* ========== Results Dashboard Specific ========== */
.results-metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.results-metric-card {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 6px solid var(--slide-muted);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.results-method-name {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.results-auc-big {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.results-tpr-small {
    font-size: 1rem;
    color: var(--slide-muted);
    line-height: 1.6;
}

/* ========== Responsive ========== */
@media (max-width: 1280px) {
    .slide-container {
        width: 95vw;
        height: 95vh;
    }
    
    .slide {
        padding: 2.5rem;
    }
}

@media (max-width: 1024px) {
    .slide.layout-split .slide-content,
    .slide.layout-split-reverse .slide-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .results-metrics-row {
        grid-template-columns: 1fr;
    }
}

/* ========== Print Styles ========== */
@media print {
    body {
        background: white;
    }
    
    .slide-container {
        width: 100%;
        height: auto;
        box-shadow: none;
        page-break-after: always;
    }
    
    .slide {
        position: relative;
        opacity: 1 !important;
        transform: none !important;
        page-break-after: always;
    }
    
    #progress-bar,
    #toc-overlay,
    #notes-panel,
    #shortcuts-hint,
    .next-hint,
    .slide-hud {
        display: none !important;
    }
}
