/**
 * Layout Styles for PAM Analyzer
 * Sticky footer and centered content
 */

/* Ensure html and body take full height */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container should grow to push footer down and center content */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for Firefox */
}

/* Center the main selection container vertically in available space */
.container > .main-selection-container {
    margin: auto 0; /* Centers vertically between header and footer */
    flex-shrink: 0;
}

/* Footer always at bottom */
.footer {
    margin-top: 0 !important;
    flex-shrink: 0;
}

/* When results are shown or file upload container is visible, align to top */
.container:has(#results-container:not(:empty)),
.container:has(.file-upload-container:not([style*="display: none"])) {
    justify-content: flex-start;
}

.container:has(#results-container:not(:empty)) > .main-selection-container,
.container:has(.file-upload-container:not([style*="display: none"])) > .main-selection-container {
    margin: 0 0 var(--spacing-lg, 2rem) 0;
}

/* Alternative: Use class-based approach for browsers without :has() support */
.container.has-results {
    justify-content: flex-start;
}

.container.has-results > .main-selection-container {
    margin: 0 0 var(--spacing-lg, 2rem) 0;
}
