/**
 * Ahmet Yesevi Üniversitesi - E-Kitap Çift Sayfa (Flipbook / Spread) Okuyucu
 */
@charset "UTF-8";

.book-reader-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: #0d131c;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    user-select: none;
    overflow: hidden;
}

.book-reader-modal.open {
    opacity: 1;
    visibility: visible;
}

/* -------------------------------------------------------------
   ÜST KONTROL ÇUBUĞU (TOOLBAR)
   ------------------------------------------------------------- */
.book-toolbar {
    height: 56px;
    background: #141f2e;
    border-bottom: 1.5px solid #cba153;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.book-toolbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.book-brand-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(203, 161, 83, 0.12);
    border: 1px solid rgba(203, 161, 83, 0.3);
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    color: #dfbb73;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.book-title-display {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-toolbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reader-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    cursor: pointer;
    transition: all 0.18s ease;
}

.reader-tool-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #dfbb73;
    border-color: #cba153;
}

.reader-tool-btn.active {
    background: #cba153;
    color: #1a1200;
    border-color: #dfbb73;
}

.reader-tool-btn.gold {
    background: linear-gradient(135deg, #cba153, #b58309);
    color: #1a1200;
    border-color: #dfbb73;
}

.reader-tool-btn.gold:hover {
    filter: brightness(1.1);
}

.book-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.reader-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.reader-close-btn:hover {
    background: #8d4e58;
    color: #ffffff;
    transform: rotate(90deg);
}

/* -------------------------------------------------------------
   ANA KİTAP SAHNESİ (BOOK STAGE)
   ------------------------------------------------------------- */
.book-stage-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 60px;
    overflow: auto;
    background: radial-gradient(circle at 50% 45%, #182434 0%, #0d131c 85%);
}

/* Sayfa Çevirme Okları */
.page-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 72px;
    background: rgba(20, 31, 46, 0.7);
    border: 1.5px solid rgba(203, 161, 83, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    border-radius: 10px;
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.page-nav-arrow:hover:not(:disabled) {
    background: rgba(203, 161, 83, 0.9);
    color: #1a1200;
    border-color: #dfbb73;
    transform: translateY(-50%) scale(1.08);
}

.page-nav-arrow:disabled {
    opacity: 0.18;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
}

.page-nav-arrow.prev {
    left: 18px;
}

.page-nav-arrow.next {
    right: 18px;
}

/* -------------------------------------------------------------
   KİTAP ÇİFTİ / TEK SAYFA BİÇİMİ
   ------------------------------------------------------------- */
.book-viewport {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    perspective: 1600px;
    perspective-origin: center center;
    transition: transform 0.2s ease;
}

/* Çift Sayfa Kitap Gövdesi */
.book-spread-container {
    display: flex;
    position: relative;
    background: #ffffff;
    border-radius: 5px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
    transform-style: preserve-3d;
}

/* Tek Sayfa (Kapak veya Arka Kapak) */
.book-spread-container.single-cover {
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.book-page-wrap {
    position: relative;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1), box-shadow 0.28s ease;
    user-select: none;
}

/* Sol Sayfa (Spine Sağa Doğru) */
.book-page-wrap.left-page {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    box-shadow: inset -6px 0 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.book-page-wrap.left-page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.18) 100%);
    pointer-events: none;
}

/* Sağ Sayfa (Spine Sola Doğru) */
.book-page-wrap.right-page {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    box-shadow: inset 6px 0 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.book-page-wrap.right-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.18) 100%);
    pointer-events: none;
}

/* Tek Sayfa Modu / Kapak */
.book-page-wrap.single-page {
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* -------------------------------------------------------------
   SAYFA YAN SINIRLARI & KIVRILMA EFEKTİ (PAGE CURL & EDGE TURN)
   ------------------------------------------------------------- */
.book-edge-turn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(65px, 20%, 95px);
    z-index: 25;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

.book-edge-turn.edge-right {
    right: 0;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
}

.book-edge-turn.edge-left {
    left: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
}

/* Sayfa Köşesi Kıvrılma Efekti (Sadece Üzerine Gelince Alttan Açılacak Tarafa Doğru) */
.edge-curl-corner {
    position: absolute;
    width: 68px;
    height: 68px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.22s ease, visibility 0.22s ease;
    z-index: 30;
}

.edge-right .corner-bottom {
    bottom: 0;
    right: 0;
    transform: scale(0.2);
    transform-origin: bottom right;
}

.edge-left .corner-bottom {
    bottom: 0;
    left: 0;
    transform: scale(0.2);
    transform-origin: bottom left;
}

/* Üzerine gelindiğinde açılacak tarafa doğru alttan hafifçe kıvrıl */
.book-edge-turn:hover .corner-bottom,
.book-edge-turn.is-hovered .corner-bottom,
.book-edge-turn:focus-visible .corner-bottom {
    opacity: 1;
    visibility: visible;
    transform: scale(1.1);
}

.curl-svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.38));
}

/* Kenara Gelindiğinde Açılan İpucu Rozeti */
.edge-curl-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(203, 161, 83, 0.65);
    color: #dfbb73;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.25, 1);
    pointer-events: none;
    white-space: nowrap;
    z-index: 26;
}

.book-edge-turn:hover .edge-curl-hint,
.book-edge-turn:focus-visible .edge-curl-hint {
    opacity: 1;
    transform: scale(1);
}

/* Sayfa Çevirme 3D Animasyonları */
.book-page-wrap.flipping-out-next {
    animation: flipOutNext 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 30;
}

@keyframes flipOutNext {
    0% { transform: perspective(1400px) rotateY(0deg); }
    100% { transform: perspective(1400px) rotateY(-80deg); opacity: 0.25; }
}

.book-page-wrap.flipping-out-prev {
    animation: flipOutPrev 0.24s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 30;
}

@keyframes flipOutPrev {
    0% { transform: perspective(1400px) rotateY(0deg); }
    100% { transform: perspective(1400px) rotateY(80deg); opacity: 0.25; }
}

.book-page-wrap.flipping-in-next {
    animation: flipInNext 0.24s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes flipInNext {
    0% { transform: perspective(1400px) rotateY(60deg); opacity: 0.3; }
    100% { transform: perspective(1400px) rotateY(0deg); opacity: 1; }
}

.book-page-wrap.flipping-in-prev {
    animation: flipInPrev 0.24s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes flipInPrev {
    0% { transform: perspective(1400px) rotateY(-60deg); opacity: 0.3; }
    100% { transform: perspective(1400px) rotateY(0deg); opacity: 1; }
}

/* Merkez Kitap Dikiş / Katlanma Çizgisi */
.book-spine-crease {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.5) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(0, 0, 0, 0.5) 55%,
        rgba(0, 0, 0, 0.25) 100%
    );
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

/* Canvas Elemanı */
.book-canvas {
    display: block;
    background: #ffffff;
}

/* -------------------------------------------------------------
   ALT KONTROL VE İLERLEME ÇUBUĞU (SCRUBBER & FOOTER)
   ------------------------------------------------------------- */
.book-bottom-bar {
    height: 52px;
    background: #141f2e;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-shrink: 0;
    z-index: 20;
}

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

.spread-status-text {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
}

.spread-status-text b {
    color: #dfbb73;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
}

/* İlerleme Kaydırıcı (Scrubber) */
.book-scrubber-wrap {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.book-scrubber-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.book-scrubber-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #dfbb73;
    border: 2px solid #141f2e;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}

.book-scrubber-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #ffffff;
}

.reader-bottom-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jump-page-input {
    width: 52px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    outline: none;
}

.jump-page-input:focus {
    border-color: #cba153;
}

/* Yükleme Animasyonu */
.reader-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 19, 28, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.reader-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.reader-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(203, 161, 83, 0.2);
    border-top-color: #dfbb73;
    border-radius: 50%;
    animation: readerSpin 0.8s linear infinite;
}

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

.reader-loading-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .book-stage-area {
        padding: 12px 16px;
    }
    .page-nav-arrow {
        width: 36px;
        height: 54px;
    }
    .page-nav-arrow.prev { left: 6px; }
    .page-nav-arrow.next { right: 6px; }
    .book-scrubber-wrap { display: none; }
    .book-title-display { max-width: 180px; }
}
