/* --- THE CHRONICLE OF THE WORLD - ULTIMATE STYLE (VIBRANT DARK MODE) --- */

/* 1. MODERN DEĞİŞKENLER */
:root {
    --bg-body: #f4f7f6;
    --bg-paper: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --accent-color: #2c5282; /* Okyanus Mavisi */
    --highlight: #dd6b20;    /* Yanık Turuncu */
    
    --header-blur: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-deep: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-main: 16px;
    --font-serif: 'Georgia', 'Merriweather', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* DARK MODE DEĞİŞKENLERİ (CANLI RENKLER) */
body.dark-mode {
    --bg-body: #0f172a;       /* Derin Uzay */
    --bg-paper: #1e293b;      /* Panel */
    --text-main: #e2e8f0;     /* Kırık Beyaz (Metin) */
    --text-muted: #94a3b8;
    --accent-color: #60a5fa;  /* Neon Mavi */
    --highlight: #fbbf24;     /* Altın Sarısı / Turuncu (Başlıklar için) */
    --header-blur: rgba(15, 23, 42, 0.85);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* --- 2. TEMEL AYARLAR --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
    scroll-behavior: smooth; 
    scroll-padding-top: 100px; 
    font-size: 16px; 
}

body {
    font-family: var(--font-serif);
    line-height: 1.9;
    color: var(--text-main);
    background-color: var(--bg-body);
    padding-top: 100px;
    padding-bottom: 80px;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* --- 3. ANA İÇERİK KUTUSU --- */
.content-container {
    background-color: var(--bg-paper);
    width: 95%;
    max-width: 800px;
    margin: 0 auto;
    padding: 70px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 1;
    border-top: 4px solid var(--accent-color);
    transition: background-color 0.4s ease;
}

/* --- 4. TİPOGRAFİ --- */
h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 800;
    line-height: 1.25;
    margin-top: 2em;
    margin-bottom: 0.8em;
    letter-spacing: -0.02em;
    color: inherit; /* Varsayılan */
    transition: color 0.3s ease;
}

/* DARK MODE ÖZEL RENKLENDİRME (BURASI YENİ) */
body.dark-mode h1, 
body.dark-mode h2 {
    color: var(--highlight); /* Başlıklar Turuncu/Altın */
}

body.dark-mode h3 {
    color: var(--accent-color); /* Alt başlıklar Mavi */
}

body.dark-mode strong {
    color: var(--highlight); /* Kalın yazılar parlasın */
}

body.dark-mode a {
    color: var(--accent-color);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); } 
h2 { 
    font-size: clamp(1.5rem, 4vw, 2.2rem); 
    border-bottom: 2px solid rgba(0,0,0,0.05); 
    padding-bottom: 15px; 
}
/* Dark Mode'da çizgi rengi */
body.dark-mode h2 { border-bottom: 2px solid rgba(255,255,255,0.1); }

h3 { 
    font-size: clamp(1.2rem, 3vw, 1.5rem); 
    color: var(--accent-color); 
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9em;
}

p { margin-bottom: 1.6em; font-size: 1.15rem; }
li { margin-bottom: 0.6em; margin-left: 1.5em; }

/* VOLUME HEADER */
.volume-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 4rem 2rem;
    margin: -30px -70px 50px -70px;
    text-align: center;
    border-radius: var(--radius-main) var(--radius-main) 0 0;
    box-shadow: inset 0 -10px 30px rgba(0,0,0,0.2);
}

.volume-header h1 { color: #f39c12 !important; margin: 0; text-transform: uppercase; letter-spacing: 0.1em; font-size: 1.2rem; }
.volume-header h2 { color: white !important; margin-top: 10px; border: none; font-size: 2.5rem; letter-spacing: -1px; }

/* --- 5. GÖRSELLER --- */
figure { margin: 50px auto; max-width: 100%; text-align: center; }
figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-deep);
    display: block;
    margin: 0 auto;
    transition: transform 0.4s ease;
}
figure img:hover { transform: scale(1.01); }
figcaption {
    margin-top: 15px;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-style: italic;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
    display: inline-block;
    text-align: left;
}

/* --- 6. HEADER BAR --- */
#header-bar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 75px;
    background: var(--header-blur);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 3000;
    display: flex;
    align-items: center;
    transition: background 0.3s ease;
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}
.site-logo span { color: var(--highlight); }

.header-actions { display: flex; align-items: center; gap: 15px; }

#header-word-count {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 4px 10px;
    border-radius: 20px;
}
body.dark-mode #header-word-count { background: rgba(255,255,255,0.1); color: var(--text-muted); }

/* HEADER BUTONLARI */
.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    width: 40px; 
    height: 40px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 50%;
    position: relative;
    z-index: 100;
}
.icon-btn:hover { background: rgba(0,0,0,0.05); color: var(--highlight); transform: translateY(-2px); }
body.dark-mode .icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--highlight); }

/* --- 7. TOC (CONTENTS) --- */
#toc-container {
    position: fixed;
    right: 30px; 
    top: 100px;
    width: 150px; 
    height: 50px; 
    background: var(--bg-paper);
    border-radius: 30px; 
    box-shadow: var(--shadow-soft);
    z-index: 2500;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                border-radius 0.4s ease;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

#toc-container.expanded, #toc-container.pinned {
    width: 320px; 
    height: 75vh; 
    padding: 0;
    border-radius: 20px;
    box-shadow: var(--shadow-deep);
}

#toc-header {
    display: flex; 
    align-items: center;
    cursor: pointer; 
    padding: 0 20px; 
    height: 50px; 
    width: 100%;
    background: transparent;
    flex-shrink: 0;
}

.toc-icon { font-size: 20px; color: var(--accent-color); width: 24px; text-align: center; margin-right: 12px; }

.toc-text { 
    font-family: var(--font-sans); 
    font-size: 0.85rem; 
    font-weight: 800; 
    color: var(--text-main);
    letter-spacing: 1px;
    text-transform: uppercase; 
    white-space: nowrap;
}

#toc-list {
    list-style: none; 
    padding: 0 25px 25px 25px; 
    margin: 0; 
    opacity: 0;
    overflow-y: hidden; 
    width: 100%;
    flex-grow: 1;
    transition: opacity 0.3s ease 0.1s;
}

#toc-container.expanded #toc-list, #toc-container.pinned #toc-list { opacity: 1; overflow-y: auto; }
#toc-list::-webkit-scrollbar { width: 4px; }
#toc-list::-webkit-scrollbar-thumb { background: var(--highlight); border-radius: 10px; }
#toc-list a { 
    text-decoration: none; color: var(--text-muted); font-family: var(--font-sans);
    font-size: 0.85rem; padding: 8px 10px; display: block; border-radius: 6px; transition: 0.2s; 
}
#toc-list a:hover { background: rgba(0,0,0,0.03); color: var(--accent-color); transform: translateX(5px); }

/* --- 8. AUDIO PLAYER --- */
#audio-player {
    position: fixed;
    bottom: -250px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 650px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 15px 25px;
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.4) inset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 9999;
    transition: bottom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#audio-player.active { bottom: 30px; }

/* Sol: Bilgi */
.audio-info { display: flex; flex-direction: column; min-width: 130px; }
.audio-title { font-family: var(--font-sans); font-weight: 800; font-size: 0.9rem; color: var(--text-main); }
.audio-status { font-family: var(--font-sans); font-size: 0.75rem; color: var(--highlight); font-weight: 600; }

/* Orta: Kontroller */
.audio-controls { display: flex; align-items: center; gap: 15px; }
.control-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.control-btn:hover { color: var(--accent-color); transform: scale(1.1); }
.control-btn.main { width: 55px; height: 55px; background: var(--text-main); color: var(--bg-paper); border-radius: 50%; font-size: 1.4rem; box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.control-btn.main:hover { background: var(--highlight); color: white; transform: scale(1.05) translateY(-2px); box-shadow: 0 12px 30px rgba(221, 107, 32, 0.3); }

/* Sağ: Ayarlar */
.audio-settings { display: flex; align-items: center; gap: 10px; }
.custom-dropdown { position: relative; }

.dropdown-btn {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: all 0.2s;
    min-width: 110px; justify-content: space-between;
}
.dropdown-btn:hover { background: rgba(0,0,0,0.08); transform: translateY(-1px); }
.dropdown-btn i { color: var(--accent-color); font-size: 0.9rem; }

/* Dropdown Menu */
.dropdown-menu {
    position: absolute; bottom: 120%; left: 0; width: 160px; max-height: 200px; overflow-y: auto;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 5px; display: none; flex-direction: column; z-index: 10000;
    border: 1px solid rgba(0,0,0,0.05);
    opacity: 0; transform: translateY(10px); transition: all 0.2s ease;
}
.dropdown-menu.show { display: flex; opacity: 1; transform: translateY(0); }

.dropdown-item {
    padding: 8px 12px; font-size: 0.8rem; color: var(--text-main); cursor: pointer;
    border-radius: 8px; transition: 0.2s; font-family: var(--font-sans);
}
.dropdown-item:hover { background: var(--accent-color); color: white; }
.dropdown-menu::-webkit-scrollbar { width: 4px; }
.dropdown-menu::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.close-audio {
    width: 30px; height: 30px; background: rgba(229, 62, 62, 0.1); color: #e53e3e; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: 5px;
}
.close-audio:hover { background: #e53e3e; color: white; }

/* --- 9. MOBİL UYUM --- */
@media (max-width: 768px) {
    body { padding-top: 80px; }
    .content-container {
        width: 100%; max-width: 100%; padding: 30px 20px;
        border-radius: 0; box-shadow: none; border-top: 3px solid var(--highlight);
    }
    .volume-header { margin: -30px -20px 40px -20px; padding: 3rem 1rem; border-radius: 0; }
    .volume-header h1 { font-size: 1rem; }
    .volume-header h2 { font-size: 1.8rem; }
    #header-bar { height: 60px; }
    .header-content { padding: 0 20px; }
    .site-logo { font-size: 1.1rem; }
    
    #toc-container { top: auto; bottom: 20px; right: 20px; border-radius: 50%; width: 55px; height: 55px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); justify-content: center; }
    #toc-header { justify-content: center; padding: 0; height: 55px; }
    .toc-icon { margin-right: 0; font-size: 24px; }
    #toc-container:not(.expanded):not(.pinned) .toc-text { display: none; }
    
    #toc-container.expanded, #toc-container.pinned {
        width: calc(100% - 40px); height: 50vh; bottom: 20px; right: 20px; border-radius: 20px; align-items: flex-start;
    }
    #toc-container.expanded #toc-header, #toc-container.pinned #toc-header { justify-content: flex-start; padding: 0 20px; }
    #toc-container.expanded .toc-text, #toc-container.pinned .toc-text { display: block; }
    
    #audio-player { width: 92%; padding: 12px 15px; flex-wrap: wrap; bottom: -250px; justify-content: center; }
    #audio-player.active { bottom: 85px; }
    .audio-info { width: 100%; text-align: center; margin-bottom: 10px; order: 1; }
    .audio-controls { width: 100%; justify-content: center; margin-bottom: 10px; order: 2; }
    .audio-settings { width: 100%; justify-content: center; order: 3; }
    .dropdown-btn { min-width: 90px; font-size: 0.7rem; }
}

/* --- 10. DARK MODE ÖZEL DÜZELTMELER (EKSTRA GÜÇLENDİRİLDİ) --- */
body.dark-mode #audio-player { background: rgba(30, 41, 59, 0.95); border-color: rgba(255,255,255,0.1); }
body.dark-mode .dropdown-btn { background: rgba(255,255,255,0.1); color: #f1f5f9; border: none; }
body.dark-mode .dropdown-menu { background: rgba(30, 41, 59, 0.98); border: 1px solid rgba(255,255,255,0.1); }
body.dark-mode .dropdown-item { color: #f1f5f9; }
body.dark-mode .dropdown-item:hover { background: var(--highlight); color: white; }
body.dark-mode .control-btn.main { background: var(--highlight); color: white; }
body.dark-mode .volume-header { background: linear-gradient(135deg, #0f172a 0%, #020617 100%); border-bottom: 3px solid var(--highlight); }

/* Progress Bar */
#progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 4px; z-index: 4001; }
#progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent-color), var(--highlight)); width: 0%; }

/* Google Translate */
body { top: 0 !important; }
.goog-te-banner-frame { display: none !important; }
.goog-tooltip { display: none !important; }
.goog-te-gadget-icon { display: none !important; }

#translate-wrapper {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
    width: 45px; height: 45px; cursor: pointer;
}
#translate-wrapper i {
    position: absolute; z-index: 1; font-size: 1.4rem; color: var(--text-main); pointer-events: none;
}
#translate-wrapper:hover i { color: var(--highlight); transform: rotate(15deg); transition: all 0.3s ease; }

#google_translate_element {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; opacity: 0.01; overflow: hidden;
}
.goog-te-gadget-simple {
    width: 100% !important; height: 100% !important; padding: 0 !important; margin: 0 !important;
    border: none !important; display: block !important;
}
.goog-te-menu-value { display: none !important; }

body.dark-mode #translate-wrapper i { color: #f1f5f9; }
body.dark-mode #translate-wrapper:hover i { color: var(--highlight); }
.goog-te-menu-frame {
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    border-radius: 12px !important; border: 1px solid rgba(255,255,255,0.1) !important;
    top: 80px !important;
}

/* Footer Links */
.footer-legal-links a {
    color: #888; text-decoration: none; font-weight: 500; font-size: 0.85rem; transition: color 0.2s ease;
}
.footer-legal-links a:hover {
    color: var(--accent-color); text-decoration: underline;
}

/* --- BUY ME A COFFEE & PDF MODAL STİLLERİ --- */

/* Header'daki Kahve Butonu (Sarı ve Dikkat Çekici) */
.icon-btn.coffee-btn {
    color: #f59e0b; /* Sarı */
    background: rgba(245, 158, 11, 0.1);
}
.icon-btn.coffee-btn:hover {
    background: #f59e0b;
    color: white;
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Modal Arka Planı (Karartma) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    z-index: 11000; /* Her şeyin üstünde */
    display: none; /* Varsayılan gizli */
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }

/* Modal Kutusu */
.modal-box {
    background: var(--bg-paper);
    width: 90%; max-width: 450px;
    padding: 40px 30px;
    border-radius: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px); transition: transform 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}
.modal-overlay.show .modal-box { transform: translateY(0); }

.modal-icon { font-size: 3rem; margin-bottom: 15px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }

.modal-box h3 { margin-top: 0; color: var(--text-main); font-size: 1.5rem; }
.modal-box p { font-size: 1rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.6; }

/* Modal Butonları */
.modal-buttons { display: flex; flex-direction: column; gap: 15px; }

.modal-btn {
    padding: 15px; border-radius: 12px; border: none; font-weight: 700; font-size: 1rem; cursor: pointer;
    font-family: var(--font-sans); transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px;
}

.modal-btn.support {
    background: #FFDD00; color: #333; /* Buy Me A Coffee Rengi */
    box-shadow: 0 4px 15px rgba(255, 221, 0, 0.3);
}
.modal-btn.support:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 221, 0, 0.4); }

.modal-btn.skip {
    background: transparent; border: 2px solid rgba(0,0,0,0.1); color: var(--text-muted);
}
.modal-btn.skip:hover { border-color: var(--text-main); color: var(--text-main); }

/* Kapatma X butonu */
.close-modal-btn {
    position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
}
.close-modal-btn:hover { color: #e53e3e; }

/* Dark Mode Uyumu */
body.dark-mode .modal-box { border: 1px solid rgba(255,255,255,0.1); }
body.dark-mode .modal-btn.skip { border-color: rgba(255,255,255,0.1); color: #94a3b8; }
body.dark-mode .modal-btn.skip:hover { border-color: #fff; color: #fff; }

