/* Custom CSS for File Viewer Page */
/* Styling is Desktop First, then Mobile */
/* File Viewer Styles ---------------------------------------------------------*/
.file-page-container {
    padding: 20px 20px;
    box-sizing: border-box;
    height: var(--global-vh-tall);
    width: 80%;
    max-width: var(--global-doc-large);
    overflow-y: hidden;
    /* Prevent this container from scrolling; scrolling is inside the file */
    display: flex;
    flex-direction: column;
    margin: 0px auto;
    /* auto for the left and right centers it horizontally */
}

.file-header {
    text-align: center;
    flex-shrink: 0;
    /* Header takes its natural height */
}

.file-header h1 {
    font-size: 1.2rem;
    color: var(--global-black);
    margin-bottom: 5px;
    /* At 1.2rem, 5px is like 10px margin for text */
}

/* This main content area will now grow to fill available space */
.file-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin: 10px 0px;
    min-height: 0;
    /* Crucial for nested flex containers that grow */
}

.file-viewer-and-button-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.file-viewer-wrapper {
    width: 100%;
    flex-grow: 1;
    display: flex;
    margin-bottom: 10px;
    min-height: 0;
    box-shadow: 0 0px 16px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    /* Optional: adds rounded corners to complement the shadow */
    overflow: hidden;
    /* Ensures the iframe corners also appear rounded if border-radius is used */
}

.file-viewer {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.file-viewer iframe {
    width: 100%;
    height: 100%;
}

/* Button classes for file pages */
.button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0.5em;
}

.btn {
    display: inline-block;
    font-size: 1em;
    padding: 0.25em 0.75em;
    text-decoration: none !important;
    border-radius: 50px;
    /* Rounded corners like in custom_default */
    font-weight: bold;
    border: 1px solid;
    cursor: pointer;
    text-align: center;
    align-self: center;
    width: auto;
    transition: none;
    /* background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; */
}

.btn--primary {
    background-color: var(--custom-color-1);
    color: var(--custom-color-4);
    border-color: var(--custom-color-1);
}

.btn--primary:hover {
    background-color: var(--custom-color-2);
    border-color: var(--custom-color-2);
    color: var(--global-black) !important;
}

.file-additional-content {
    margin-top: 10px;
    padding-top: 10px;
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(100vh - var(--global-vh-tall) - 1em);
    /* Example: limit height if .file-page-container is hidden overflow */
}

/* Default viewer */
#default-file-viewer {
    display: block;
}

#mobile-file-viewer {
    display: none;
}

/* Handles mobile */
@media (max-width: 600px) {
    .file-page-container {
        height: var(--global-vh-medium);
        width: 100%;
        padding: 20px 17px;
    }

    .file-additional-content {
        max-height: calc(100vh - var(--global-vh-medium) - 1em);
    }
}

/* Handles any touch and no hover device like mobile or tablets */
@media (pointer: coarse) and (hover: none) {
    .file-page-container {
        max-width: var(--global-doc-small);
    }

    #default-file-viewer {
        display: none !important;
    }

    #mobile-file-viewer {
        display: block !important;
    }
}

/* Dark Mode Styles */
html[data-theme="dark"] .file-header h1 {
    color: var(--global-white);
}

html[data-theme="dark"] body .btn--primary {
    color: var(--global-black) !important;
}

html[data-theme="dark"] body .btn--primary:hover {
    color: var(--custom-color-4) !important;
}

/* End of File Viewer Styles -------------------------------------------------*/