:root {
    /* Brand Colors - SHIFT AI */
    --text-primary: #333333;
    --accent: #a51e6d;
    --primary-light: #edd2e2;
    --secondary: #039578;
    --bg-color: #f7f7f7;
    --white: #ffffff;

    /* Spacing System (Multiples of 8) -> Scaled to container width (cqi) */
    /* Assumes base width of 1280px. 1cqi = 12.8px */
    --sp-1: 0.625cqi;
    /* ~8px at 1280px width */
    --sp-2: 1.25cqi;
    /* ~16px */
    --sp-3: 1.875cqi;
    /* ~24px */
    --sp-4: 2.5cqi;
    /* ~32px */
    --sp-5: 3.125cqi;
    /* ~40px */
    --sp-6: 3.75cqi;
    /* ~48px */
    --sp-8: 5cqi;
    /* ~64px */
    --sp-10: 6.25cqi;
    /* ~80px */
}

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

body {
    font-family: 'Avenir Next Arabic', 'Noto Sans JP', sans-serif;
    background-color: #222;
    /* Dark background to frame the 16:9 slide */
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    /* Prevent body scrolling */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

/* 16:9 Aspect Ratio Container */
.presentation-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.presentation-container {
    background-color: var(--white);
    position: relative;
    width: 100vw;
    height: calc(100vw * 9 / 16);
    max-height: 100vh;
    max-width: calc(100vh * 16 / 9);
    container-type: inline-size;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header Hover Zone */
.header-hover-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4cqi;
    /* Trigger area (doubled) */
    z-index: 100;
}

/* Common Header */
.slide-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--sp-8);
    padding: 0 var(--sp-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #e6033d, #673ba0);
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 0.3cqi 0.8cqi rgba(0, 0, 0, 0.15);
    z-index: 101;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.header-hover-zone:hover .slide-header,
.slide-header:focus-within {
    transform: translateY(0);
}

/* Blur slide content when header is shown */
.header-hover-zone:hover~.slide-content,
.header-hover-zone:focus-within~.slide-content {
    filter: blur(4px);
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
}

.logo {
    display: none;
    /* Removed in HTML, keep rule hidden just in case */
}

.header-logo {
    height: 3cqi;
    /* Dynamically scaled logo height */
    width: auto;
    object-fit: contain;
}

.tagline {
    font-size: 1.09375cqi;
    /* approx 14px */
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Agenda UI */
.agenda-ui {
    display: flex;
    gap: var(--sp-3);
    font-size: 1.25cqi;
    font-weight: 700;
}

.agenda-item {
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    padding-bottom: 0.3cqi;
    transition: color 0.3s;
}

.agenda-item.active {
    color: var(--white);
}

.agenda-item.active::after {
    content: '';
    position: absolute;
    bottom: -0.3cqi;
    left: 0;
    width: 100%;
    height: 0.25cqi;
    background-color: var(--white);
    border-radius: 0.15cqi;
}

/* Slide Content Area */
.slide-content {
    flex-grow: 1;
    padding: var(--sp-3) var(--sp-6);
    overflow: hidden;
    font-size: 1.5cqi;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: filter 0.3s ease-in-out;
}

/* Inner wrapper generated by React */
.slide-content-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-content-inner:not(.slide-chapter)>.slide-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 1cqi;
}

/* Font size variants based on content density */
.slide-size-lg {
    font-size: 1.8cqi;
}

.slide-size-lg h1 {
    font-size: 3.5cqi;
}

.slide-size-md {
    font-size: 1.4cqi;
}

.slide-size-sm {
    font-size: 1.2cqi;
}

.slide-size-sm h1 {
    font-size: 2.2cqi;
}

/* Chapter Slide Special Styling */
.slide-chapter {
    background-color: #000000;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Negative margin to cover parent's padding completely (top, right, bottom, left) */
    margin: calc(var(--sp-3) * -1) calc(var(--sp-6) * -1) calc(var(--sp-3) * -1) calc(var(--sp-6) * -1);
    padding: var(--sp-8);
    /* Ensure full height coverage including the negated margins */
    min-height: calc(100% + var(--sp-3) * 2);
}

.slide-chapter>div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.slide-content .slide-chapter h1 {
    color: #ffffff;
    border-bottom: none;
    font-size: 6cqi;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    display: block;
    line-height: 1.2;
}

/* Elegant accent line below the title */
.slide-content .slide-chapter h1::after {
    display: none;
}

.slide-content .slide-chapter p,
.slide-content .slide-chapter h2 {
    color: #ffffff;
    font-size: 1.8cqi;
    font-weight: 500;
    max-width: 80%;
    margin: var(--sp-5) auto 0;
    line-height: 1.6;
    letter-spacing: 0.05em;
}

.slide-content .slide-chapter strong {
    color: #ffffff;
    font-weight: 700;
}

.slide-content .slide-chapter .fas,
.slide-content .slide-chapter .far,
.slide-content .slide-chapter .fab {
    display: none;
}

.slide-content .slide-chapter code {
    color: #ffffff;
    background: none;
}

.slide-content .slide-chapter ul,
.slide-content .slide-chapter ol {
    border: none;
    box-shadow: none;
    background: none;
    color: #ffffff;
}

.slide-content .slide-chapter li::before {
    color: #ffffff;
}

/* Time badge inside components - hidden (now managed by app.jsx) */
.slide-time-badge {
    display: none;
}

/* Agenda Indicator (always visible, top right) */
.agenda-indicator {
    position: absolute;
    top: var(--sp-1);
    right: var(--sp-2);
    display: flex;
    gap: 0.8cqi;
    z-index: 10;
    font-size: 1cqi;
    font-weight: 500;
}

.agenda-indicator span {
    color: #ccc;
    transition: color 0.3s;
}

.agenda-indicator span.active {
    color: var(--accent);
    font-weight: 700;
}

.agenda-time {
    color: #ccc;
    margin-left: 0.5cqi;
}

/* Footer Hover Zone (Talk Script) */
.footer-hover-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4cqi;
    /* Same trigger area as header */
    z-index: 100;
}

.slide-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: var(--white);
    padding: var(--sp-3) var(--sp-6);
    z-index: 101;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.footer-hover-zone:hover .slide-footer {
    transform: translateY(0);
}

/* Blur slide content when footer is shown */
.footer-hover-zone:hover~.slide-content {
    filter: blur(4px);
}

.footer-script {
    font-size: 1.4cqi;
    line-height: 1.6;
    font-weight: 400;
}

/* Icon Styles */
.fas,
.far,
.fab {
    color: var(--accent);
    margin-right: 0.5cqi;
}

/* Markdown Styling */
.slide-content h1 {
    font-size: 2.8cqi;
    color: var(--text-primary);
    margin-bottom: var(--sp-1);
    padding-bottom: 0;
    border-bottom: none;
    display: block;
    flex-shrink: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.slide-content h2 {
    font-size: 2cqi;
    margin-top: var(--sp-3);
    margin-bottom: var(--sp-2);
    color: var(--text-primary);
    flex-shrink: 0;
}

.slide-content p {
    margin-bottom: var(--sp-1);
    font-size: 1.6cqi;
    line-height: 1.5;
}

.slide-content ul,
.slide-content ol {
    margin-left: 0;
    margin-bottom: var(--sp-2);
    font-size: 1.4cqi;
    list-style-type: none;
    background-color: #f8f8f9;
    border: none;
    border-radius: 0.8cqi;
    padding: var(--sp-2) var(--sp-3);
    box-shadow: none;
    flex-shrink: 1;
    overflow-y: auto;
    max-height: 100%;
    flex-grow: 1;
}

.slide-content li {
    margin-bottom: var(--sp-1);
    position: relative;
    padding-left: 0;
    line-height: 1.6;
}

.slide-content li:last-child {
    margin-bottom: 0;
}

.slide-content li::before {
    display: none;
}

/* Image styles logic */
.slide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1cqi;
    box-shadow: 0 0.4cqi 1.2cqi rgba(0, 0, 0, 0.1);
    margin: var(--sp-1) 0;
    display: block;
    max-height: 20cqi;
    object-fit: cover;
    flex-shrink: 1;
}

.slide-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.slide-content blockquote {
    border-left: none;
    background-color: #f4f0f7;
    padding: var(--sp-2) var(--sp-3);
    margin: var(--sp-3) 0;
    font-weight: 600;
    border-radius: 0.6cqi;
    color: #444;
}

.slide-content code {
    background-color: #f3f3f5;
    padding: 0.15cqi 0.5cqi;
    border-radius: 0.3cqi;
    font-family: inherit;
    color: #555;
    font-size: 0.9em;
}

/* Footer & Navigation Removed */

/* Page Counter Input in Header */
.page-counter {
    display: flex;
    align-items: center;
    gap: 0.5cqi;
    font-weight: 500;
}

#page-input {
    width: 3.5cqi;
    height: 2cqi;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.3cqi;
    text-align: center;
    font-size: 1.09375cqi;
    color: var(--white);
    background-color: transparent;
    font-family: inherit;
    font-weight: 700;
}

#page-input:focus {
    outline: none;
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Hide inner arrows for number input */
#page-input::-webkit-outer-spin-button,
#page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

#page-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Click Navigation Zones */
.click-nav {
    position: absolute;
    top: 0;
    height: 100%;
    width: 35%;
    z-index: 50;
    cursor: pointer;
}

.click-nav-prev {
    left: 0;
}

.click-nav-next {
    right: 0;
    width: 65%;
}

/* Two-Column Layout */
.two-col {
    display: flex;
    gap: 1.5cqi;
    margin-top: 0.8cqi;
    flex: 1;
    min-height: 0;
}

.two-col>div {
    flex: 1;
    border-radius: 0.8cqi;
    padding: 1.5cqi;
    display: flex;
    flex-direction: column;
}

.col-bad {
    background: #fff5f5;
    border: 1.5px solid #ffcccc;
}

.col-good {
    background: #f0f9f6;
    border: 1.5px solid #b3e0d2;
}

.col-neutral {
    background: #f8f8f9;
    border: 1.5px solid #e0e0e0;
}

.col-label {
    font-size: 1cqi;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5cqi;
    padding-bottom: 0.3cqi;
    border-bottom: 2px solid currentColor;
}

.col-label-bad {
    color: #d32f2f;
}

.col-label-good {
    color: var(--secondary);
}

/* Card Grid */
.card-grid {
    display: grid;
    gap: 1cqi;
    margin-top: 0.8cqi;
    flex: 1;
    min-height: 0;
}

.card-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.card-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.card-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.card {
    background: #f8f8f9;
    border-radius: 0.8cqi;
    padding: 1.2cqi 1.5cqi;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.card-accent {
    border-left: 0.4cqi solid var(--accent);
}

.card-green {
    border-left: 0.4cqi solid var(--secondary);
}

.card-num {
    font-size: 2cqi;
    font-weight: 900;
    color: var(--accent);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: 0.3cqi;
}

.card h3 {
    font-size: 1.5cqi;
    font-weight: 700;
    margin-bottom: 0.3cqi;
    color: var(--text-primary);
}

.card p {
    font-size: 1.2cqi;
    color: #666;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Prompt Code Block */
.prompt-block {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 0.8cqi;
    padding: 1.2cqi 1.5cqi;
    font-size: 1.3cqi;
    line-height: 1.6;
    margin-top: 0.8cqi;
    position: relative;
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
}

.prompt-block::before {
    content: 'COPY';
    position: absolute;
    top: 0.8cqi;
    right: 1cqi;
    font-size: 0.8cqi;
    color: #888;
    letter-spacing: 0.1em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2cqi 0.6cqi;
    border-radius: 0.3cqi;
}

.prompt-label {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    margin-right: 0.3cqi;
}

/* Highlight Box */
.highlight-box {
    background: #fdf5f9;
    border-left: 0.5cqi solid var(--accent);
    padding: 1.5cqi 2cqi;
    border-radius: 0 0.8cqi 0.8cqi 0;
    margin-top: 1.5cqi;
}

.highlight-box p {
    margin-bottom: 0;
}

/* Center Content (for Q&A, Summary etc) */
.slide-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1;
}

/* Icon Circle */
.icon-circle {
    width: 3cqi;
    height: 3cqi;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5cqi;
    margin-bottom: 0.5cqi;
    flex-shrink: 0;
}

.icon-circle-accent {
    background: var(--primary-light);
    color: var(--accent);
}

.icon-circle-green {
    background: #d4f0e8;
    color: var(--secondary);
}

/* Step Badge */
.step-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5cqi;
    background: linear-gradient(90deg, #e6033d, #673ba0);
    color: white;
    font-size: 1cqi;
    font-weight: 700;
    padding: 0.3cqi 1cqi;
    border-radius: 2cqi;
    margin-bottom: 0.5cqi;
    letter-spacing: 0.05em;
}

/* Subtitle */
.slide-subtitle {
    font-size: 1.4cqi;
    color: #777;
    margin-bottom: 0.5cqi;
    font-weight: 400;
}

/* Override: better blockquote for slides */
.slide-content blockquote {
    background: linear-gradient(135deg, #f8f4fb, #fdf5f9);
    border-left: 0.4cqi solid var(--accent);
    padding: 1.5cqi 2cqi;
    margin: 1.5cqi 0 0;
    border-radius: 0 0.8cqi 0.8cqi 0;
    font-size: 1.3cqi;
}

/* Override: better code blocks */
.slide-content pre {
    background: #1a1a2e;
    border-radius: 0.8cqi;
    padding: 1.5cqi 2cqi;
    margin: 1.5cqi 0 0;
    overflow-x: auto;
    position: relative;
    flex-shrink: 0;
}

.slide-content pre code {
    background: none;
    color: #e0e0e0;
    font-size: 1.2cqi;
    line-height: 1.7;
    padding: 0;
}

/* Checklist style list */
.checklist li {
    padding-left: 2cqi;
    position: relative;
}

.checklist li::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--secondary);
    display: block;
}