@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f4f7f6; 
    --text-dark: #0f172a;
    --text-muted: #475569;
    
    /* MEB Uygun / Resmi Kurumsal Renk Paleti (Gökkuşağı Etkisi Yaratmaz) */
    --accent-1: #0f766e; /* Koyu Çam Yeşili */
    --accent-2: #1d4ed8; /* Kraliyet Mavisi */
    --accent-3: #b45309; /* Koyu Kehribar */
    --accent-4: #be123c; /* Gül Kurusu / Bordo */
    --accent-5: #431407; /* Koyu Toprak / Osmanlıca için */
    --accent-6: #334155; /* Antrasit Gri / Temel İslam için */
    --accent-7: #0369a1; /* Okyanus Mavisi / Sanat için */
    --accent-8: #115e59; /* Derin Petrol / Proje için */

    --btn-pdf: #be123c;
    --btn-audio: #2563eb;
    --btn-premium: #d97706; 
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* İLERLEME ÇUBUĞU (PREMIUM) */
.scroll-progress {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    z-index: 9999; transition: width 0.1s;
}

.container { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem; }

/* OPTİMİZE EDİLMİŞ PREMIUM BANNER */
.header-meslek {
    text-align: center; 
    margin-bottom: 2.5rem; 
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b); 
    border-radius: 20px; 
    color: #ffffff;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    position: relative; 
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

.header-meslek::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 10% 20%, rgba(255,215,0,0.05) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.badge-premium {
    display: inline-block; background: rgba(217, 119, 6, 0.2); color: #fde047;
    border: 1px solid rgba(250, 204, 21, 0.3); padding: 6px 18px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700; letter-spacing: 1px; margin-bottom: 1.25rem;
}

.header-content { position: relative; z-index: 10; }
.title { font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 0.5rem; }
.subtitle { font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 400; color: #cbd5e1; }

/* ARAMA VE KONTROL ÇUBUĞU */
.controls-container {
    display: flex; gap: 1rem; max-width: 800px; margin: 0 auto 3rem auto;
    align-items: stretch;
}

.search-container {
    position: relative; flex: 1;
}
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.2rem; }
.search-container input {
    width: 100%; height: 100%; padding: 16px 20px 16px 55px; border-radius: 12px;
    border: 2px solid #e2e8f0; background: white; font-size: 1rem; color: var(--text-dark);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); transition: all 0.3s;
}
.search-container input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2); }

.toggle-all-btn {
    background: #1e293b; color: white; border: none; padding: 0 1.5rem;
    border-radius: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.toggle-all-btn:hover { background: #0f172a; transform: translateY(-2px); }

@media (max-width: 768px) {
    .controls-container { flex-direction: column; }
    .toggle-all-btn { padding: 16px 20px; justify-content: center; }
}

/* YÖNLENDİRME KARTLARI (YATAY) */
.flex-horizontal {
    display: flex; justify-content: space-between; align-items: center;
    background: white; border-radius: 16px; padding: 2rem 2.5rem; margin-bottom: 3rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08); 
    border-left: 5px solid var(--btn-premium); text-align: left;
}
.flex-horizontal .ed-text { flex: 1; margin-right: 2rem; }
.flex-horizontal h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text-dark); display: flex; align-items: center; gap: 0.6rem; }
.flex-horizontal p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.text-gold { color: var(--btn-premium); }
.mt-2 { margin-top: 4rem; }

.premium-link {
    background: linear-gradient(135deg, var(--btn-premium), #a16207); color: white !important;
    padding: 1rem 2.5rem; border-radius: 12px; font-weight: 600; font-size: 1.05rem;
    text-decoration: none; box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    transition: all 0.3s ease; white-space: nowrap; display: flex; align-items: center; gap: 0.8rem;
}
.premium-link:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4); }

/* AKORDİYON MENÜLER (BEYAZ YAZI / KOYU ZEMİN GARANTİLİ) */
.category-section {
    background: white; border-radius: 16px; margin-bottom: 2rem;
    box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.04); overflow: hidden; border: 1px solid #e2e8f0;
}

/* Tüm başlıklar ortak lacivert renk alır, soldaki kalın çizgi rengi değişir */
.category-header {
    padding: 1.25rem 2rem; cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; 
    background: #1e293b; /* Koyu Lacivert Zemin */
    color: #ffffff; /* Kesin Beyaz Yazı */
    transition: background 0.3s ease;
}
.category-header:hover { background: #0f172a; }

/* Kenar Çizgileri - Kurumsal Palet */
.accent-1 { border-left: 6px solid var(--accent-1); }
.accent-2 { border-left: 6px solid var(--accent-2); }
.accent-3 { border-left: 6px solid var(--accent-3); }
.accent-4 { border-left: 6px solid var(--accent-4); }
.accent-5 { border-left: 6px solid var(--accent-5); }
.accent-6 { border-left: 6px solid var(--accent-6); }
.accent-7 { border-left: 6px solid var(--accent-7); }
.accent-8 { border-left: 6px solid var(--accent-8); }

.category-title { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; justify-content: space-between; width: 100%; letter-spacing: -0.5px; }
.category-title i:not(.fa-chevron-down) { opacity: 0.9; margin-right: 0.75rem; font-size: 1.3rem; }
.toggle-icon { transition: transform 0.3s ease; }
.category-header.active .toggle-icon { transform: rotate(180deg); }

.category-content { max-height: 0; overflow: hidden; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.5s; padding: 0 2rem; background: #fafafa; }
.category-content.active { max-height: 6000px; padding: 2.5rem 2rem; }

/* KİTAP GRID (HER ZAMAN ORTALI VE SABİT GENİŞLİKLİ) */
.books-grid { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; /* Kitap sayısından bağımsız tam ortalama */
    gap: 2rem; 
}

/* KART TASARIMI */
.book-card {
    background: white; border-radius: 12px; padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
    border: 1px solid #f1f5f9; display: flex; flex-direction: column; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 280px; /* Standart Kart Genişliği */
}
.book-card:hover { transform: translateY(-6px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }

/* KİTAP KAPAK GÖRSELİ (KESİLMEYEN SABİT BOYUT) */
.book-image {
    width: 100%; 
    height: 300px; /* Tüm resimler tam olarak 300px alanda durur */
    margin-bottom: 1.5rem; border-radius: 8px;
    background: #f8fafc; display: flex; align-items: center; 
    justify-content: center; position: relative; padding: 10px;
}
.book-image img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; /* Görseli kesmeden kutuya sığdırır */
    transition: transform 0.4s ease;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.12)); 
}
.book-card:hover .book-image img { transform: scale(1.05); }

/* YENİ VE PROJE ROZETLERİ */
.ribbon-new, .badge-project {
    position: absolute; top: 15px; right: -35px; width: 140px; color: white;
    text-align: center; font-size: 0.8rem; font-weight: 800; letter-spacing: 1px;
    transform: rotate(45deg); padding: 6px 0; box-shadow: 0 4px 6px rgba(0,0,0,0.3); z-index: 10;
}
.ribbon-new { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.badge-project { background: linear-gradient(135deg, #475569, #1e293b); } /* Proje rozeti daha kurumsal */

/* AKSİYON BUTONLARI */
.book-actions { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; justify-content: flex-end; }
.book-title { font-size: 1.05rem; font-weight: 700; text-align: center; color: var(--text-dark); margin-bottom: 1rem; line-height: 1.4; letter-spacing: -0.3px; }

.book-actions a {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.8rem 1rem; border-radius: 8px; color: white !important; font-size: 0.9rem;
    font-weight: 600; text-decoration: none !important; transition: all 0.2s ease;
}
.book-actions a:hover { transform: translateY(-2px); filter: brightness(1.15); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }

.pdf-link { background: var(--btn-pdf); }
.audio-link { background: var(--btn-audio); }

/* PREMIUM FOOTER */
.footer {
    background: #020617; color: #94a3b8; padding: 4rem 1.5rem 3rem 1.5rem; 
    margin-top: 2rem; border-top: 4px solid #1e293b;
}
.footer-container { max-width: 1280px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.footer-logo a { display: inline-flex; flex-direction: column; align-items: center; gap: 0.8rem; color: white; text-decoration: none; transition: opacity 0.3s; }
.footer-logo a:hover { opacity: 0.8; }
.footer-logo-img { height: 45px; object-fit: contain; }
.footer-text { font-size: 1.25rem; font-weight: 700; letter-spacing: 1px; }
.footer-copyright { margin-top: 1.5rem; font-size: 0.9rem; font-weight: 400; }

/* YUKARI ÇIK BUTONU */
#scrollToTopBtn {
    display: none; position: fixed; bottom: 30px; right: 30px; z-index: 99; border: none; outline: none; 
    background: linear-gradient(135deg, #1e293b, #0f172a); color: white; cursor: pointer; padding: 15px; 
    border-radius: 50%; font-size: 18px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.3s, transform 0.3s; width: 50px; height: 50px; align-items: center; justify-content: center;
}
#scrollToTopBtn:hover { transform: translateY(-4px); filter: brightness(1.2); }

/* MOBİL UYUM */
@media (max-width: 768px) {
    .container { padding: 1.5rem 1rem; }
    .header-meslek { padding: 2rem 1rem; border-radius: 12px; margin-bottom: 1.5rem; }
    .title { font-size: 1.8rem; }
    .category-header { padding: 1.25rem 1.25rem; }
    .category-title { font-size: 1.05rem; }
    .category-content.active { padding: 1.5rem 1rem; }
    .book-card { width: 100%; max-width: 320px; } 
    .footer { padding: 3rem 1rem; margin-top: 2rem; }
    #scrollToTopBtn { bottom: 20px; right: 20px; width: 45px; height: 45px; font-size: 16px; padding: 0; }
    .flex-horizontal { flex-direction: column; text-align: center; padding: 1.5rem; gap: 1.5rem; }
    .flex-horizontal .ed-text { margin-right: 0; }
    .flex-horizontal h3 { justify-content: center; font-size: 1.15rem; }
    .premium-link { width: 100%; justify-content: center; }
}