:root {
    --bg-color: #FFF9F2; 
    --text-color: #333333;
    --primary-color: #FF8C00;
    --accent-color: #FF6B6B;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Nunito', sans-serif;
    background-color: #222; 
    color: var(--text-color);
    overflow: hidden; /* Sitenin dışına taşmayı engeller */
    width: 100%;
    height: 100dvh; /* Mobilde adres çubuğu sorununu çözer */
}

/* 3D KİTAP MİMARİSİ */
#book-container {
    width: 100%;
    height: 100%;
    perspective: 2500px; 
    position: relative;
    overflow: hidden;
}

.page {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    transform-origin: 0% 50%; 
    overflow-y: auto !important; /* Dikey kaydırmayı ZORUNLU KILAR */
    -webkit-overflow-scrolling: touch; /* İOS (İPHONE) TELEFONLAR İÇİN AKICI KAYDIRMA */
    padding-bottom: 90px; /* Alt bar yazıları kapatmasın diye artırıldı */
    backface-visibility: hidden;
    box-shadow: inset 10px 0 20px rgba(0,0,0,0.1);
}

#page-0 { z-index: 10; }
#page-1 { z-index: 9; }
#page-2 { z-index: 8; }
#page-3 { z-index: 7; }
#page-4 { z-index: 6; }
#page-5 { z-index: 5; }

/* GERÇEKÇİ KÖŞE KIVRILMA (CURL) ANİMASYONLARI */
@keyframes pagePeelLeft {
    0% {
        transform: rotateY(0deg) skewY(0deg) translateZ(0);
        box-shadow: inset 10px 0 20px rgba(0,0,0,0.1);
    }
    40% {
        transform: rotateY(-60deg) skewY(-8deg) translateZ(50px);
        box-shadow: inset 40px 0 60px rgba(0,0,0,0.2);
    }
    100% {
        transform: rotateY(-180deg) skewY(0deg) translateZ(0);
        box-shadow: inset 10px 0 20px rgba(0,0,0,0.1);
    }
}

@keyframes pagePeelRight {
    0% {
        transform: rotateY(-180deg) skewY(0deg) translateZ(0);
    }
    60% {
        transform: rotateY(-60deg) skewY(8deg) translateZ(50px);
    }
    100% {
        transform: rotateY(0deg) skewY(0deg) translateZ(0);
    }
}

.page.initial {
    transform: rotateY(0deg);
}

.page.turned {
    animation: pagePeelLeft 1s ease-in-out forwards;
}

.page:not(.turned):not(.initial) {
    animation: pagePeelRight 1s ease-in-out forwards;
}

/* KAPAK SAYFASI - KAYDIRMA HATASI GİDERİLDİ */
.hero-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; <--- KAYDIRMA HATASI YAPAN KOD SİLİNDİ */
    text-align: center;
    padding: 40px 20px 90px 20px;
    position: relative;
    min-height: 100%;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #FFFFFF;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto; /* SAYFAYI GÜVENLİ ŞEKİLDE ORTALAR, TAŞMAYA İZİN VERİR */
}

.badge {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 25px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.8);
    transform: rotate(-3deg);
    margin-bottom: 15px;
}

.main-title {
    font-size: 4.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #FFD166, #FF8C00, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 5px 25px rgba(255, 140, 0, 0.6);
    margin-bottom: 25px;
}

.intro-text p {
    font-size: 1.25rem;
    font-weight: 800;
    color: #FFFFFF;
    text-shadow: 2px 2px 4px #000, -1px -1px 4px #000, 0 0 15px rgba(0,0,0,1);
    margin-bottom: 15px;
    line-height: 1.5;
}

.highlight-text {
    color: #FFD166 !important;
    font-size: 1.35rem !important;
    margin-top: 25px;
}

.start-btn {
    background-color: var(--primary-color);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    padding: 16px 35px;
    font-size: 1.3rem;
    font-weight: 900;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.6);
    margin-top: 20px;
}

/* HİKAYE SAYFALARI */
.story-page {
    background-color: var(--bg-color);
}

.chapter-img {
    width: 100%;
    height: 40vh; 
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chapter-content {
    padding: 25px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.book-title {
    font-size: 1.2rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 20px;
}

.chapter-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 900;
}

.chapter-text p {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 18px;
    text-align: justify;
    line-height: 1.6;
}

.book-end {
    text-align: center;
    margin-top: 40px;
    color: var(--accent-color);
    font-weight: 900;
    font-size: 1.3rem;
}

/* ALT YÖNLENDİRME ÇUBUĞU */
#nav-bar {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: #FFFFFF;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    z-index: 100;
    transform: translateY(100%); 
    transition: transform 0.4s ease;
}

#nav-bar.visible {
    transform: translateY(0); 
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#nav-bar button {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    padding: 5px 10px;
}

.nav-action {
    background-color: var(--bg-color) !important;
    border-radius: 10px;
    font-size: 1rem !important;
    color: #333 !important;
    border: 1px solid #DDD !important;
    padding: 8px 12px !important;
}

#nav-bar button:disabled {
    color: #CCC;
    cursor: not-allowed;
}

#page-indicator {
    font-size: 1.1rem;
    color: #555;
    font-weight: 800;
}