/* book.css - Continuous Scroll & Virtual Pagination */

:root {
    --bg-paper: #fdfbf7;
    /* Göz yormayan kitap kağıdı rengi */
    --text-ink: #2b2b2b;
    --accent-gold: #d4af37;
    --marker-color: #666666;
    --font-reading: 'Crimson Text', serif;
    --font-ui: 'Lato', sans-serif;
}

/* Genel Okuma Alanı */
body.reading-mode {
    background-color: #1a1a1a;
    /* Sinema modu arka planı */
    margin: 0;
    overflow-y: auto;
    /* Tarayıcının kendi scrollbarını kullan */
}

/* Kağıt Şeridi */
.story-wrapper {
    max-width: 800px;
    /* İdeal okuma genişliği */
    margin: 40px auto;
    background-color: var(--bg-paper);
    padding: 60px 80px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
    position: relative;
}

/* Tipografi */
.story-content {
    font-family: var(--font-reading);
    font-size: 1.35rem;
    /* Rahat okuma boyutu */
    line-height: 1.8;
    color: var(--text-ink);
    text-align: justify;
    /* Kitap hissi */
}


.story-content p {
    margin-bottom: 0.0rem;
}

.story-header {
    min-height: 85vh;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.story-header.no-image {
    align-items: center;
    display: flex;
    justify-content: center;
}



/* Başlık Alanı */
.chapter-header {
    text-align: center;
    padding-bottom: 2rem;
}

.summary-header {
    font-family: var(--font-reading);
    text-align: center;
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    color: var(--text-ink);
    font-size: 1.2rem;
}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #111;
    margin: 1rem 0;
    line-height: 1.2;
    box-sizing: border-box;
}

.story-meta {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
}

.story-image {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    filter: sepia(15%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.story-text-part {
    min-height: 110vh;
    min-width: 55vh;
}

/* --- AKILLI SAYFA AYRAÇLARI --- */
.page-break-marker {
    position: relative;
    width: 100%;
    height: 60px;
    /* Ayraç için yer açalım */
    margin: 4rem 0 4rem 0;
    /* Üstten ve alttan boşluk */

    /* Çizgiyi ::after ile yapacağız, o yüzden burada border yok */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1. BİTEN SAYFA NUMARASI (Sağ Alt Köşe) */
.page-break-marker::before,
.last-page-marker::before {
    content: attr(data-prev-page);
    /* JS'ten gelen '1' */
    position: absolute;
    top: -10px;
    /* Çizginin biraz üstünde */
    right: 0;
    /* En sağa yasla */

    font-family: 'Playfair Display', serif;
    /* Kitap fontu */
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-ink);
    /* Metin rengiyle aynı olsun */
    opacity: 0.8;
}

.last-page-marker {
    position: relative;
    width: 100%;
    height: 60px;
    /* Sayfa sonu boşluğu */
    margin-top: 2rem;
    display: block;
    /* Görünür olduğundan emin olalım */
}

/* 2. YENİ SAYFA ÇİZGİSİ VE YAZISI (Ortada) */
.page-break-marker::after {
    content: "- " attr(data-curr-page) " -";
    /* "- Sayfa 2 -" */
    position: absolute;
    top: 50%;
    /* Kutunun ortası */
    width: 120%;
    text-align: center;

    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--marker-color);
    /* Altın rengi */
    opacity: 0.5;
    box-sizing: unset;
    /* Yanlarda çizgi efekti için border kullanabiliriz veya linear-gradient */
    /* Ama senin istediğin sade görünüm için şu an sadece yazı yeterli */
    /* İstersen altına ince bir çizgi çekelim: */
    border-bottom: 1px dashed rgba(163, 133, 36, 0.432);
    line-height: 0.1em;
    /* Çizgiyi yazının ortasına al */
}

/* Mobilde sağdaki numara çok kenara yapışmasın */
@media (max-width: 768px) {

    .page-break-marker::before,
    .last-page-marker {
        right: 10px;
        font-size: 1rem;
    }
}

/* Mobilde numara içeride görünsün */
@media (max-width: 1000px) {
    .story-wrapper {
        padding: 40px 25px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .page-break-marker::after {
        right: auto;
        position: relative;
        background: transparent;
        color: var(--marker-color);
        font-weight: bold;
        opacity: 1;
        content: "- " attr(data-page-display) " -";
    }
}

/* --- SABİT UI ELEMANLARI --- */

/* Geri Butonu */
.fixed-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
    z-index: 100;
}

.fixed-back-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

/* Sağ Alt Sabit Sayfa Göstergesi */
.fixed-page-indicator {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s;
}

/* Toast Mesajı (Kaldığın yerden devam ediliyor) */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gold);
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.toast-message.show {
    opacity: 1;
}

/* --- MEDIA PLAYER NAVİGASYON (GOLD/BLACK) --- */


.page-controls-wrapper {
    position: fixed;
    bottom: 5%;
    left: 50%;
    /* 10% yerine 50% yaparak tam yatay merkezleme sağlar */
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    /* transition-opacity sınıfı Tailwind'den gelmiyorsa buraya ekleyin: */
    transition: opacity 0.3s ease-in-out;
}

.opacity-0 {
    opacity: 0;
}

.pointer-events-none {
    pointer-events: none;
    /* Gizliyken tıklamaları engeller */
}

/* Ana Kapsayıcı (Hap Şekli) */
.media-player-bar {
    background: rgba(10, 10, 10, 0.9);
    /* Simsiyah ama hafif transparan */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* İnce Altın Çerçeve */
    border-radius: 30px;
    /* Tam yuvarlak köşeler */
    padding: 5px 15px;

    display: flex;
    align-items: center;
    gap: 15px;
    /* Elemanlar arası boşluk */

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        /* Gölge */
        0 0 15px rgba(212, 175, 55, 0.1);
    /* Hafif Altın Parıltısı */

    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-player-bar:hover {
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(212, 175, 55, 0.2);
    /* Hoverda parlasın */
}

/* Butonlar (Küçük ve İnce) */
.player-btn {
    background: transparent;
    border: none;
    color: #666;
    /* Pasif hali gri */
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
}

.player-btn svg {
    stroke-width: 2.5;
    /* Oklar biraz daha belirgin */
}

.player-btn:hover {
    color: var(--accent-gold);
    /* Üzerine gelince altın olsun */
    background: rgba(212, 175, 55, 0.1);
}

.player-btn:active {
    transform: scale(0.9);
}

/* Sayfa Yazıları (Monospace fontlar player gibi durur) */
.player-info {
    font-family: 'Lato', sans-serif;
    /* Veya 'Courier New' */
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 60px;
    /* Sabit genişlik, titremesin */
    justify-content: center;
}

.current-page {
    color: var(--accent-gold);
    /* Aktif sayfa Altın */
}

.separator {
    color: #444;
    /* Ayraç silik */
    font-weight: 300;
}

.total-page {
    color: #888;
    /* Toplam sayfa gri */
}

@media (max-width: 1024px) {
    .page-controls-wrapper {
        bottom: 10%;
        left: 50%;
        width: auto;
    }

    .media-player-bar {
        padding: 5px 12px;
        gap: 10px;
    }
}

/* -

/* Mobilde ekranın altına daha yakın olsun */
@media (max-width: 768px) {
    .page-controls-wrapper {
        bottom: 10%;
        left: 50%;
        width: auto;
    }

    .media-player-bar {
        padding: 5px 12px;
        gap: 10px;
    }
}

/* --- GÜNCELLENMİŞ MEDIA PLAYER BAR --- */

.media-player-bar {
    /* Eski ayarların aynısı kalsın, sadece padding'i biraz artırabiliriz */
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 40px;
    /* Daha oval */
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 10px;

    /* Mobilde taşmayı önlemek için */
    max-width: 90vw;
    overflow-x: auto;
    /* Çok buton olursa kaydırılabilir */
}

/* Ayraç Çizgisi (Vertical Divider) */
.player-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 5px;
}

/* Buton İkonları */
.player-btn svg {
    opacity: 0.8;
    transition: all 0.2s;
}

.player-btn:hover svg {
    opacity: 1;
    color: var(--accent-gold);
    transform: scale(1.1);
}

/* İndirme butonu biraz daha özel olsun */
.player-btn[title="Dosyayı İndir (PDF/Word)"]:hover svg {
    color: #4ade80;
    /* İndirme yeşili */
}

/* Kütüphane butonu */
.player-btn[title="Kütüphaneye Dön"]:hover svg {
    color: #f87171;
    /* Çıkış kırmızısı */
}