/* ==========================================================================
   1. DEĞİŞKENLER & RENK PALETİ
   ========================================================================== */
:root {
    --bg-body: #ffffff;
    --bg-card: #f8f9fa;
    --text-main: #333333;
    --text-heading: #000000;
    --text-muted: #666666;
    --primary-color: #32d484;
    --primary-text: #000000;
    --border-color: #e9ecef;
    --input-bg: #f1f3f5;
    --header-height: 80px;
    --shadow-card: none;
    --shadow-hover: none;
}

[data-theme="dark"] {
    --bg-body: #161623;
    --bg-card: #1e1e2d;
    --text-main: #e2e2e2;
    --text-heading: #ffffff;
    --text-muted: #a0a0a0;
    --primary-color: #32d484;
    --primary-text: #000000;
    --border-color: #2a2a3c;
    --input-bg: #13131f;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.2);
    --shadow-hover: 0 5px 15px rgba(0,0,0,0.3);
}

/* ==========================================================================
   2. TEMEL AYARLAR
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex; flex-direction: column;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.2s ease; }
a:hover { color: var(--primary-color); }
ul { list-style: none; padding: 0; margin: 0; }

/* Uzay Efekti */
body.home[data-theme="dark"] {
    background-color: #0b0b10;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    animation: spaceMove 120s linear infinite;
}
@keyframes spaceMove {
    from { background-position: 0 0, 40px 60px, 130px 270px; }
    to { background-position: 550px 550px, 390px 410px, 380px 520px; }
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000; padding: 0 40px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s ease;
}
body.home .site-header { background-color: transparent !important; border-bottom: none !important; }

.header-inner { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.header-left, .header-right { display: flex; align-items: center; gap: 20px; }
.theme-toggle-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; }
.user-nav-link {
    font-size: 0.9rem; font-weight: 600; padding: 10px 20px;
    border-radius: 50px; background: var(--bg-card); color: var(--text-heading);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   4. ANA İÇERİK
   ========================================================================== */
.site-main {
    flex: 1 0 auto; width: 100%; padding: 0 20px;
    display: flex; flex-direction: column;
}
body.home .site-main { justify-content: center; align-items: center; margin: 0; }
body:not(.home) .site-main { max-width: 1100px; margin: 120px auto 40px; display: block; }

.hero-section { width: 100%; max-width: 700px; text-align: center; position: relative; z-index: 10; }
.site-title-large { font-size: 3.5rem; font-weight: 700; color: var(--text-heading); margin-bottom: 10px; }
.site-description { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 40px; }

/* ==========================================================================
   5. ARAMA KUTUSU (İKON DÜZELTİLDİ)
   ========================================================================== */
.search-container-wrapper { 
    position: relative; 
    width: 100%; 
    z-index: 5000; 
    margin-bottom: 20px; 
}

.search-input-group { 
    position: relative; 
    width: 100%; 
    display: flex; 
    align-items: center;
}

/* İKON DÜZELTMESİ BURADA: HTML'deki sınıfı hedefler ve içeri alır */
.search-icon-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%); /* Tam dikey ortalama */
    z-index: 30;
    pointer-events: none; /* Tıklamayı engelle, inputa geçsin */
    display: flex;
    align-items: center;
    color: var(--text-muted); /* Tema rengine uyumlu */
}

/* Input Ayarı */
.search-input {
    width: 100%; 
    padding: 18px 60px 18px 55px; /* Soldan 55px boşluk (Yazı ikonun üstüne binmez) */
    background-color: var(--input-bg); 
    border: 1px solid var(--border-color);
    border-radius: 50px; 
    font-size: 1.1rem; 
    color: var(--text-heading);
    outline: none; 
    box-shadow: var(--shadow-card);
    height: auto;
}
.search-input:focus { border-color: var(--primary-color); background-color: var(--bg-body); }

/* Sağ Buton */
.search-submit-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--border-color); color: var(--text-muted);
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    z-index: 20;
}
.search-submit-btn:hover { background: var(--primary-color); color: #000; }

.live-search-dropdown {
    position: absolute; top: 110%; left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 16px; z-index: 9999;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    display: none; text-align: left; overflow: hidden;
}
.live-search-list li { border-bottom: 1px solid var(--border-color); }
.live-search-list li a { display: block; padding: 15px 20px; color: var(--text-heading); font-weight: 500; }
.live-search-list li a:hover { background: var(--input-bg); color: var(--primary-color); }

/* ==========================================================================
   6. TICKER (MASAÜSTÜ)
   ========================================================================== */
.ticker-stack-wrapper {
    position: relative; max-width: 500px; margin: 30px auto 0;
    height: 90px; z-index: 1;
}
.ticker-stack-wrapper::before, .ticker-stack-wrapper::after {
    content: ''; position: absolute; background: var(--bg-body); 
    border: 1px solid var(--border-color); border-radius: 12px;
}
.ticker-stack-wrapper::before { top: 16px; left: 30px; right: 30px; height: 100%; z-index: -2; opacity: 0.3; }
.ticker-stack-wrapper::after { top: 8px; left: 15px; right: 15px; height: 100%; z-index: -1; opacity: 0.6; }

.ticker-card-front {
    background: var(--bg-body); border: 1px solid rgba(50, 212, 132, 0.5);
    border-radius: 12px; height: 100%; width: 100%;
    position: relative; z-index: 2; overflow: hidden; display: flex; align-items: center;
    box-shadow: var(--shadow-card);
}
.ticker-item {
    position: absolute; width: 100%; height: 100%; padding: 0 25px;
    display: flex; align-items: center; opacity: 0;
    transform: translateY(15px); transition: 0.5s; pointer-events: none;
}
.ticker-item.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ticker-link { display: flex; justify-content: space-between; align-items: center; width: 100%; text-decoration: none; }
.ticker-content { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.ticker-title { font-size: 1.05rem; font-weight: 700; color: var(--text-heading); margin-bottom: 5px; }
.ticker-tag { color: var(--primary-color); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; border: 1px solid rgba(50, 212, 132, 0.3); padding: 2px 6px; border-radius: 4px; }
.ticker-time { font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   7. KART DÜZENİ (PROFİL) & ARAMA SONUÇLARI (LİSTE)
   ========================================================================== */
.terms-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 20px;
}

/* Profil Kartları */
.term-card-mini {
    background: var(--bg-card); border: 1px solid var(--border-color);
    padding: 20px 25px; border-radius: 12px;
    display: flex; justify-content: space-between; align-items: center;
    transition: 0.2s; text-decoration: none;
    color: var(--text-heading); font-weight: 600; font-size: 1.1rem;
    box-shadow: var(--shadow-card);
}
.term-card-mini:hover { border-color: var(--primary-color); transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* ARAMA SONUÇLARI (GROKIPEDIA LISTE TARZI - DÜZELTİLDİ) */
.results-list { display: flex; flex-direction: column; gap: 0; }

.result-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 10px; 
    border-bottom: 1px solid var(--border-color); /* Alt çizgi */
    background: transparent; /* Şeffaf */
    color: var(--text-heading); font-weight: 600; font-size: 1.1rem;
    transition: 0.2s; text-decoration: none;
}
.result-item:hover { color: var(--primary-color); padding-left: 15px; }
.result-item .item-arrow { color: var(--text-muted); font-size: 1.2rem; }
.result-item:hover .item-arrow { color: var(--primary-color); }

.search-results-container { max-width: 800px; margin: 0 auto; }
.search-header { margin-bottom: 30px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.results-count { font-size: 1.2rem; color: var(--text-heading); margin-top: 15px; }
.no-results-msg { text-align: center; padding: 40px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-muted); }

.term-info { display: flex; flex-direction: column; gap: 5px; }
.term-link { font-weight: 600; color: var(--text-heading); display: block; }
.term-date { font-size: 0.8rem; color: var(--text-muted); font-weight: normal; }
.term-status .badge { font-size: 0.7rem; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,0.1); }
.term-status .badge.success { color: var(--primary-color); }

/* ==========================================================================
   8. WIKI İÇERİK & TABLOLAR (DÜZELTİLDİ: KIRMA VE LİNK RENGİ EKLENDİ)
   ========================================================================== */
.terim-wrapper { max-width: 800px; margin: 0 auto; }
.wiki-article { background: var(--bg-card); padding: 40px; border-radius: 12px; border: 1px solid var(--border-color); }
.entry-title { font-size: 2.5rem; font-weight: 800; color: var(--text-heading); margin-bottom: 15px; }
.entry-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }

/* --- İŞTE EKSİK OLAN KISIMLAR BURADA EKLENDİ --- */
.wiki-content { 
    font-size: 1.1rem; 
    color: var(--text-main); 
    line-height: 1.8;
    
    /* Uzun kelimeleri kırma (Satır taşmasını önler) */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* İçerik içindeki linkleri YEŞİL yapar */
.wiki-content a {
    color: var(--primary-color);
    font-weight: 500;
}
.wiki-content a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.wiki-content p { margin-bottom: 25px; display: block; }

.wiki-content h2 { 
    font-size: 1.6rem; color: var(--text-heading); margin-top: 40px; margin-bottom: 20px; 
    border-left: 5px solid var(--primary-color); padding-left: 20px; line-height: 1.3; 
}
.wiki-content ul { list-style: none; margin-bottom: 25px; padding-left: 10px; }
.wiki-content ul li { position: relative; padding-left: 25px; margin-bottom: 10px; color: var(--text-main); }
.wiki-content ul li::before { 
    content: "•"; color: var(--primary-color); position: absolute; left: 0; top: -5px; 
    font-weight: bold; font-size: 1.8rem; 
}
.wiki-content ol { list-style-type: decimal !important; padding-left: 25px; margin-bottom: 25px; color: var(--text-main); }
.wiki-content ol li { margin-bottom: 10px; padding-left: 5px; }

/* --- TABLO DÜZELTMESİ (TAŞMAYI ENGELLER) --- */
.wiki-content table {
    display: block; 
    width: 100%;
    overflow-x: auto; 
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    white-space: nowrap; 
}
.wiki-content table th {
    background-color: var(--input-bg);
    color: var(--text-heading);
    font-weight: 800;
    padding: 18px 25px;
    text-align: left;
    border-bottom: 2px solid var(--primary-color);
}
.wiki-content table td {
    padding: 16px 25px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.wiki-content table tbody tr:nth-child(even) { background-color: rgba(50, 212, 132, 0.04); }
.wiki-content table tr:last-child td { border-bottom: none; }

/* ==========================================================================
   9. FORMLAR & PROFİL (DÜZELTİLDİ: İKON KONUMLARI)
   ========================================================================== */
.profile-header { background: var(--bg-card); padding: 30px; border-radius: 12px; border: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.user-info { display: flex; align-items: center; gap: 20px; }
.user-avatar img { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--border-color); object-fit: cover; }
.profile-actions-icons { display: flex; gap: 10px; }
.action-btn { width: 45px; height: 45px; border-radius: 50%; background: var(--input-bg); color: var(--text-heading); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color); }
.action-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }

.auth-card { width: 100%; max-width: 500px; margin: 0 auto; background: var(--bg-card); padding: 30px; border-radius: 12px; border: 1px solid var(--border-color); }
.auth-tabs { display: flex; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); }
.auth-tab { flex: 1; padding: 12px; background: none; border: none; color: var(--text-muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.icon-group { position: relative; margin-bottom: 25px; }
.icon-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-heading); }

/* Giriş Formu İkon Düzeltmesi (İçeri Aldık) */
.input-icon-wrapper { 
    position: absolute; top: 40px; /* Label altına denk gelir */
    left: 15px; width: 20px; height: 20px; 
    z-index: 5; pointer-events: none; color: var(--text-muted); 
}
.iconic-input { 
    width: 100%; height: 50px; 
    padding-left: 45px; /* İkon payı */
    padding-right: 15px; 
    background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 8px; 
    color: var(--text-heading); outline: none; 
}
.iconic-input:focus { border-color: var(--primary-color); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-heading); }

.neon-btn { width: 100%; padding: 12px; background: var(--primary-color); color: #000 !important; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; text-align: center; }
.neon-btn:hover { opacity: 0.9; }
a.neon-btn:hover, button.neon-btn:hover { color: #000000 !important; background-color: var(--primary-color) !important; }

.profile-upload-section { display: flex; align-items: center; gap: 20px; padding: 15px; background: var(--input-bg); border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 25px; }
.current-avatar img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.wp-editor-container { border: 1px solid var(--border-color); background: #ffffff; border-radius: 8px; overflow: hidden; }
.quicktags-toolbar { background: #f0f0f1; border-bottom: 1px solid #ccc; padding: 5px; }
.wp-editor-area { width: 100%; padding: 15px; min-height: 250px; border: none; outline: none; background: #fff !important; color: #333 !important; }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
.site-footer-grok {
    flex-shrink: 0; width: 100%; padding: 20px 40px;
    background: transparent; border-top: none; font-size: 0.85rem;
    position: relative; margin-top: auto;
}
body.home .site-footer-grok { position: absolute; bottom: 0; left: 0; right: 0; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; }
.footer-nav-wrapper { flex: 1; text-align: left; }
.footer-links { display: flex; gap: 20px; padding: 0; margin: 0; }
.footer-stat { text-align: center; position: absolute; left: 50%; transform: translateX(-50%); bottom: 20px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; display: block; }
.stat-number { font-size: 1.2rem; font-weight: 700; color: var(--text-heading); }
.footer-right-placeholder { flex: 1; text-align: right; color: var(--text-muted); }

/* ==========================================================================
   11. MOBİL UYUMLULUK (DÜZELTİLMİŞ)
   ========================================================================== */
@media (max-width: 768px) {
    .site-header, .site-footer-grok { padding: 15px 15px; }
    .site-main { padding: 0 10px; margin-top: 90px; }
    body.home .site-main { padding: 0 15px; }
    .site-title-large { font-size: 2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* TICKER DÜZELTMESİ (BAŞLIK SOLDA - SAAT SAĞDA YAN YANA) */
    .ticker-stack-wrapper { 
        height: auto; margin-top: 30px; 
    }
    .ticker-card-front { height: auto; }
    .ticker-item { 
        position: relative; padding: 15px 20px; 
        top: auto; left: auto; opacity: 1; display: none; 
    }
    .ticker-item.active { display: block; } 
    
    .ticker-link { 
        display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 15px;
    }
    .ticker-content { flex: 1; margin-bottom: 0; text-align: left; }
    .ticker-title { font-size: 1rem; margin-bottom: 4px; line-height: 1.2; }
    .ticker-time { 
        align-self: center; font-size: 0.75rem; 
        white-space: nowrap; font-weight: 600; color: var(--primary-color); margin-top: 0;
    }

    .footer-content { flex-direction: column; align-items: center; gap: 20px; }
    .footer-stat { position: relative; left: auto; transform: none; bottom: auto; }
    .footer-nav-wrapper, .footer-right-placeholder { text-align: center; }
    .footer-links { justify-content: center; }
    
    .wiki-article, .profile-header, .auth-card { padding: 20px 15px; }
    .terms-grid { grid-template-columns: 1fr; }
    .result-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .result-item .item-arrow { display: none; }
}
