:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #cf2e2e;
    --panel-bg: #2d2d2d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

input[type="file"] {
    display: none;
}

#file-name {
    font-size: 0.9rem;
    color: #aaa;
}

.container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 1500px;
}

/* Flipbook Styles */
.stf__wrapper {
    margin: 0 auto;
}

.page {
    background-color: white;
    box-shadow: inset -1px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.page canvas {
    background-color: white;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    transition: opacity 0.5s;
    pointer-events: none;
    opacity: 1;
}

.loading-overlay.hidden {
    opacity: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer Styles */
footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #ffffff;
    color: #333;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999 !important;
    height: 80px;
}

.footer-left img {
    height: 25px;
    width: auto;
    padding-right: 15px;
    display: block;
    /* Removes potential whitespace issues with anchor */
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: right;
    font-size: 0.9rem;
}

.contact-item p {
    margin: 2px 0;
    line-height: 1.2;
}

.vertical-divider {
    width: 1px;
    height: 40px;
    background-color: #ddd;
}

/* Adjust container to not start behind footer */
.container {
    padding-bottom: 100px;
    /* Space for footer */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        overflow-y: auto !important;
        height: auto !important;
    }

    footer {
        flex-direction: column;
        height: auto;
        padding: 5px 15px;
        /* Minimized vertical padding */
        gap: 5px;
        text-align: center;
        position: relative !important;
        /* Scroll to see */
        bottom: auto !important;
        z-index: 10 !important;
        /* No need for high z-index if static */
    }

    .footer-left img {
        height: 22px;
        /* Further reduced from 26px */
        margin-bottom: 2px;
    }

    .footer-right {
        flex-direction: column;
        gap: 2px;
        text-align: center;
        font-size: 0.7rem;
        /* Smaller text */
        line-height: 1.1;
    }

    .vertical-divider {
        display: none;
    }

    .container {
        padding-bottom: 0;
        /* JS will handle sizing, but let's keep some safe area if needed */
        /* Actually, if footer is fixed, we just need the content to fit in the window minus footer */
        height: 100vh;
        min-height: 100vh;
        /* Ensure container takes full height */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* Align top so we can pad/margin consistently */
        padding-top: 10px;
    }

    .zoom-controls {
        top: 10px;
        right: 10px;
    }

    /* Mobile Navigation Buttons */
    .mobile-nav {
        display: flex !important;
        /* Force show on mobile */
        position: fixed;
        bottom: 160px;
        /* Position above footer */
        left: 0;
        width: 100%;
        justify-content: space-between;
        padding: 0 10px;
        pointer-events: none;
        /* Let clicks pass through container */
        z-index: 1001;
    }

    .nav-btn {
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.4);
        color: white;
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.2rem;
        backdrop-filter: blur(4px);
    }
}

/* Default state for mobile nav */
.mobile-nav {
    display: none;
}

/* Fullscreen / Zoom Styles */
.zoom-controls {
    position: fixed;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 200;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.3s;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.zoom-btn i {
    font-size: 1.2rem;
}