/* ================================================================ */
/* === ÖZEL İMLEÇ STİLLERİ (GÜNCELLENMİŞ VERSİYON) === */
/* ================================================================ */

/* 1. Sitedeki varsayılan imleç */
html {
    cursor: url('img/imlec-normal.png'), auto;
}

/* 2. Tıklanabilir tüm öğeler için genel "el" imleci */
/* Üst bar butonları, butonlar ve tıklanabilir diğer her şey */
a, button, .book-btn {
    cursor: url('img/imlec-el.png') 8 0, pointer;
}

/* 3. Kitap kapalıyken üzerine gelindiğindeki imleç (el işareti) */
/* Hem kitabın kendisine hem de içindeki sayfalara uygula */
.book:not(.open),
.book:not(.open) .page {
    cursor: url('img/imlec-el.png') 8 0, pointer;
}

/* 4. Kitap açıkken üzerine gelindiğindeki imleç (açık el) */
/* Sürükleme başlamadığında hem kitaba hem de sayfalara uygula */
.book.open:not(.dragging),
.book.open:not(.dragging) .page {
    cursor: url('img/imlec-surukleme.png') 8 0, grab;
}

/* 5. Sayfayı sürüklerken görünecek imleç (kapanan el) */
/* Bu kural aynı kalıyor, çünkü sürükleme sınıfı en belirgin olanı */
.book.open.dragging,
.book.open.dragging .page { /* <-- GÜNCELLEME: Sayfaları da dahil et */
    cursor: url('img/imlec-surukleme.png') 8 8, grabbing;
}


/* --- TEMEL SAYFA AYARLARI --- */
body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Dikey kaydırmayı engeller */
    font-family: Arial, sans-serif;
    color: white;
}

/* --- ARKA PLAN VİDEOSU VE EFEKT --- */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}
.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.0) url("img/texture.png");
    background-size: cover;
    z-index: -1;
}

/* --- 1. ÜST BAR VE BUTONLAR --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid #ceba8e;
    background-color: rgba(0, 0, 0, 0.4); 
}
.image-links {
    display: flex;
    gap: 15px;
    align-items: center;
}
.image-links a img {
    max-width: 160px;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease, opacity 0.3s;
}
.image-links a img:hover {
    transform: scale(1.05);
}

/* --- 2. ANA İÇERİK KONTEYNERİ --- */
.page-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* --- LOGO AYARLARI --- */
.main-logo {
    position: absolute;
    top: 28%; 
    left: 25%; 
    transform: translateX(-50%); 
    max-width: 600px;
    width: 70%;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.6));
    animation: fadeIn 2s forwards, pulse-animation 2s infinite 1s;
    /* YENİ: Yavaş geçiş efekti eklendi */
    transition: opacity 1.5s ease-in-out;
}

/* YENİ VE DOĞRU KURAL: Kitap açıldığında logoyu gizle */
.page-container.logo-hidden .main-logo {
    /* 1. Opaklığı 1'e zorlayan animasyonu devre dışı bırak */
    animation: none;

    /* 2. Logoyu şeffaf yap (transition bu değişimi yumuşatacak) */
    opacity: 0;
    
    /* 3. Gizliyken tıklanmasını engellemeye devam et */
    pointer-events: none;
}


/* --- KİTAP AYARLARI --- */
.book-container {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 1.5s 0.5s forwards;
}

.book {
    width: 800px; 
    height: 765px; 
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(0deg) scale(0.7);
    transition: transform 1s ease;
    cursor: pointer;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.book.open {
    transform: rotateY(0deg) scale(1.1);
    cursor: default;
}

.page {
    position: absolute;
    width: 100%; /* Sayfalar kitabın yarısı kadar olmalı */
    height: 100%;
    left: 50%; 
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
	will-change: transform;
}

.page-front, .page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transform: translateZ(0); 
}

.page-front { background-color: transparent; } 
.page.cover .page-front { background-color: transparent; }
.page-back {
    background-color: transparent;
    transform: rotateY(180deg) translateZ(0); 
}
.page img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.page.flipped { transform: rotateY(-180deg); }
.cover { z-index: 10; } 

.book-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: url('img/imlec-el.png') 8 0, pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
    z-index: 100;
}
.book-btn img {
    width: 40px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.7));
}
.book-container.opened .book-btn {
    opacity: 0.8;
    visibility: visible;
}
.book-container.opened .book-btn:hover { opacity: 1; }
.prev-btn { left: -68%; }
.next-btn { right: -68%; }

.close-btn {
    position: absolute;
    top: -20px;
    right: -20px;
    transform: translateY(0);
    z-index: 101;
}
.book-container.opened .close-btn {
    opacity: 0.8;
    visibility: visible;
}
.book-container.opened .close-btn:hover { opacity: 1; }

/* --- YENİ VE KESİN ÇÖZÜM: ANİMASYONLU KAPAK STİLLERİ --- */

/* 1. Animasyon sırasında kitabın genel durumu */
.book-container.loading .book {
    cursor: default;      /* İmleci normal yap */
    pointer-events: none; /* Kitaba tıklanmasını tamamen engelle */
}
.book-container.loading .page:not(.cover) {
    display: none; /* Kapak dışındaki tüm sayfaları gizle */
}

/* 2. Video ve statik resmin pozisyonunu ve geçiş efektini ayarla */
.page.cover .page-front #coverAnimationVideo,
.page.cover .page-front #staticCoverImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* İkisi arasındaki geçişi yumuşatmak için */
    transition: opacity 0.1 ease-in-out; 
}

/* 3. Başlangıç Durumu: video görünür, statik resim tamamen şeffaf */
.book-container.loading .page.cover .page-front #coverAnimationVideo {
    opacity: 1;
    z-index: 10; /* Videonun en üstte olmasını garantile */
}
.book-container.loading .page.cover .page-front #staticCoverImage {
    opacity: 0;
    z-index: 5;
}

/* 4. Bitiş Durumu (loading sınıfı kalkınca): video şeffaf, statik resim görünür */
.book-container:not(.loading) .page.cover .page-front #coverAnimationVideo {
    opacity: 0;
    z-index: 5;
    pointer-events: none; /* Gizli videonun tıklamayı engellemesini önle */
}
.book-container:not(.loading) .page.cover .page-front #staticCoverImage {
    opacity: 1;
    z-index: 10;
}

/* --- GENEL ANİMASYONLAR --- */
@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse-animation {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

/* --- MOBİL MENÜ İÇİN HAMBURGER (Masaüstünde gizli) --- */
.mobile-nav-toggle { display: none; }


/* =================================================================== */
/* === MOBİL YATAY MOD VE UYARI EKRANI (YENİ VE GÜNCELLENMİŞ ALAN) === */
/* =================================================================== */

/* --- Sallanma animasyonu --- */
@keyframes shake-rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(15deg);
  }
  75% {
    transform: rotate(-15deg);
  }
}

/* --- Uyarı ekranının genel stili --- */
.rotate-device-warning {
    display: none; /* Varsayılan olarak gizli */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(30,30,30,1) 0%, rgba(10,10,10,1) 100%);
    color: white;
    flex-direction: column; /* Öğeleri dikeyde hizala */
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 9999;
}

/* --- Animasyonlu telefon ikonu --- */
.phone-container {
    margin-bottom: 30px;
}

.phone-icon {
    width: 100px; /* Telefon genişliği */
    height: 200px; /* Telefon yüksekliği */
    border: 5px solid #555;
    background: #1e1e1e;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    /* Animasyonu burada uyguluyoruz */
    animation: shake-rotate 2.5s ease-in-out infinite;
    transform-origin: bottom center; /* Dönme noktasını alt-orta olarak ayarla */
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ceba8e;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
}

/* --- Uyarı metni --- */
.warning-text {
    font-size: 1.1em;
    color: #ccc;
    padding: 0 20px;
}


/* --- 1. Adım: Sadece mobil dikey modda uyarıyı göster, içeriği gizle --- */
@media (max-width: 900px) and (orientation: portrait) {
    .rotate-device-warning {
        display: flex; /* Uyarıyı görünür yap */
    }
    .page-container, .top-bar {
        display: none; /* Sitenin geri kalanını gizle */
    }
}

/* --- 2. Adım: Sadece mobil yatay modda siteyi responsive yap --- */
@media (max-width: 1280px) and (orientation: landscape) {
    .top-bar {
       padding: 5px 0;
    }
    .image-links a img {
        max-width: 100px; /* Butonları küçült */
    }

    .main-logo {
        top: 22%; /* Logoyu yukarı taşı */
        left: 25%;
        transform: translateX(-50%);
        max-width: 350px; /* Logoyu küçült */
        animation: fadeIn 1s forwards; /* Nabız animasyonunu kaldır */
    }

    .book-container {
        width: 90vh;  /* Genişliği ekran yüksekliğine oranla ayarla */
        max-width: 90%; /* Ekran genişliğini aşmamasını sağla */
        top: 58%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .book {
        /* Yüksekliği ve genişliği container'a göre ayarlanacak */
        width: 100%;
        height: auto; /* Oranı koru */
        aspect-ratio: 800 / 765; /* Orijinal en-boy oranını koru */
        transform: scale(0.9); /* Başlangıç boyutunu ayarla */
    }

    .book.open {
        transform: scale(1); /* Açıldığında büyüme efekti */
    }

    /* Butonları kitabın içine/yakınına al */
	.prev-btn { left: -52%; }
	.next-btn { right: -52%; }
    
    .book-btn img {
        width: 25px; /* Okları küçült */
    }

    .close-btn {
        top: 5px;
        right: 5px;
    }
     .close-btn img {
        width: 25px;
    }

    /* Mobil menü (hamburger) gizli kalsın, çünkü yatayda üst bar yeterli */
    .mobile-nav-toggle {
        display: none;
    }
}

