/* ============================================
   Documentation Slides - Reveal.js Customization
   ============================================ */

/* Import modern fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Page background - match reveal background */
body:has(.reveal) {
    margin: 0;
    padding: 0;
}

/* Desktop (>= 992px): the Reveal deck owns the viewport, so trap scroll/overflow
   to the deck only. Mobile keeps normal body scrolling (FR-2). */
@media (min-width: 992px) {
    body:has(.reveal) {
        overflow: hidden;
    }
}

/* Make reveal.js fit below navbar (desktop only; navbar is 50px at every breakpoint, FR-5) */
.reveal {
    height: calc(100vh - 50px) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Desktop (>= 992px): constrain the deck to the Bootstrap `.container` width/padding
   used by the header, so left/right edges line up with the header content (FR-3). */
@media (min-width: 992px) {
    .reveal.docs-deck {
        box-sizing: border-box;
        width: 100%;
        max-width: 960px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

@media (min-width: 1200px) {
    .reveal.docs-deck {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .reveal.docs-deck {
        max-width: 1320px;
    }
}

/* Mobile (< 992px): hide the slide deck, show the scrollable article instead. */
.docs-article {
    display: none;
}

@media (max-width: 991.98px) {
    .docs-deck {
        display: none;
    }

    .docs-article {
        display: block;
        max-width: 100%;
        margin: 0 auto;
        padding: 1.25rem 1rem 3rem;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-size: 16px;
        line-height: 1.6;
        overflow-wrap: break-word;
    }

    .docs-article * {
        max-width: 100%;
    }

    .docs-article h1,
    .docs-article h2,
    .docs-article h3,
    .docs-article h4 {
        font-weight: 700;
        letter-spacing: -0.02em;
        margin: 1.5rem 0 0.75rem;
        line-height: 1.3;
    }

    .docs-article h1 {
        font-size: 1.7rem;
        margin-top: 0;
    }

    .docs-article h2 {
        font-size: 1.4rem;
    }

    .docs-article h3 {
        font-size: 1.2rem;
    }

    .docs-article h4 {
        font-size: 1.05rem;
        font-weight: 600;
    }

    .docs-article p {
        margin: 0 0 1rem;
        font-size: 1rem;
    }

    .docs-article ul,
    .docs-article ol {
        margin: 0 0 1rem;
        padding-left: 1.5rem;
    }

    .docs-article li {
        margin-bottom: 0.4rem;
        font-size: 1rem;
        line-height: 1.55;
    }

    .docs-article strong {
        font-weight: 600;
    }

    .docs-article a {
        text-decoration: underline;
        word-break: break-word;
    }

    .docs-article code {
        padding: 0.15em 0.4em;
        font-size: 0.9em;
        border-radius: 4px;
        font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;
        overflow-wrap: break-word;
    }

    .docs-article pre {
        width: 100%;
        margin: 1rem 0;
        border-radius: 8px;
        overflow-x: auto;
    }

    .docs-article pre code {
        display: block;
        padding: 1rem;
        font-size: 0.85rem;
        line-height: 1.5;
        white-space: pre;
    }

    .docs-article blockquote {
        padding: 0.8rem 1.1rem;
        margin: 1rem 0;
        border-left: 4px solid;
        border-radius: 6px;
        font-size: 1rem;
    }

    .docs-article table {
        display: block;
        width: 100%;
        margin: 1rem 0;
        border-collapse: collapse;
        font-size: 0.9rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .docs-article th,
    .docs-article td {
        padding: 0.5rem 0.75rem;
        border: 1px solid;
        white-space: nowrap;
    }

    .docs-article th {
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        font-size: 0.8rem;
    }

    .docs-article img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 1rem 0;
    }

    .docs-article hr {
        margin: 1.5rem 0;
        border: none;
        border-top: 1px solid;
        opacity: 0.5;
    }
}

/* Custom slide content styling */
.reveal .slides {
    text-align: left;
}

.reveal .slides section {
    padding: 2rem 3rem !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

/* Headings - modern styling */
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
    text-transform: none;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.reveal h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reveal h2 {
    font-size: 1.6rem;
    margin-bottom: 0.9rem;
}

.reveal h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.reveal h4 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

/* Paragraphs and lists - better spacing */
.reveal p {
    margin: 0 0 0.8rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.reveal ul,
.reveal ol {
    margin: 0 0 0.8rem;
    padding-left: 1.5rem;
}

.reveal li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    font-size: 0.85rem;
}

.reveal ul li::marker {
    font-size: 0.7rem;
}

/* Strong text */
.reveal strong {
    font-weight: 600;
    opacity: 0.95;
}

/* Links - modern hover effect */
.reveal a {
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.reveal a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.reveal a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Code blocks - modern monospace */
.reveal code {
    padding: 0.15em 0.4em;
    font-size: 0.8em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-weight: 500;
}

.reveal pre {
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0.8rem 0;
    border-radius: 8px;
}

.reveal pre code {
    padding: 1rem;
    max-height: 400px;
    overflow: auto;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Blockquotes - modern card style */
.reveal blockquote {
    padding: 0.8rem 1.2rem;
    margin: 0.8rem 0;
    border-left: 4px solid;
    border-radius: 6px;
    font-style: normal;
    font-size: 0.85rem;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.reveal blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 3rem;
    opacity: 0.1;
    font-family: Georgia, serif;
}

/* Tables - compact and modern */
.reveal table {
    margin: 0.8rem 0;
    border-collapse: collapse;
    font-size: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
}

.reveal th,
.reveal td {
    padding: 0.5rem 0.75rem;
    border: 1px solid;
}

.reveal th {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Images - modern presentation */
.reveal img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: 8px;
    margin: 0.8rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Controls customization - larger and more visible */
.reveal .controls {
    bottom: 2.5rem;
    right: 2rem;
}

.reveal .controls button {
    width: 32px;
    height: 32px;
}

/* Progress bar - thicker and animated */
.reveal .progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
}

.reveal .progress span {
    transition: width 0.5s cubic-bezier(0.26, 0.86, 0.44, 0.985);
}

/* Slide number - modern badge */
.reveal .slide-number {
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 0.4rem 0.7rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    bottom: 2.5rem;
    right: 8rem;
}

/* Slide transitions - smooth animations */
.reveal .slides section {
    transition: transform 0.6s cubic-bezier(0.26, 0.86, 0.44, 0.985),
                opacity 0.6s cubic-bezier(0.26, 0.86, 0.44, 0.985);
}

/* Fragment animations */
.reveal .slides section .fragment {
    transition: all 0.3s ease;
}

/* Light theme (default) */
[data-bs-theme="light"] body:has(.reveal),
html:not([data-bs-theme="dark"]) body:has(.reveal) {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

[data-bs-theme="light"] .reveal,
html:not([data-bs-theme="dark"]) .reveal {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

[data-bs-theme="light"] .reveal .slides section,
html:not([data-bs-theme="dark"]) .reveal .slides section {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    backdrop-filter: blur(10px);
}

[data-bs-theme="light"] .reveal h1,
html:not([data-bs-theme="dark"]) .reveal h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-bs-theme="light"] .reveal h2,
[data-bs-theme="light"] .reveal h3,
[data-bs-theme="light"] .reveal h4,
html:not([data-bs-theme="dark"]) .reveal h2,
html:not([data-bs-theme="dark"]) .reveal h3,
html:not([data-bs-theme="dark"]) .reveal h4 {
    color: #1a202c;
}

[data-bs-theme="light"] .reveal a,
html:not([data-bs-theme="dark"]) .reveal a {
    color: #667eea;
}

[data-bs-theme="light"] .reveal a::after,
html:not([data-bs-theme="dark"]) .reveal a::after {
    background: #667eea;
}

[data-bs-theme="light"] .reveal code,
html:not([data-bs-theme="dark"]) .reveal code {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
}

[data-bs-theme="light"] .reveal pre,
html:not([data-bs-theme="dark"]) .reveal pre {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

[data-bs-theme="light"] .reveal pre code,
html:not([data-bs-theme="dark"]) .reveal pre code {
    background: transparent;
    color: #2d3748;
}

[data-bs-theme="light"] .reveal blockquote,
html:not([data-bs-theme="dark"]) .reveal blockquote {
    background: rgba(102, 126, 234, 0.05);
    border-left-color: #667eea;
    color: #4a5568;
}

[data-bs-theme="light"] .reveal th,
[data-bs-theme="light"] .reveal td,
html:not([data-bs-theme="dark"]) .reveal th,
html:not([data-bs-theme="dark"]) .reveal td {
    border-color: #e2e8f0;
}

[data-bs-theme="light"] .reveal th,
html:not([data-bs-theme="dark"]) .reveal th {
    background: #f7fafc;
    color: #4a5568;
}

[data-bs-theme="light"] .reveal .progress span,
html:not([data-bs-theme="dark"]) .reveal .progress span {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

[data-bs-theme="light"] .reveal .controls button,
html:not([data-bs-theme="dark"]) .reveal .controls button {
    color: #667eea;
}

/* Light theme - mobile article (mirrors the .reveal theming above, FR-4) */
[data-bs-theme="light"] .docs-article,
html:not([data-bs-theme="dark"]) .docs-article {
    color: #2d3748;
}

[data-bs-theme="light"] .docs-article h1,
[data-bs-theme="light"] .docs-article h2,
html:not([data-bs-theme="dark"]) .docs-article h1,
html:not([data-bs-theme="dark"]) .docs-article h2 {
    color: #1a202c;
}

[data-bs-theme="light"] .docs-article a,
html:not([data-bs-theme="dark"]) .docs-article a {
    color: #667eea;
}

[data-bs-theme="light"] .docs-article code,
html:not([data-bs-theme="dark"]) .docs-article code {
    background: rgba(102, 126, 234, 0.1);
    color: #764ba2;
}

[data-bs-theme="light"] .docs-article pre,
html:not([data-bs-theme="dark"]) .docs-article pre {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

[data-bs-theme="light"] .docs-article pre code,
html:not([data-bs-theme="dark"]) .docs-article pre code {
    background: transparent;
    color: #2d3748;
}

[data-bs-theme="light"] .docs-article blockquote,
html:not([data-bs-theme="dark"]) .docs-article blockquote {
    background: rgba(102, 126, 234, 0.05);
    border-left-color: #667eea;
    color: #4a5568;
}

[data-bs-theme="light"] .docs-article th,
[data-bs-theme="light"] .docs-article td,
html:not([data-bs-theme="dark"]) .docs-article th,
html:not([data-bs-theme="dark"]) .docs-article td {
    border-color: #e2e8f0;
}

[data-bs-theme="light"] .docs-article th,
html:not([data-bs-theme="dark"]) .docs-article th {
    background: #f7fafc;
    color: #4a5568;
}

[data-bs-theme="light"] .docs-article hr,
html:not([data-bs-theme="dark"]) .docs-article hr {
    border-top-color: #e2e8f0;
}

/* Dark theme */
[data-bs-theme="dark"] body:has(.reveal) {
    background: linear-gradient(135deg, #1a1d23 0%, #252932 100%);
}

[data-bs-theme="dark"] .reveal {
    background: linear-gradient(135deg, #1a1d23 0%, #252932 100%);
}

[data-bs-theme="dark"] .reveal .slides section {
    background: rgba(37, 41, 50, 0.95);
    color: #e4e6eb;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .reveal h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-bs-theme="dark"] .reveal h2,
[data-bs-theme="dark"] .reveal h3,
[data-bs-theme="dark"] .reveal h4 {
    color: #f7fafc;
}

[data-bs-theme="dark"] .reveal a {
    color: #8b9ef6;
}

[data-bs-theme="dark"] .reveal a::after {
    background: #8b9ef6;
}

[data-bs-theme="dark"] .reveal code {
    background: rgba(139, 158, 246, 0.15);
    color: #c4b5fd;
}

[data-bs-theme="dark"] .reveal pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .reveal pre code {
    background: transparent;
    color: #e4e6eb;
}

[data-bs-theme="dark"] .reveal blockquote {
    background: rgba(139, 158, 246, 0.1);
    border-left-color: #8b9ef6;
    color: #cbd5e0;
}

[data-bs-theme="dark"] .reveal th,
[data-bs-theme="dark"] .reveal td {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .reveal th {
    background: rgba(0, 0, 0, 0.2);
    color: #cbd5e0;
}

[data-bs-theme="dark"] .reveal .progress span {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

[data-bs-theme="dark"] .reveal .controls button {
    color: #8b9ef6;
}

[data-bs-theme="dark"] .reveal .slide-number {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e4e6eb;
}

/* Dark theme - mobile article (mirrors the .reveal theming above, FR-4) */
[data-bs-theme="dark"] .docs-article {
    color: #e4e6eb;
}

[data-bs-theme="dark"] .docs-article h1,
[data-bs-theme="dark"] .docs-article h2 {
    color: #f7fafc;
}

[data-bs-theme="dark"] .docs-article a {
    color: #8b9ef6;
}

[data-bs-theme="dark"] .docs-article code {
    background: rgba(139, 158, 246, 0.15);
    color: #c4b5fd;
}

[data-bs-theme="dark"] .docs-article pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .docs-article pre code {
    background: transparent;
    color: #e4e6eb;
}

[data-bs-theme="dark"] .docs-article blockquote {
    background: rgba(139, 158, 246, 0.1);
    border-left-color: #8b9ef6;
    color: #cbd5e0;
}

[data-bs-theme="dark"] .docs-article th,
[data-bs-theme="dark"] .docs-article td {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .docs-article th {
    background: rgba(0, 0, 0, 0.2);
    color: #cbd5e0;
}

[data-bs-theme="dark"] .docs-article hr {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .reveal h1 {
        font-size: 1.6rem;
    }
    
    .reveal h2 {
        font-size: 1.3rem;
    }
    
    .reveal h3 {
        font-size: 1.1rem;
    }
    
    .reveal .slides section {
        padding: 1.5rem 2rem !important;
    }
    
    .reveal p,
    .reveal li {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .reveal .slides section {
        padding: 1rem 1.5rem !important;
    }
    
    .reveal .controls {
        bottom: 1rem;
        right: 1rem;
    }
    
    .reveal .slide-number {
        bottom: 1rem;
        left: 1rem;
        right: auto;
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
}

/* Print styles */
@media print {
    .reveal .slides section {
        page-break-after: always;
        box-shadow: none;
    }
}
