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

:root {
    --primary-color: #78a9ff;
    --secondary-color: #525252;
    --accent-color: #ee5396;
    --dark-bg: #0d0d0d;
    --light-bg: #1a1a1a;
    --card-bg: #262626;
    --text-primary: #f4f4f4;
    --text-secondary: #8d8d8d;
    --success: #42be65;
    --warning: #ff832b;
    --error: #fa4d56;
    --gradient: linear-gradient(135deg, var(--card-bg), var(--light-bg));
    --accent-gradient: linear-gradient(135deg, var(--accent-color), var(--warning));
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
}

.presentation {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

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

.slide.prev {
    transform: translateX(-100%);
}

.content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

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

/* Typography */
h1.title {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    padding-left: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.highlight {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0;
    border-left: 3px solid var(--primary-color);
    font-size: 1.2rem;
    margin: 1.5rem 0;
}

/* Providers badges */
.providers {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.provider {
    background: var(--card-bg);
    padding: 0.8rem 2rem;
    border-radius: 0;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: none;
    border: 1px solid var(--secondary-color);
    color: var(--text-primary);
}

/* Card */
.card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
    margin: 1.5rem 0;
    border: 1px solid var(--card-bg);
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.feature-box {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    border: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
}

.feature-box ul {
    list-style: none;
    padding-left: 0;
}

.feature-box ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.feature-box ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0;
    transition: transform 0.3s ease;
    border-left: 2px solid var(--primary-color);
}

.timeline-item:hover {
    transform: translateX(10px);
}

.timeline-number {
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
    border: 1px solid var(--primary-color);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
}

/* Stage Detail */
.stage-detail {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
}

.role-card {
    flex: 1;
    padding: 2rem;
    border-radius: 0;
    background: var(--light-bg);
    border: 1px solid var(--card-bg);
}

.role-card.solver {
    border: 3px solid var(--success);
}

.role-card.judge {
    border: 3px solid var(--warning);
}

.vs {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.note {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0;
    font-style: italic;
    border: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
}

/* Process Flow */
.process-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0;
}

.process-step {
    flex: 1;
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    text-align: center;
    border: 1px solid var(--card-bg);
}

.arrow {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Judgment Flow */
.judgment-flow {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.judge-input, .judge-process, .judge-output {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0;
    border: 1px solid var(--card-bg);
}

.process-box {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 0;
    border: 1px solid var(--card-bg);
}

.output-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0;
    margin-top: 1rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

.output-card p {
    margin: 0.5rem 0;
}

/* Architecture */
.architecture-diagram {
    margin: 2rem 0;
}

.mermaid-container {
    background: var(--light-bg);
    padding: 1.5rem;
    border: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
    margin: 1rem 0;
    overflow-x: auto;
}

.mermaid-container .mermaid {
    display: flex;
    justify-content: center;
    min-height: 500px;
    font-size: 14px;
}

/* System Architecture Diagram - Slide 4 specific */
.slide[data-slide="3"] {
    overflow-y: auto !important;  /* Allow vertical scrolling if needed */
    overflow-x: hidden;
}

.slide[data-slide="3"] .content {
    max-width: 1200px;  /* Wider container */
}

.mermaid-container.system-architecture-diagram {
    padding: 2rem;
    overflow: visible !important;
    display: block;  /* Changed from flex */
    min-height: 650px;
    height: auto;
    margin: 0 auto;
}

.mermaid-container.system-architecture-diagram .mermaid {
    display: block;
    min-height: 650px;
    width: 100%;
}

.mermaid-container.system-architecture-diagram .node text {
    font-size: 14px !important;
}

.mermaid-container.system-architecture-diagram .mermaid svg {
    max-height: none !important;
    min-height: 650px !important;
    width: 100% !important;
    height: auto !important;
    transform: none !important;  /* Remove scaling */
    display: block;
    margin: 0 auto;
}

.mermaid-container.message-bus-diagram .mermaid {
    font-size: 14px;
}

.mermaid {
    background: transparent !important;
}

/* Make mermaid nodes fit better */
.mermaid svg {
    max-height: 550px;
    width: 100%;
}

.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon {
    stroke-width: 1px !important;
}

.mermaid .node text {
    font-size: 14px !important;
}

.message-bus {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    text-align: center;
    margin-bottom: 2rem;
    border: 1px solid var(--card-bg);
}

.bus-features {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.badge {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

.message-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.msg-type {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 0;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--secondary-color);
}

/* Evaluation Grid */
.evaluation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.eval-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0;
    border-top: 2px solid var(--primary-color);
    border-left: 1px solid var(--card-bg);
}

.eval-card ul {
    list-style: none;
    padding-left: 0;
}

.eval-card ul li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.eval-card ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.feature {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--card-bg);
}

.feature:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: var(--card-bg);
}

/* Tech Stack */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.tech-category {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    border: 1px solid var(--card-bg);
}

.tech-category ul {
    list-style: none;
    padding-left: 0;
}

.tech-category ul li {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-category ul li:last-child {
    border-bottom: none;
}

/* Code Examples */
.code-example {
    background: var(--light-bg);
    padding: 1.5rem;
    border: 1px solid var(--card-bg);
    margin: 1.5rem 0;
}

.code-example h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.code-example pre {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 0;
    overflow-x: auto;
    margin: 0;
    border: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
}

.code-example code {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Override Highlight.js Atom One Dark with darker theme colors */
.hljs {
    background: var(--dark-bg) !important;
    color: var(--text-primary) !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-type,
.hljs-name,
.hljs-strong {
    color: #ee5396 !important;
    font-weight: normal;
}

.hljs-string,
.hljs-title.function_,
.hljs-attr,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
    color: #42be65 !important;
}

.hljs-function,
.hljs-class .hljs-title,
.hljs-built_in,
.hljs-params {
    color: #78a9ff !important;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #6e6e6e !important;
    font-style: italic;
}

.hljs-number,
.hljs-regexp,
.hljs-link {
    color: #ff832b !important;
}

.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-selector-attr,
.hljs-selector-pseudo {
    color: #be95ff !important;
}

/* Usage Section */
.usage-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.code-block {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 0;
    border-left: 3px solid var(--primary-color);
}

.code-block pre {
    background: var(--dark-bg);
    padding: 1rem;
    border-radius: 0;
    overflow-x: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--card-bg);
}

.code-block code {
    color: var(--primary-color);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
}

/* File Tree */
.file-tree {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    border: 1px solid var(--card-bg);
}

.tree-item {
    padding: 0.5rem 0;
    font-size: 1rem;
}

.indent-1 { padding-left: 2rem; }
.indent-2 { padding-left: 4rem; }
.indent-3 { padding-left: 6rem; }

/* Benefits */
.benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.benefit-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    border-left: 3px solid var(--primary-color);
    border-bottom: 1px solid var(--card-bg);
}

/* Future Items */
.future-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.future-item {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0;
    border: 1px solid var(--card-bg);
    border-left: 3px solid var(--primary-color);
}

/* Contact Info */
.contact-info {
    margin-top: 3rem;
}

.github-link {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
}

/* Contributors - Top of title slide */
.contributors-top {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-bg);
}

.contributors-top .contributor-name {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
}

.contributors-top .contributor-name:nth-child(1) {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(120, 169, 255, 0.4);
}

.contributors-top .contributor-name:nth-child(2) {
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(66, 190, 101, 0.4);
}

.contributors-top .contributor-name:nth-child(3) {
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(238, 83, 150, 0.4);
}

.contributors-top .contributor-name:nth-child(1):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(120, 169, 255, 0.6);
}

.contributors-top .contributor-name:nth-child(2):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(66, 190, 101, 0.6);
}

.contributors-top .contributor-name:nth-child(3):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(238, 83, 150, 0.6);
}

/* Navigation */
.navigation {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--light-bg);
    padding: 1rem 1.5rem;
    border-radius: 0;
    box-shadow: none;
    z-index: 1000;
    border: 1px solid var(--secondary-color);
}

.nav-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--secondary-color);
    width: 40px;
    height: 40px;
    border-radius: 0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slide-counter {
    font-size: 1rem;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--light-bg);
    z-index: 1001;
}

.progress {
    height: 100%;
    background: var(--gradient);
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    h1.title {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    .grid-2, .features-grid, .benefits, .future-items, .tech-stack {
        grid-template-columns: 1fr;
    }

    .judgment-flow {
        grid-template-columns: 1fr;
    }

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

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

    .stage-detail {
        flex-direction: column;
    }

    .vs {
        transform: rotate(90deg);
    }

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

    .arrow {
        transform: rotate(90deg);
    }
    
    .bus-features {
        gap: 0.5rem;
    }
    
    .badge {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .contributors-top {
        gap: 1rem;
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 768px) {
    .slide {
        padding: 2rem 1rem;
    }

    h1.title {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .providers {
        flex-direction: column;
    }

    .navigation {
        bottom: 1rem;
        right: 1rem;
        padding: 0.8rem 1rem;
    }

    .code-example pre {
        font-size: 0.75rem;
        padding: 1rem;
    }

    .code-example {
        padding: 1rem;
    }
    
    .contributors-top {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }
    
    .contributors-top .contributor-name {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}
