/* Universal Viewport-Aware CSS for All Slides */
/* Ensures all slides display within screen with margins and scrollability */

:root {
    --slide-margin: 15px;
    --max-slide-width: calc(100vw - (2 * var(--slide-margin)));
    --max-slide-height: calc(100vh - (2 * var(--slide-margin)));
}

/* Universal body styling for all slides */
body {
    margin: 0;
    padding: var(--slide-margin);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-start, #0a0e27) 0%, var(--bg-end, #1a1f3a) 100%);
    color: #fff;

    /* Viewport-aware sizing */
    min-height: 100vh;
    max-height: 100vh;
    width: 100vw;

    /* Enable scrolling when content overflows */
    overflow-x: hidden;
    overflow-y: auto;

    /* Center content */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to allow scrolling */
    padding-top: var(--slide-margin);
}

/* Universal container styling */
.container {
    width: 100%;
    max-width: var(--max-slide-width);
    min-height: calc(100vh - (2 * var(--slide-margin)));
    max-height: none; /* Remove max-height restriction */

    /* Allow content to expand beyond viewport if needed */
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Add padding for better spacing */
    padding: 15px;
    box-sizing: border-box;

    /* Center text by default */
    text-align: center;
}

/* Wrapper for complex slides */
.wrapper {
    width: 100%;
    max-width: var(--max-slide-width);
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

/* Complex slide sections */
.ecosystem-container, .features-summary, .description-section {
    margin: 10px auto !important;
}

/* Compact headers for complex slides */
.wrapper h1 {
    margin-bottom: 5px !important;
    font-size: clamp(28px, 5vw, 40px) !important;
}

.wrapper h2 {
    margin-bottom: 15px !important;
    font-size: clamp(14px, 3vw, 18px) !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    :root {
        --slide-margin: 10px;
    }

    body {
        padding: var(--slide-margin);
    }

    .container {
        padding: 15px;
    }
}

@media (max-height: 600px) {
    :root {
        --slide-margin: 10px;
    }

    body {
        padding-top: var(--slide-margin);
        align-items: flex-start;
    }

    .container {
        justify-content: flex-start;
        padding-top: 10px;
    }
}

/* Ensure all content elements are responsive */
h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Make images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Ensure cards and grids are responsive */
.card, .testimonial, .feature {
    box-sizing: border-box;
    max-width: 100%;
}

/* Grid layouts should wrap on smaller screens */
.grid, .stats, .features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* Background logo positioning */
.bg-logo {
    position: fixed;
    top: var(--slide-margin);
    right: var(--slide-margin);
    width: 120px;
    height: auto;
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar styling for better UX */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Ensure terminal/code blocks are scrollable */
.terminal, pre, code {
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* Print-friendly adjustments */
@media print {
    body {
        overflow: visible;
        max-height: none;
    }

    .container {
        max-height: none;
        min-height: auto;
    }
}
