/* 
   collectprayers.net — Flipbook Magazine Styles
   Ethereal, dark, and smooth transitions.
*/

:root {
    --bg-color: #000000;
    --accent-color: #ffffff;
    --ui-bg: rgba(255, 255, 255, 0.05);
    --ui-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

body {
    background-color: var(--bg-color);
    color: var(--accent-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', 'Helvetica Neue', sans-serif;
}

#magazine-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding-top: 30px;
    background: var(--bg-color);
}

#magazine-viewport:fullscreen {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: black !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

#magazine-viewport:fullscreen #magazine-container {
    width: 95vw;
    height: 85vh; /* Lasse Platz für die Buttons unten */
    display: flex;
    flex-direction: column;
    align-items: stretch; /* WICHTIG: Erlaubt dem Buch die volle Breite einzunehmen */
    justify-content: center;
    padding: 0;
    margin: 0;
}

#magazine-viewport:fullscreen .flip-book {
    flex-grow: 1; /* Verhindert das Kollabieren der Höhe */
    margin: 0 auto !important; /* Zentriert im Stretch-Modus */
    width: 100%;
}

#magazine-viewport:fullscreen .controls {
    position: absolute !important;
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    z-index: 2000 !important;
}

#magazine-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
    height: 75vh; /* Standard-Höhe: Lass Platz für Header und Controls */
}

.flip-book {
    box-shadow: var(--shadow);
    background-color: #050505;
    transition: opacity 0.5s ease;
}

.page {
    background-color: #000;
    overflow: hidden;
}

/* UI Controls */
.controls {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 100;
}

.btn-nav {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.btn-nav:hover {
    background: var(--accent-color);
    color: black;
}

.btn-nav:focus {
    outline: none;
}

.page-info {
    font-size: 14px;
    letter-spacing: 0.2em;
    color: #555;
    text-transform: uppercase;
}

/* Loading Overlay */
#loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: black;
    z-index: 500;
    transition: opacity 0.8s ease;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    #magazine-container {
        padding: 0;
        height: 82vh; /* Container-Größe beibehalten */
        align-items: center;
        justify-content: flex-start; /* Alles weiter nach oben ziehen */
        padding-top: 5vh; /* Nav-Abstand exakt um die Hälfte von 10vh verringert */
        margin-top: 0; 
    }

    .flip-book {
        width: 90% !important; /* 5% Abstand zum linken und rechten Bildschirmrand! */
        /* Wir reduzieren die maximale Basis für die Rechnung leicht, damit es im flex-start nicht aneckt */
        max-width: calc(75vh * (281 / 375)) !important;
        aspect-ratio: 281 / 375 !important;
        height: auto !important;
        margin: 0 auto;
    }

    .controls {
        gap: 8px; /* Weniger Platz zwischen Buttons */
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }

    .btn-nav {
        padding: 8px 12px;
        font-size: 11px;
    }

    .page-info {
        font-size: 11px;
        white-space: nowrap !important; /* Stoppt Umbrüche beim Seiten-Zähler */
        letter-spacing: 0.1em;
    }

    #fs-btn {
        display: none !important; /* Fullscreen-Button weg auf Mobile */
    }
}