/* =============================================================================
   reader/css/style.css
   =============================================================================
   Haupt-Stylesheet für den ROTORS ePaper-Reader.
   Eingebunden via: <link rel="stylesheet" href="/css/style.css">
   ============================================================================= */

/* ── RESET & BASIS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%; margin: 0; padding: 0;
    overflow: hidden;
    background: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* ── WOW_BOOK ── */
/* #book vor wow_book-Init verstecken – html.js muss gesetzt sein */
.js #book { margin-left: -10000px; }
#book.wowbook { margin: auto; }

/* wow_book container: Platz für Header (44px) und Controls (75px) */
.wowbook-container {
    background: #1a1a2e;
    margin-top: 44px !important;
    height: calc(100vh - 44px - 75px) !important;
}

/* ── HEADER ── */
#reader-header {
    position: fixed;
    top: 0; left: 0; right: 0; height: 44px;
    background: #12121f;
    border-bottom: 1px solid #2a2a4a;
    display: flex; align-items: center; padding: 0 16px; gap: 10px;
    z-index: 10000;
}
#pub-label {
    font-size: 10px; color: #5ba4d4; text-transform: uppercase;
    letter-spacing: 1.5px; white-space: nowrap; font-weight: 700;
}
#header-sep { color: #2a2a4a; flex-shrink: 0; font-size: 14px; }
#title-label {
    font-size: 13px; font-weight: 600; color: #e0e0e0;
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── CONTROLS-LEISTE ── */
#reader-controls {
    position: fixed;
    bottom: 0; left: 0; right: 0; height: 75px;
    background: #12121f;
    border-top: 1px solid #1e1e30;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 25px;
    z-index: 10000;
    opacity: 0; transition: opacity 0.4s;
}
.ctrl-group { display: flex; align-items: center; gap: 5px; }
.ctrl-btn {
    width: 48px; height: 48px;
    background: none; border: none; border-radius: 10px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s; color: #8899bb; padding: 0;
}
.ctrl-btn:hover  { background: #1e2a40; color: #ffffff; }
.ctrl-btn:active { background: #253450; }
.ctrl-btn svg { width: 23px; height: 23px; fill: currentColor; }
.ctrl-sep { width: 1px; height: 28px; background: #1e1e30; margin: 0 8px; }
#ctrl-pages {
    font-size: 16px; color: #8899bb;
    font-variant-numeric: tabular-nums;
    min-width: 113px; text-align: center;
}

/* ── LADESCREEN ── */
#ladescreen {
    position: fixed; inset: 0; z-index: 99999;
    background: #12121f;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 20px;
}
#ladescreen .lade-cover {
    height: 120px; border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6); margin-bottom: 4px;
}
#ladescreen .lade-titel { font-size: 14px; font-weight: 600; color: #e0e0e0; }
#ladescreen .lade-status { font-size: 12px; color: #5ba4d4; min-height: 18px; }
#lade-balken-wrap {
    width: 260px; height: 5px;
    background: #2a2a4a; border-radius: 999px; overflow: hidden;
}
#lade-balken {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #5ba4d4, #3d8bbf);
    border-radius: 999px; transition: width 0.4s ease;
}

/* ── FEHLERSEITE ── */
.wowbook-container { background: #1a1a2e; }

/* =============================================================================
   RESPONSIVE – nur Smartphones (max. 480px)
   Desktop-Layout bleibt vollständig unverändert.
   ============================================================================= */
@media (max-width: 480px) {

    /* 1. Header: zweizeilig statt einspaltig
          Zeile 1: Pub-Label | Titel
          Zeile 2: Vorschau-Info + Vollzugriff-Button               */
    #reader-header {
        height: auto !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        padding: 5px 12px !important;
        gap: 4px 8px !important;
    }
    #title-label {
        flex-basis: 100% !important;
        order: 1 !important;
    }
    #pub-label    { order: 0; }
    #header-sep   { order: 0; }
    /* Vorschau-Span und Vollzugriff-Link */
    #reader-header > span:not(#pub-label):not(#header-sep) { order: 2; }
    #reader-header > a   { order: 2; }
    #page-info-header    { display: none !important; }

    /* 2. wowbook-Container: höher, Controls schlanker */
    .wowbook-container {
        margin-top: 20px !important;
        height: calc(100vh - 68px - 48px) !important;
    }

    /* 3. Controls: zentriert, 48px hoch */
    #reader-controls {
        height: 48px !important;
        justify-content: center !important;
        padding: 0 8px !important;
    }

    /* Thumbnails + Fullscreen + Erste/Letzte Seite ausblenden */
    #ctrl-first,
    #ctrl-last,
    .ctrl-btn[title="Seitenübersicht"],
    .ctrl-btn[title="Vollbild"] {
        display: none !important;
    }

    .ctrl-btn {
        width: 40px !important;
        height: 40px !important;
    }
    #ctrl-pages {
        font-size: 12px !important;
        min-width: 64px !important;
    }
}
