/* Academic Theme for Reveal.js - Inspired by Al-folio */

/*********************************************
 * GLOBAL STYLES
 *********************************************/

:root {
    --r-background-color: #ffffff;
    --r-main-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --r-main-font-size: 16px;
    --r-main-color: #333333;
    --r-block-margin: 20px;
    --r-heading-margin: 0 0 20px 0;
    --r-heading-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --r-heading-color: #2c3e50;
    --r-heading-line-height: 1.2;
    --r-heading-letter-spacing: normal;
    --r-heading-text-transform: none;
    --r-heading-text-shadow: none;
    --r-heading-font-weight: 600;
    --r-heading1-text-shadow: none;
    --r-heading1-size: 2em;
    --r-heading2-size: 1.5em;
    --r-heading3-size: 1.25em;
    --r-heading4-size: 1.1em;
    --r-code-font: 'Monaco', 'Courier New', monospace;
    --r-link-color: #2c3e50;
    --r-link-color-hover: #1a252f;
    --r-selection-background-color: rgba(44, 62, 80, 0.2);
    --r-selection-color: #333;
}

/* Responsive font sizing for larger screens */
@media screen and (min-width: 768px) {
    :root {
        --r-main-font-size: 20px;
    }
}

@media screen and (min-width: 1024px) {
    :root {
        --r-main-font-size: 24px;
    }
}

@media screen and (min-width: 1440px) {
    :root {
        --r-main-font-size: 28px;
    }
}

.reveal-viewport {
    background: #ffffff;
    overflow: hidden !important;
}

.reveal {
    font-family: var(--r-main-font);
    font-size: var(--r-main-font-size);
    font-weight: normal;
    color: var(--r-main-color);
}

/* Disable Reveal.js transforms and centering */
.reveal .slides {
    width: 100vw !important;
    height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    text-align: left !important;
}

.reveal .slides section {
    height: 100vh !important;
    width: 100vw !important;
    padding: 0 !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
    text-align: left !important;
}

/* PowerPoint-style fixed black header bar */
.reveal .slides section.present:not(.title-slide)::before {
    content: attr(data-slide-title);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    background: #000000;
    color: #ffffff;
    padding: 0.5em 1em;
    font-size: 1em;
    font-weight: 600;
    z-index: 10000;
    box-sizing: border-box;
    line-height: 1.3;
}

/* Larger header on tablet and up */
@media screen and (min-width: 768px) {
    .reveal .slides section.present:not(.title-slide)::before {
        padding: 0.6em 1.5em;
        font-size: 1.2em;
    }
}

/* Even larger on desktop */
@media screen and (min-width: 1024px) {
    .reveal .slides section.present:not(.title-slide)::before {
        padding: 0.8em 2em;
        font-size: 1.4em;
    }
}

/* Navigation buttons in header */
.slide-nav {
    position: fixed;
    top: 0;
    right: 0.5em;
    display: flex;
    gap: 0;
    align-items: center;
    height: 2.5em;
    z-index: 10001;
    background: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

/* Larger nav on tablet and up */
@media screen and (min-width: 768px) {
    .slide-nav {
        right: 1em;
        height: 3em;
    }
}

@media screen and (min-width: 1024px) {
    .slide-nav {
        right: 2em;
        height: 3.8em;
    }
}

.slide-nav a {
    background: #ffffff;
    color: #000000;
    padding: 0.4em 0.6em;
    text-decoration: none;
    font-size: 0.7em;
    font-weight: 700;
    transition: all 0.2s ease;
    display: inline-block;
    border: none;
    border-right: 1px solid #e0e0e0;
}

@media screen and (min-width: 768px) {
    .slide-nav a {
        padding: 0.5em 0.7em;
        font-size: 0.75em;
    }
}

@media screen and (min-width: 1024px) {
    .slide-nav a {
        padding: 0.6em 0.9em;
        font-size: 0.8em;
    }
}

.slide-nav a:last-child {
    border-right: none;
}

.slide-nav a:hover {
    background: #f5f5f5;
    color: #000000;
}

.slide-nav a:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

/* Scrollable content area below fixed header */
.reveal .slides section.present:not(.title-slide) {
    padding-top: 3em !important;
    padding-bottom: 2em !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* More padding on larger screens */
@media screen and (min-width: 768px) {
    .reveal .slides section.present:not(.title-slide) {
        padding-top: 3.5em !important;
    }
}

@media screen and (min-width: 1024px) {
    .reveal .slides section.present:not(.title-slide) {
        padding-top: 4.5em !important;
        padding-bottom: 3em !important;
    }
}

/* Content wrapper with padding */
.reveal .slides section:not(.title-slide)>* {
    margin-left: 1em;
    margin-right: 1em;
}

/* More margin on larger screens */
@media screen and (min-width: 768px) {
    .reveal .slides section:not(.title-slide)>* {
        margin-left: 1.5em;
        margin-right: 1.5em;
    }
}

@media screen and (min-width: 1024px) {
    .reveal .slides section:not(.title-slide)>* {
        margin-left: 2em;
        margin-right: 2em;
    }
}

.reveal .slides section:not(.title-slide)>*:last-child {
    margin-bottom: 2em;
}

/* Title slide styling - centered */
.reveal .slides section.title-slide {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 3em !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Hide the first h2 on slides with data-slide-title (avoid duplication) */
.reveal .slides section[data-slide-title]:not(.title-slide)>h2:first-of-type {
    display: none;
}

/*********************************************
 * HEADERS
 *********************************************/

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
    margin: var(--r-heading-margin);
    color: var(--r-heading-color);
    font-family: var(--r-heading-font);
    font-weight: var(--r-heading-font-weight);
    line-height: var(--r-heading-line-height);
    letter-spacing: var(--r-heading-letter-spacing);
    text-transform: var(--r-heading-text-transform);
    text-shadow: var(--r-heading-text-shadow);
    word-wrap: break-word;
}

.reveal h1 {
    font-size: var(--r-heading1-size);
}

.reveal h2 {
    font-size: var(--r-heading2-size);
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.3em;
    margin-bottom: 0.8em;
}

.reveal h3 {
    font-size: var(--r-heading3-size);
}

.reveal h4 {
    font-size: var(--r-heading4-size);
}

/*********************************************
 * TEXT
 *********************************************/

.reveal p {
    margin: var(--r-block-margin) 0;
    line-height: 1.6;
}

.reveal strong,
.reveal b {
    font-weight: 600;
}

.reveal em {
    font-style: italic;
}

/*********************************************
 * LINKS
 *********************************************/

.reveal a {
    color: var(--r-link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.reveal a:hover {
    color: var(--r-link-color-hover);
    border-bottom-color: var(--r-link-color-hover);
}

/*********************************************
 * LISTS
 *********************************************/

.reveal ul,
.reveal ol {
    display: block;
    text-align: left;
    margin: 0 0 0 1em;
}

.reveal ul {
    list-style-type: disc;
}

.reveal ul ul {
    list-style-type: circle;
}

.reveal ol {
    list-style-type: decimal;
}

.reveal ul ul,
.reveal ul ol,
.reveal ol ol,
.reveal ol ul {
    display: block;
    margin-left: 2em;
}

.reveal li {
    margin: 0.5em 0;
}

/*********************************************
 * QUOTES
 *********************************************/

.reveal blockquote {
    display: block;
    position: relative;
    width: 90%;
    margin: var(--r-block-margin) auto;
    padding: 1em;
    font-style: italic;
    background: #f9f9f9;
    border-left: 3px solid #2c3e50;
}

.reveal blockquote p:first-child,
.reveal blockquote p:last-child {
    display: inline-block;
}

.reveal q {
    font-style: italic;
}

/*********************************************
 * CODE
 *********************************************/

.reveal pre {
    display: block;
    position: relative;
    width: 100%;
    margin: var(--r-block-margin) 0;
    text-align: left;
    font-size: 0.55em;
    font-family: var(--r-code-font);
    line-height: 1.5;
    word-wrap: break-word;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reveal code {
    font-family: var(--r-code-font);
    text-transform: none;
    background: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    color: #c7254e;
}

.reveal pre code {
    display: block;
    padding: 1em;
    overflow: auto;
    max-height: 500px;
    word-wrap: normal;
    background: transparent;
    color: #d4d4d4;
    font-size: 1em;
}

/* Code highlighting enhancements */
.reveal pre code.hljs {
    padding: 1em;
    background: #1e1e1e;
}

/* Enable scrolling for code blocks */
.reveal pre {
    overflow-x: auto;
    overflow-y: auto;
}

.reveal pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.reveal pre::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.reveal pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.reveal pre::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/*********************************************
 * TABLES
 *********************************************/

.reveal table {
    margin: auto;
    border-collapse: collapse;
    border-spacing: 0;
}

.reveal table th {
    font-weight: 600;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.reveal table th,
.reveal table td {
    text-align: left;
    padding: 0.5em 1em;
    border-bottom: 1px solid #e0e0e0;
}

.reveal table th[align="center"],
.reveal table td[align="center"] {
    text-align: center;
}

.reveal table th[align="right"],
.reveal table td[align="right"] {
    text-align: right;
}

/*********************************************
 * IMAGES
 *********************************************/

.reveal img {
    margin: var(--r-block-margin) 0;
    max-width: 100%;
    height: auto;
}

/*********************************************
 * SLIDE NUMBERS
 *********************************************/

.reveal .slide-number {
    color: #666666;
    background-color: transparent;
    font-size: 0.5em;
}

/*********************************************
 * PROGRESS BAR
 *********************************************/

.reveal .progress {
    background: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

/*********************************************
 * CUSTOM CLASSES
 *********************************************/

.reveal .text-muted {
    color: #666666;
}

.reveal .text-light {
    color: #999999;
}

.reveal .small {
    font-size: 0.7em;
}

.reveal .info-box {
    background: #f9f9f9;
    border-left: 3px solid #2c3e50;
    padding: 1em;
    margin: 1em 0;
    text-align: left;
}

.reveal .module-code {
    font-size: 0.5em;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2em;
    color: #999999;
}

/*********************************************
 * TITLE SLIDE - Minimal Black and White
 *********************************************/

.reveal .title-slide h1 {
    font-size: 3em;
    margin-bottom: 0.3em;
    margin-top: 0;
    color: #000000;
    font-weight: 700;
    border: none;
    line-height: 1.2;
}

.reveal .title-slide h2 {
    font-size: 1.4em;
    border-bottom: none;
    color: #666666;
    font-weight: 300;
    margin-top: 0;
    margin-bottom: 3em;
}

.reveal .title-slide .author {
    margin-top: auto;
    font-size: 1em;
    color: #333333;
    font-weight: 400;
    line-height: 1.8;
}

.reveal .title-slide .author p {
    margin: 0.3em 0;
}

.reveal .title-slide .author strong {
    font-weight: 600;
    color: #000000;
}

.reveal .title-slide .author .text-muted {
    color: #999999;
    font-size: 0.9em;
    margin-top: 0.5em;
}

/*********************************************
 * TWO-COLUMN LAYOUT
 *********************************************/

.reveal .columns {
    display: flex;
    gap: 2em;
    align-items: flex-start;
}

.reveal .column {
    flex: 1;
}

/*********************************************
 * NAVIGATION
 *********************************************/

.reveal .controls {
    color: #2c3e50;
}

/*********************************************
 * SELECTION
 *********************************************/

.reveal ::selection {
    color: var(--r-selection-color);
    background: var(--r-selection-background-color);
    text-shadow: none;
}

.reveal ::-moz-selection {
    color: var(--r-selection-color);
    background: var(--r-selection-background-color);
    text-shadow: none;
}

/*********************************************
 * SCROLLING FIX
 *********************************************/

/* Prevent wheel events from changing slides when scrolling within content */
.reveal .slides section {
    pointer-events: auto;
}

.reveal pre,
.reveal .code-example,
.reveal .task-box,
.reveal .info-box,
.reveal .warning-box,
.reveal .highlight,
.reveal ul,
.reveal ol,
.reveal div[style*="overflow"] {
    /* Allow scrolling but stop propagation to prevent slide changes */
    -ms-overflow-style: auto;
    scrollbar-width: auto;
}