/* ================================================================= */
/* GENEL AYARLAR VE RENKLER (CSS Değişkenleri) */
/* ================================================================= */
:root {
    --bg-color: #f7f7f7; --text-color: #333; --header-bg: #e0e0e0; --header-border: rgba(0, 0, 0, 0.1); --button-color: #555; --button-bg: rgba(0, 0, 0, 0.05); --button-active-bg: #555; --button-active-color: #fff; --menu-bg: #ffffff; --link-color: #3d949a; --btn-bg: #e8e8e8; --btn-fg: #111; --btn-radius: 20px; --btn-height: 40px; --hover: #18181b;
}
body.dark-mode {
    --bg-color: #121212; --text-color: #e0e0e0; --header-bg: #222; --header-border: rgba(255, 255, 255, 0.1); --button-color: #e0e0e0; --button-bg: rgba(255, 255, 255, 0.05); --button-active-bg: #e0e0e0; --button-active-color: #121212; --menu-bg: #1e1e1e; --link-color: #526eab; --btn-bg: #333333; --btn-fg: #f7f7f7;
}
body.sari-mod {
    --bg-color: #fcf8e3; --text-color: #4a452a; --header-bg: #e5e0c9; --header-border: rgba(74, 69, 42, 0.1); --button-color: #4a452a; --button-bg: rgba(74, 69, 42, 0.05); --button-active-bg: #4a452a; --button-active-color: #fcf8e3; --menu-bg: #f5f2e0; --link-color: #4a452a; --btn-bg: #e5e0c9; --btn-fg: #4a452a;
}
body.pink-mode {
    --bg-color: #FFF0F5; --text-color: #5C2337; --header-bg: #FFE4E1; --header-border: rgba(92, 35, 55, 0.1); --button-color: #5C2337; --button-bg: rgba(92, 35, 55, 0.05); --button-active-bg: #5C2337; --button-active-color: #FFF0F5; --menu-bg: #ffffff; --link-color: #D96C8A; --btn-bg: #ffe4e1; --btn-fg: #581845;
}
body.mavi-mod {
    --bg-color: #0b1a2c; --text-color: #c0d4eb; --header-bg: #162a42; --header-border: rgba(192, 212, 235, 0.1); --button-color: #c0d4eb; --button-bg: rgba(192, 212, 235, 0.05); --button-active-bg: #c0d4eb; --button-active-color: #0b1a2c; --menu-bg: #112033; --link-color: #c0d4eb; --btn-bg: #162a42; --btn-fg: #c0d4eb;
}

/* ================================================================= */
/* FONT, BOYUT VE SATIR ARALIĞI DEĞİŞKENLERİ */
/* ================================================================= */
body {
    --base-font-size: 1.1rem; --base-line-height: 1.8; --font-family: 'Poppins', sans-serif; font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-color); line-height: var(--base-line-height); margin: 0; transition: background-color 0.5s ease, color 0.5s ease;
}
body.font-times { --font-family: 'Times New Roman', serif; }
body.font-arial { --font-family: 'Arial', sans-serif; }
body.font-georgia { --font-family: 'Georgia', serif; }
body.font-poppins { --font-family: 'Poppins', sans-serif; }
body.font-lora { --font-family: 'Lora', serif; }
body.font-lato { --font-family: 'Lato', sans-serif; }
body.size-small { --base-font-size: 1rem; }
body.size-medium { --base-font-size: 1.1rem; }
body.size-large { --base-font-size: 1.2rem; }
body.spacing-narrow { --base-line-height: 1.6; }
body.spacing-normal { --base-line-height: 1.8; }
body.spacing-wide { --base-line-height: 2.0; }

/* --- Header ve Butonlar --- */
.header {
    position: fixed; top: 0; left: 0; right: 0; padding: 15px 25px; z-index: 100; display: flex; justify-content: space-between; align-items: center; background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--header-border); transform: translateY(0); transition: transform 0.3s ease-in-out, background 0.3s ease;
}
.header.hidden { transform: translateY(-100%); }
.geri-buton, .ayarlar-btn {
    color: var(--button-color); text-decoration: none; font-family: 'Poppins', sans-serif; font-size: 14px; display: flex; align-items: center; gap: 8px; transition: all 0.3s ease; padding: 8px 12px; border-radius: 8px; background: var(--button-bg); cursor: pointer; border: none;
}
.geri-buton:hover, .ayarlar-btn:hover { color: var(--text-color); background: var(--header-border); }
.ayarlar-ve-butonlar { position: relative; display: flex; gap: 8px; align-items: center; }

/* --- Okuma Sayfası Ana İçerik --- */
.okuma-sayfasi { max-width: 760px; margin: 7rem auto; padding: 0 2rem; }
.bolum-baslik-alani { text-align: center; margin-bottom: 40px; }
.bolum-baslik-alani h1 { font-family: 'Cinzel', serif; font-size: 2.5rem; margin-bottom: 5px; color: var(--text-color); }
.bolum-baslik-alani p { font-size: 1rem; color: var(--text-color); font-style: italic; opacity: 0.7; }
.bolum-metni {
    font-size: var(--base-font-size); line-height: var(--base-line-height); font-family: var(--font-family); white-space: pre-line; text-align: justify; word-spacing: -0.05em; transition: font-size 0.3s ease, line-height 0.3s ease, font-family 0.3s ease; color: var(--text-color);
}
.bolum-metni p:first-of-type::first-letter {
    font-family: 'Cinzel', serif; font-size: 4rem; color: var(--link-color); float: left; line-height: 1; margin-right: 0.5rem; padding-top: 0.2rem;
}

/* ================================================================= */
/* BÖLÜM NAVİGASYON BUTONLARI */
/* ================================================================= */
.bolum-navigasyon {
    display: flex; justify-content: space-between; align-items: center; margin-top: 3rem; margin-bottom: 40px; padding-top: 1.5rem; border-top: 1px solid var(--header-border);
}
.nav-btn.cat-button {
    position: relative; width: 200px; height: 40px; border-radius: 20px; background: var(--btn-bg); color: var(--btn-fg); border: none; outline: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 600; letter-spacing: .2px; transition: transform .15s ease, background .2s ease; box-shadow: 0 2px 0 rgba(0,0,0,.08) inset, 0 8px 24px rgba(0,0,0,.06); padding-inline: 24px; text-decoration: none;
}
.nav-btn.cat-button:active{ transform: translateY(1px); }

/* ================================================================= */
/* OKUMA İLERLEME ÇUBUĞU */
/* ================================================================= */
.progress-container {
    width: 100%; height: 5px; background: transparent; position: fixed; top: 65px; z-index: 101; transition: top 0.3s ease-in-out;
}
.progress-container.hidden { top: -10px; }
.progress-bar { height: 5px; background: var(--link-color); width: 0%; transition: width 0.1s linear; }

/* ================================================================= */
/* MODAL VE YORUM STİLLERİ */
/* ================================================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.aktif { opacity: 1; visibility: visible; }
.modal-box {
    background: var(--bg-color); color: var(--text-color); padding: 30px; border-radius: 15px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.2); transform: scale(0.9); transition: transform 0.3s cubic-bezier(.18,.89,.32,1.28);
}
.modal-overlay.aktif .modal-box { transform: scale(1); }
.modal-box p { margin: 0 0 25px 0; font-size: 1.1rem; line-height: 1.6; }
.modal-buttons { display: flex; justify-content: center; gap: 15px; }
.modal-btn { border: none; padding: 12px 24px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; }
.modal-btn-cancel { background: var(--button-bg); color: var(--text-color); border: 1px solid var(--header-border); }
.modal-btn-cancel:hover { background: var(--header-border); }
.modal-btn-ok { background: #e74c3c; color: #fff; }
.modal-btn-ok:hover { background: #c0392b; transform: translateY(-2px); }
.yorumlar-bolumu { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--header-border); }
.yorumlar-bolumu > h3 { font-size: 1.5rem; margin-bottom: 2rem; }
.yorum-kart {
    background-color: transparent; border: 1px solid var(--header-border); padding: 20px; border-radius: 16px; margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); position: relative; transition: transform 0.3s ease;
}
.yorum-kart:hover { transform: translateY(-3px); }
.yorum-govdesi { display: flex; flex-direction: row; align-items: flex-start; gap: 15px; }
.profil-resmi, .profil-resmi-placeholder { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.profil-resmi-placeholder {
    background-color: var(--link-color); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.2rem;
}
.yorum-icerigi { flex-grow: 1; }
.yorum-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 0.9rem; color: var(--button-color); }
.yorum-yazar { font-weight: 700; color: var(--text-color); margin-right: auto; }
.yorum-metni { font-size: 1rem; line-height: 1.6; color: var(--text-color); word-break: break-word; }
.yorum-aksiyonlari {
    display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--header-border);
}
.yanitla-btn {
    background: none; border: none; color: var(--button-color); cursor: pointer; font-size: 0.85rem; opacity: 0.7; transition: all 0.2s ease; display: flex; align-items: center; gap: 6px; padding: 5px;
}
.yanitla-btn:hover { opacity: 1; color: var(--link-color); }
.sil-yorum-btn {
    background: none; border: none; color: var(--link-color); cursor: pointer; font-size: 0.9rem; margin-left: auto; opacity: 0.7; transition: all 0.2s ease;
}
.sil-yorum-btn:hover { opacity: 1; color: #e74c3c; }
.yorum-ekle { background-color: var(--button-bg); border: 1px solid var(--header-border); padding: 20px; border-radius: 16px; }
.yorum-ekle h4 { font-size: 1.1rem; font-weight: 600; margin: 0; margin-bottom: 15px; color: var(--text-color); }
.yorum-ekle textarea {
    width: 100%; box-sizing: border-box; background-color: var(--bg-color); border: 1px solid var(--header-border); color: var(--text-color); padding: 15px; border-radius: 12px; font-size: 1rem; min-height: 100px; transition: all 0.3s ease; border-width: 2px;
}
.yorum-ekle textarea:focus { border-color: var(--link-color); box-shadow: 0 0 10px rgba(93, 140, 107, 0.2); outline: none; }
.yorum-ekle button {
    background-color: var(--link-color); font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 25px; font-weight: 600; border: none; cursor: pointer; transition: background-color 0.2s ease;
}
.yorum-ekle button:hover { background-color: var(--text-color); }

/* ================================================================= */
/* MOBİL UYUMLULUK (@media) */
/* ================================================================= */
@media (max-width: 768px) {
    .header { padding: 12px 15px; }
    .geri-buton, .ayarlar-btn { font-size: 12px; }
    .okuma-sayfasi { padding: 80px 20px 40px 20px; margin: 0; }
    .bolum-baslik-alani h1 { font-size: 1.8rem; line-height: 1.3; }
    .progress-container { top: 58px; }
    .yorumlar-bolumu h3 { font-size: 1.2rem; }
    .yorum-kart { padding: 15px; }
    .yorum-header { font-size: 0.8rem; }
    .yorum-metni { font-size: 0.9rem; }
    .bolum-navigasyon { flex-direction: row; gap: 15px; justify-content: center; }
    .nav-btn.cat-button { width: 48%; height: 40px; padding-top: 0; font-size: 1rem; white-space: nowrap; }
    .header { padding: 10px 12px; }
    .ayarlar-ve-butonlar { gap: 4px; }
    .geri-buton, .ayarlar-btn { font-size: 1rem; padding: 8px; gap: 5px; }
    .geri-buton span { display: none; }
    #yorum-sayisi-goster { font-size: 0.7rem; padding: 2px 4px; }
    /* Mobil Görünümde Tema Menüsünü Daraltma */
    #tema-menusu {
        width: 180px; /* Diğer menüler geniş kalırken, bu menüye daha dar bir genişlik veriyoruz */
        /* Zaten sağa dayalı olduğu için bu ayar yeterlidir */
    }
}

/* ================================================================= */
/* ÖZEL TEMA DEĞİŞTİRME BUTONU VE DİĞER KÜÇÜK KURALLAR */
/* ================================================================= */
.ozel-switch {
    position: relative; width: 120px; height: 44px; border-radius: 44px; cursor: pointer; box-shadow: inset 0 3px 8px rgba(0,0,0,0.15); transition: background-image 0.6s ease;
}
.ozel-switch .thumb {
    position: absolute; height: 36px; width: 36px; left: 4px; top: 4px; background-color: white; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: transform 0.4s cubic-bezier(.18,.89,.32,1.28);
}
.ozel-switch .thumb i {
    position: absolute; top: 50%; left: 50%; font-size: 16px; opacity: 0; transform: translate(-50%, -50%) scale(0); transition: opacity 0.3s ease, transform 0.3s ease;
}
.ozel-switch.state-light { background-image: linear-gradient(to right, #89f7fe 0%, #66a6ff 100%); }
.ozel-switch.state-light .thumb { transform: translateX(0px); }
.ozel-switch.state-light .fa-cloud-sun { opacity: 1; transform: translate(-50%, -50%) scale(1); color: #f1c40f; }
.ozel-switch.state-pink { background-image: linear-gradient(to right, #ff9a9e 0%, #fecfef 100%); }
.ozel-switch.state-pink .thumb { transform: translateX(38px); }
.ozel-switch.state-pink .fa-comment-dots { opacity: 1; transform: translate(-50%, -50%) scale(1); color: #D96C8A; }
.ozel-switch.state-dark { background-image: linear-gradient(to right, #2c3e50 0%, #4b6484 100%); }
.ozel-switch.state-dark .thumb { transform: translateX(76px); }
.ozel-switch.state-dark .fa-moon { opacity: 1; transform: translate(-50%, -50%) scale(1); color: #f7f1e3; }

/* ======================================================== */
/* POPUP MENÜ SIFIRLAMA KODU (MOBİL & WEB UYUMLU)       */
/* ======================================================== */
/* 1. Tüm popup menüler için temel (mobil öncelikli) stiller */
.ayarlar-pop-up {
    position: absolute;
    top: calc(100% + 10px);
    right: 15px;
    width: calc(100vw - 30px);
    max-width: 340px;
    background: var(--menu-bg);
    border-radius: 12px;
    border: 1px solid var(--header-border);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    padding: 15px;
    z-index: 1000;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
/* 2. JavaScript ile "acik" class'ı eklendiğinde menüyü göster */
.ayarlar-pop-up.acik {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* 3. Bölümler menüsünün içi çok uzarsa kaydırma çubuğu çıksın */
#bolumler-menusu .bolum-listesi {
    max-height: 60vh;
    overflow-y: auto;
}
.bolum-linki {
    display: block; padding: 10px 12px; text-decoration: none; color: var(--text-color); border-radius: 6px; transition: background-color 0.2s ease; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bolum-linki:hover { background-color: var(--button-bg); }
.bolum-linki.aktif-bolum { background-color: var(--link-color); color: #fff; font-weight: bold; }
.bolum-linki span { opacity: 0.7; margin-right: 5px; }

/* 4. MASAÜSTÜ İÇİN ÖZELLEŞTİRME */
@media (min-width: 768px) {
    .ayarlar-pop-up {
        width: auto;
        right: 0; 
    }
    #yazi-ayarlari-menusu {
        width: 300px;
    }
    #bolumler-menusu {
        width: 350px;
    }
    #tema-menusu {
        width: 170px;
    }
}
/* ======================================================== */
/* POPUP MENÜ İÇERİK STİLLERİ                           */
/* ======================================================== */

/* Menülerin içindeki genel başlık (H3) */
.ayarlar-pop-up h3 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--header-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Yazı Ayarları menüsündeki alt başlıklar (H4) */
#yazi-ayarlari-menusu h4 {
    font-size: 0.9rem;
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--text-color);
    opacity: 0.8;
}

/* Yazı Ayarları menüsündeki buton grupları */
#yazi-ayarlari-menusu .ayarlar-buton-grubu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Yazı Ayarları menüsündeki butonların kendisi */
#yazi-ayarlari-menusu button {
    background: var(--button-bg);
    color: var(--button-color);
    border: 1px solid var(--header-border);
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

#yazi-ayarlari-menusu button:hover {
    background: var(--header-border);
}

/* Aktif olan ayar butonu */
#yazi-ayarlari-menusu button.aktif {
    background: var(--button-active-bg);
    color: var(--button-active-color);
    border-color: var(--button-active-bg);
    font-weight: bold;
}