/* ==========================================
   Day 4 Reveal.js Custom Styles
   Building AI-Friendly Code
   ========================================== */

:root {
    --primary-blue: #3498db;
    --primary-purple: #9b59b6;
    --primary-green: #2ecc71;
    --primary-orange: #e67e22;
    --primary-red: #e74c3c;

    --bg-dark: #1a1a2e;
    --bg-medium: #16213e;
    --bg-light: #0f3460;

    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-muted: #7f8c8d;

    --accent-glow: rgba(52, 152, 219, 0.3);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ==================== BASE STYLES ==================== */

.reveal {
    font-family: var(--font-main);
    font-weight: 400;
}

/* Slide container - prevent overflow */
.reveal .slides section {
    box-sizing: border-box;
    padding: 10px 15px;
}

/* Allow scrolling for tall slides as fallback */
.reveal .slides section.scrollable {
    overflow-y: auto;
    max-height: 100%;
}

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
    font-family: var(--font-main);
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.02em;
}

.reveal h1 {
    font-size: 1.8em;
    margin-bottom: 0.3em;
}

.reveal h2 {
    font-size: 1.3em;
    margin-bottom: 0.4em;
    color: var(--text-primary);
}

.reveal h3 {
    font-size: 0.95em;
    color: var(--text-secondary);
}

.reveal p {
    line-height: 1.4;
    margin-bottom: 0.3em;
    font-size: 0.9em;
}

.reveal ul, .reveal ol {
    margin-bottom: 0.4em;
}

.reveal li {
    margin-bottom: 0.2em;
    line-height: 1.3;
    font-size: 0.85em;
}

.reveal code {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-size: 0.8em;
}

.reveal pre {
    width: 100%;
    margin: 0;
    box-shadow: none;
}

.reveal pre code {
    padding: 0.8em;
    border-radius: 6px;
    font-size: 0.7em;
    line-height: 1.4;
}

/* ==================== TITLE SLIDE ==================== */

.title-main {
    font-size: 2.2em !important;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #3498db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.1em !important;
}

.title-sub {
    font-size: 1.1em !important;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 0.4em !important;
}

.title-tagline {
    font-size: 0.85em;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.8em;
}

.title-meta {
    display: flex;
    justify-content: center;
    gap: 1.2em;
    margin-top: 0.8em;
}

.title-meta .course-name {
    color: var(--primary-blue);
    font-weight: 500;
}

.title-meta .day-indicator {
    background: var(--primary-blue);
    color: white;
    padding: 0.3em 1em;
    border-radius: 20px;
    font-weight: 600;
}

/* ==================== PART HEADERS ==================== */

.part-header {
    font-size: 0.75em !important;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 0.2em !important;
}

.part-subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 0.4em;
}

/* ==================== AGENDA ==================== */

.agenda-grid {
    display: grid;
    gap: 0.1em;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 0.3em;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.18em 0.6em;
    border-radius: 4px;
    border-left: 2px solid var(--primary-blue);
    transition: transform 0.3s ease, background 0.3s ease;
}

.agenda-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.08);
}

.agenda-number {
    font-size: 0.75em;
    font-weight: 700;
    color: var(--primary-blue);
    min-width: 0.9em;
    text-align: center;
}

.agenda-content {
    text-align: left;
}

.agenda-content strong {
    display: block;
    font-size: 0.58em;
    margin-bottom: 0;
}

.agenda-content span {
    color: var(--text-muted);
    font-size: 0.45em;
}

/* ==================== TABLES ==================== */

.reveal table {
    margin: 0.4em auto;
    border-collapse: collapse;
    font-size: 0.75em;
}

.reveal table th,
.reveal table td {
    padding: 0.35em 0.7em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reveal table th {
    background: rgba(52, 152, 219, 0.2);
    font-weight: 600;
}

.reveal table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.comparison-table {
    font-size: 0.75em;
}

.comparison-table td:first-child {
    color: var(--text-muted);
}

.comparison-table td:last-child {
    color: var(--primary-green);
}

.comparison-table strong {
    color: var(--primary-green);
}

/* ==================== TAKEAWAYS ==================== */

.takeaways {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
}

.takeaway {
    display: flex;
    align-items: center;
    gap: 0.4em;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2em 0.6em;
    border-radius: 5px;
    text-align: left;
}

.takeaway-num {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    color: white;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6em;
    flex-shrink: 0;
}

.takeaway-content strong {
    display: block;
    margin-bottom: 0;
    font-size: 0.62em;
}

.takeaway-content span {
    color: var(--text-muted);
    font-size: 0.52em;
}

/* ==================== HOMEWORK ==================== */

.homework-list {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
    text-align: left;
}

.homework-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    padding: 0.35em 0.6em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.75em;
}

.homework-check {
    font-size: 0.85em;
    color: var(--primary-blue);
}

.next-preview {
    margin-top: 0.6em;
    padding: 0.5em 0.9em;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(155, 89, 182, 0.2));
    border-radius: 8px;
    border: 1px solid var(--primary-blue);
    font-size: 0.75em;
    max-width: 1100px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== RESOURCES ==================== */

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.4em 0.8em;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, background 0.3s ease;
}

.resource-item:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.1);
}

.resource-icon {
    font-size: 1em;
}

.resource-name {
    font-weight: 600;
    flex: 1;
    font-size: 0.75em;
}

.resource-url {
    color: var(--text-muted);
    font-size: 0.65em;
}

/* ==================== NEXT SESSION ==================== */

.next-session {
    color: var(--primary-blue);
    font-weight: 400;
    font-size: 0.9em;
}

/* ==================== FRAGMENT ANIMATIONS ==================== */

.reveal .slides section .fragment.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.reveal .slides section .fragment.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal .slides section .fragment.fade-right {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.5s ease;
}

.reveal .slides section .fragment.fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==================== PRINT ==================== */

@media print {
    .reveal .slides section {
        page-break-after: always;
    }

    .fragment {
        opacity: 1 !important;
        transform: none !important;
    }
}

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

@media (max-width: 768px) {
    .reveal h1 {
        font-size: 1.8em;
    }

    .reveal h2 {
        font-size: 1.4em;
    }

    .title-main {
        font-size: 2em !important;
    }

    .agenda-grid {
        gap: 0.3em;
    }

    .prompt-box pre code {
        font-size: 0.6em;
    }

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

/* ==================== PROMPT BOX ==================== */

.prompt-box {
    max-width: 750px;
    width: 70%;
    margin: 0.5em auto;
    text-align: left;
}

.prompt-box pre {
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.prompt-box pre code {
    background: #1e1e2e;
    padding: 1em 1.2em;
    border-radius: 8px;
    font-size: 0.72em;
    line-height: 1.5;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==================== CODE/CONFIG BOX ==================== */

.code-box {
    max-width: 850px;
    width: 80%;
    margin: 0.5em auto;
    text-align: left;
}

.code-box pre {
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.code-box pre code {
    background: #1e1e2e;
    padding: 1em 1.2em;
    border-radius: 8px;
    font-size: 0.68em;
    line-height: 1.4;
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==================== DOCUMENT HIERARCHY ==================== */

.doc-hierarchy {
    max-width: 750px;
    width: 70%;
    margin: 0.5em auto;
    text-align: left;
}

.doc-hierarchy pre {
    margin: 0;
}

.doc-hierarchy pre code {
    background: #1e1e2e;
    padding: 1em 1.2em;
    border-radius: 8px;
    font-size: 0.68em;
    line-height: 1.4;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

/* ==================== FEATURE TABLE ==================== */

.feature-table {
    width: 95%;
    max-width: 1100px;
    margin: 0.4em auto;
    border-collapse: collapse;
    font-size: 0.75em;
}

.feature-table th,
.feature-table td {
    padding: 0.4em 0.8em;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-table th {
    background: rgba(46, 204, 113, 0.2);
    color: var(--primary-green);
    font-weight: 600;
}

.feature-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== KEY CONCEPT BOX ==================== */

.key-concept {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    margin-top: 0.5em;
    padding: 0.5em 1em;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(52, 152, 219, 0.2));
    border-radius: 8px;
    border: 1px solid var(--primary-purple);
    max-width: 1100px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.75em;
}

/* ==================== STRATEGY TABLE ==================== */

.strategy-table {
    width: 95%;
    max-width: 1100px;
    margin: 0.4em auto;
    border-collapse: collapse;
    font-size: 0.72em;
}

.strategy-table th,
.strategy-table td {
    padding: 0.4em 0.8em;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.strategy-table th {
    background: rgba(155, 89, 182, 0.2);
    color: var(--primary-purple);
    font-weight: 600;
}

.strategy-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== QUICK REFERENCE BOX ==================== */

.quick-reference {
    max-width: 900px;
    width: 85%;
    margin: 0.5em auto;
    text-align: left;
}

.quick-reference pre {
    margin: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.quick-reference pre code {
    background: #1e1e2e;
    padding: 1em 1.2em;
    border-radius: 8px;
    font-size: 0.65em;
    line-height: 1.4;
    display: block;
    max-height: 520px;
}

/* ==================== NOTE BOX ==================== */

.note-box {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid var(--primary-blue);
    border-radius: 5px;
    padding: 0.3em 0.6em;
    margin: 0.2em auto;
    max-width: 1000px;
    font-size: 0.48em;
}

/* ==================== BLOCKQUOTE ==================== */

.reveal blockquote {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-purple);
    padding: 0.6em 1em;
    margin: 0.5em auto;
    max-width: 900px;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 8px 8px 0;
}

/* ==================== CONTENT IMAGE (side-by-side) ==================== */

.content-with-image {
    display: flex;
    align-items: flex-start;
    gap: 1.5em;
    max-width: 1200px;
    width: 98%;
    margin: 0.3em auto;
}

.content-with-image .content-text {
    flex: 1;
    text-align: left;
}

.content-with-image .content-img {
    flex: 0 0 55%;
    max-width: 650px;
}

.content-with-image .content-img img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==================== CHECKLIST ==================== */

.security-checklist {
    max-width: 900px;
    width: 85%;
    margin: 0.5em auto;
    text-align: left;
}

.security-checklist li {
    margin-bottom: 0.3em;
    list-style: none;
    font-size: 0.8em;
}

/* ==================== HERO IMAGE REVEAL ANIMATION ==================== */

.image-reveal .hero-image {
    max-height: 65vh;
    max-width: 85%;
    margin: 0.3em auto;
    display: block;
    transition: max-height 0.6s ease, max-width 0.6s ease;
}

.image-reveal:has(.fragment.visible) .hero-image {
    max-height: 25vh;
    max-width: 50%;
}
