/* Atatürk Üniversitesi E-Kitap — StPageFlip + PDF.js Okuyucu Stilleri */
:root {
    --fb-bg: #151426;
    --fb-bar: #1f1c3d;
    --fb-gold: #e2b87f;
    --fb-text: #f3f4f6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--fb-bg);
    color: var(--fb-text);
    font-family: 'Ubuntu', 'Open Sans', sans-serif;
    overflow: hidden;
}

.reader-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.reader-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 18px;
    background: var(--fb-bar);
    border-bottom: 3px solid var(--fb-gold);
    z-index: 30;
}

.reader-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.reader-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.reader-back-btn:hover {
    background: var(--fb-gold);
    color: #151426;
}

.reader-book-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.r-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 2px;
}

.r-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    border: 1px solid rgba(226, 184, 127, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.r-btn:hover,
.r-btn.active {
    background: var(--fb-gold);
    color: #151426;
    border-color: var(--fb-gold);
}

.page-jump-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    padding: 0 10px;
    height: 36px;
    font-size: 13px;
}

.page-jump-wrap input {
    width: 48px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--fb-gold);
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    outline: none;
}

.reader-stage-wrap {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 16px 72px;
    background: radial-gradient(circle at center, #25224b 0%, #111020 100%);
    user-select: none;
    touch-action: none;
}

.stage-nav-btn {
    position: fixed;
    top: 52%;
    transform: translateY(-50%);
    width: 46px;
    height: 68px;
    border: 1px solid rgba(226, 184, 127, 0.4);
    border-radius: 6px;
    background: rgba(31, 28, 61, 0.88);
    color: var(--fb-gold);
    font-size: 20px;
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.stage-nav-btn:hover {
    background: var(--fb-gold);
    color: #151426;
}

.stage-nav-prev { left: 14px; }
.stage-nav-next { right: 14px; }

/* Zoom + Pan + Rotate Container */
.zoom-container {
    transform-origin: center center;
    transition: transform 0.22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.zoom-container.dragging {
    transition: none;
}

.book-center-shift {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* Pan Overlay: active when zoomed > 100% or pan mode enabled */
.pan-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    cursor: grab;
    background: transparent;
}

.pan-overlay.active {
    display: block;
}

.pan-overlay.dragging {
    cursor: grabbing;
}

/* StPageFlip page styling */
.pf-page {
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.06);
}

.pf-page.--left {
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset -12px 0 24px -10px rgba(0, 0, 0, 0.18);
}

.pf-page.--right {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 12px 0 24px -10px rgba(0, 0, 0, 0.18);
}

.pf-page-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.pf-page-inner canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
    position: static !important;
    pointer-events: none;
}

.page-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
    gap: 8px;
    width: 100%;
    height: 100%;
    background: #fcfcfc;
}

.page-num-stamp {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 10px;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.85);
    padding: 1px 5px;
    border-radius: 2px;
    pointer-events: none;
}

.stf__parent {
    filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.55));
}

.reader-loader {
    position: absolute;
    inset: 0;
    background: rgba(18, 17, 34, 0.94);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 40;
    text-align: center;
    padding: 20px;
}

.loader-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(226, 184, 127, 0.2);
    border-top-color: var(--fb-gold);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

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

.loader-progress {
    width: 240px;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--fb-gold);
    transition: width 0.2s ease;
}

.reader-footerbar {
    flex: 0 0 auto;
    padding: 7px 18px;
    background: #100f1e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
}

@media (max-width: 768px) {
    .reader-topbar { padding: 8px 10px; }
    .reader-book-title, .r-sep { display: none; }
    .reader-stage-wrap { padding: 12px 10px; }
    .stage-nav-btn { width: 36px; height: 48px; font-size: 16px; }
    .stage-nav-prev { left: 4px; }
    .stage-nav-next { right: 4px; }
}
