/**
 * Slide Display Component Styles
 *
 * Shared styles for slide container, screenshot, and layout.
 * Used in both recording editor and demo viewer.
 */

/* Slide Container */
.slide-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    height: 100%;
}

/* Screenshot Container */
.screenshot-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    align-items: flex-start;
}

/* Step Number Display */
.step-number-display {
    font-size: 14px;
    font-weight: 500;
    color: #6F7285;
    margin-bottom: 8px;
    text-align: left;
}

/* Screenshot Wrapper */
.screenshot-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Screenshot Image */
.screenshot-image {
    max-width: 100%;
    max-height: calc(100vh - 64px - 40px - 32px - 30px); /* viewport - top toolbar - toolbar - padding - step number */
    min-width: 200px;  /* Minimum size for readability */
    min-height: 200px; /* Minimum size for readability */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 0 0 8px 8px;
    flex-shrink: 1;
}

/* Responsive adjustments for desktop */
@media (min-width: 1024px) {
    .screenshot-image {
        max-width: min(calc(100vw - 220px - 64px), 1400px);
    }
}

/* Responsive adjustments for tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .screenshot-image {
        max-width: calc(100vw - 220px - 48px);
    }

    .screenshot-container {
        max-height: calc(100vh - 80px);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 767px) {
    .screenshot-image {
        max-width: calc(100vw - 220px - 32px);
        max-height: calc(100vh - 64px - 36px - 32px - 26px); /* Adjusted for mobile toolbar */
    }

    .screenshot-container {
        max-height: calc(100vh - 70px);
    }

    .step-number-display {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* Viewer-specific overrides - Use SAME constraints as editor for consistent coordinate mapping */
.demo-viewer .screenshot-image {
    max-width: calc(100vw - 220px - 32px); /* Match editor mobile layout */
}

@media (min-width: 768px) {
    .demo-viewer .screenshot-image {
        max-width: calc(100vw - 220px - 48px); /* Match editor tablet layout */
    }
}

@media (min-width: 1024px) {
    .demo-viewer .screenshot-image {
        max-width: min(calc(100vw - 220px - 64px), 1400px); /* Match editor desktop layout */
    }
}

/* Accessibility */
.screenshot-image:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}
