/*
Theme Name: İzmit Sözlük
Theme URI: https://localhost/izmit-sozluk
Description: Ekşi Sözlük mantığında, sol frame sabit, AJAX tabanlı sözlük teması.
Author: Gemini & User
Version: 3.0
*/

/* --- 1. DEĞİŞKENLER --- */
:root {
    --bg-body: #ebebed; --bg-sidebar: #f5f5f5; --bg-header: #ffffff; --bg-input: #ffffff;
    --text-main: #333333; --text-muted: #888888;
    --color-link: #499e49; --color-hover: #357a35; --border-color: #cccccc;
    --sidebar-width: 280px; --header-height: 50px;
    --color-up: #499e49; --color-down: #cc0000;
    
    /* YENİ: SAĞ SIDEBAR GENİŞLİĞİ */
    --right-sidebar-width: 280px;
}
body.dark-mode {
    --bg-body: #1a1a1a; --bg-sidebar: #222222; --bg-header: #222222; --bg-input: #333333;
    --text-main: #dddddd; --text-muted: #aaaaaa;
    --color-link: #5cb85c; --color-hover: #80c780; --border-color: #444444;
}

/* --- 2. TEMEL --- */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; font-family: 'Verdana', sans-serif; background-color: var(--bg-body); color: var(--text-main); font-size: 14px; line-height: 1.6; transition: background-color 0.3s, color 0.3s; }
a { text-decoration: none; color: var(--color-link); transition: color 0.2s; }
a:hover { text-decoration: underline; color: var(--color-hover); }

/* --- 3. LAYOUT (GÜNCELLENDİ: 3 SÜTUN) --- */
#main-header { height: var(--header-height); background: var(--bg-header); border-bottom: 1px solid var(--border-color); position: fixed; top: 0; left: 0; right: 0; z-index: 1000; display: flex; align-items: center; padding: 0 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: background-color 0.3s, border-color 0.3s; }

/* SOL SIDEBAR */
.sidebar-wrapper { width: var(--sidebar-width); position: fixed; top: var(--header-height); bottom: 0; left: 0; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); overflow-y: auto; z-index: 900; padding: 0; transition: transform 0.3s ease, background-color 0.3s; }

/* SAĞ SIDEBAR (YENİ) */
.right-sidebar-wrapper {
    width: var(--right-sidebar-width);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    right: 0;
    background-color: transparent; /* Genelde transparan olur */
    overflow-y: auto;
    z-index: 800;
    padding: 20px 10px;
    display: block; /* Masaüstünde görünür */
}

/* ORTA İÇERİK (Marjlar ayarlandı) */
#primary-content {
    margin-left: var(--sidebar-width);
    margin-right: var(--right-sidebar-width); /* Sağ boşluk */
    margin-top: var(--header-height);
    padding: 20px;
    /* max-width kaldırıldı veya büyütüldü çünkü sağ alan var */
    max-width: 100%; 
}

/* Admin Bar Fix */
body.admin-bar #main-header { top: 32px; }
body.admin-bar .sidebar-wrapper { top: calc(var(--header-height) + 32px); }
body.admin-bar .right-sidebar-wrapper { top: calc(var(--header-height) + 32px); }
@media screen and (max-width: 782px) { 
    body.admin-bar #main-header { top: 46px; } 
    body.admin-bar .sidebar-wrapper, body.admin-bar .right-sidebar-wrapper { top: calc(var(--header-height) + 46px); } 
}

#mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 950; }

/* --- 4. HEADER & ARAMA --- */
.header-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1400px; margin: 0 auto; } /* max-width arttırıldı */
.logo { font-weight: bold; font-size: 20px; color: var(--text-main); letter-spacing: -0.5px; }

.search-bar form { display: flex; position: relative; }
.search-bar input { padding: 6px 10px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-main); border-radius: 3px 0 0 3px; width: 300px; outline: none; }
.search-bar button { padding: 6px 15px; background: var(--color-link); color: #fff; border: none; border-radius: 0 3px 3px 0; cursor: pointer; }

/* CANLI ARAMA */
.search-suggestions { position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-input); border: 1px solid var(--border-color); border-top: none; z-index: 1100; box-shadow: 0 4px 6px rgba(0,0,0,0.1); border-radius: 0 0 3px 3px; display: none; }
.search-suggestions ul { list-style: none; padding: 0; margin: 0; }
.search-suggestions li { border-bottom: 1px solid var(--border-color); }
.search-suggestions li:last-child { border-bottom: none; }
.search-suggestions a { display: block; padding: 8px 10px; color: var(--text-main); font-size: 13px; text-decoration: none; }
.search-suggestions a:hover { background-color: rgba(0,0,0,0.05); color: var(--color-link); }
.search-suggestions .loading, .search-suggestions .no-result { padding: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }
.search-user-item a { font-weight: bold; color: var(--text-muted); font-style: italic; }

.user-actions { font-size: 13px; }
.user-actions a { color: var(--text-main); margin-left: 8px; }
#theme-toggle { color: var(--text-main); }
#mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-main); padding: 0; margin-right: 15px; }

/* --- 5. SOL SIDEBAR --- */
.sidebar-tabs { display: flex; border-bottom: 1px solid var(--border-color); background: rgba(0,0,0,0.05); }
.tab-btn { flex: 1; background: none; border: none; padding: 10px 0; cursor: pointer; font-size: 13px; font-weight: bold; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--text-main); border-bottom: 2px solid var(--color-link); background: var(--bg-sidebar); }
.topic-list { padding: 10px; }
.topic-list ul { list-style: none; padding: 0; margin: 0; }
.topic-list li { margin-bottom: 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
.topic-list a { color: var(--text-main); display: block; font-size: 13px; }
.topic-list small { color: var(--text-muted); font-size: 11px; float: right; }
.sidebar-footer { padding: 15px; text-align: center; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border-color); margin-top: 20px; }

/* --- 6. İÇERİK --- */
.page-title { font-size: 24px; font-weight: bold; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; color: var(--text-main); }
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-title { font-size: 22px; font-weight: bold; margin: 0; color: var(--text-main); }
.entry-title a { color: var(--text-main); }
.entry-content { font-size: 14px; color: var(--text-main); margin-bottom: 15px; word-wrap: break-word; }
.entry-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; }
.vote-actions { display: flex; gap: 10px; }
.vote-btn { cursor: pointer; color: var(--text-muted); font-size: 14px; user-select: none; }
.vote-btn:hover { color: var(--text-main); }
.vote-btn.active-up { color: var(--color-up); font-weight: bold; }
.vote-btn.active-down { color: var(--color-down); font-weight: bold; }
.voted .vote-btn:not(.active-up):not(.active-down) { opacity: 0.3; pointer-events: none; }
.entry-meta-right { text-align: right; color: var(--text-muted); }
.entry-divider { border: 0; border-bottom: 1px dashed var(--border-color); margin: 25px 0; }
.entry-image { max-width: 100%; height: auto; display: block; margin: 10px 0; border-radius: 4px; }
.entry-content iframe, .entry-content object, .entry-content embed { max-width: 100%; }
.entry-content .twitter-tweet, .entry-content .instagram-media { margin: 10px auto !important; }

/* --- 7. FORMLAR & BUTONLAR --- */
.form-wrapper, .auth-box { max-width: 500px; margin-bottom: 50px; }
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); background: var(--bg-input); color: var(--text-main); border-radius: 4px; }
.submit-btn { background: var(--color-link); color: #fff; border: none; padding: 10px 25px; cursor: pointer; font-size: 14px; font-weight: bold; border-radius: 4px; }
.create-topic-btn { display: inline-block; background-color: var(--color-link); color: #fff !important; padding: 12px 24px; border-radius: 4px; font-weight: bold; text-decoration: none; }
.msg-box { padding: 15px; margin-bottom: 20px; border-radius: 4px; border: 1px solid; }
.msg-box.error { background: rgba(255, 0, 0, 0.1); color: #cc0000; border-color: #ffcccc; }
.editor-toolbar { margin-bottom: 5px; background: var(--bg-input); border: 1px solid var(--border-color); border-bottom: none; padding: 5px; border-radius: 4px 4px 0 0; display: flex; gap: 5px; flex-wrap: wrap; }
.tool-btn { background: #f0f0f0; border: 1px solid #ccc; padding: 2px 8px; font-size: 11px; cursor: pointer; border-radius: 3px; color: #333; }
.tool-btn:hover { background: #e0e0e0; }
.spoiler-btn { background: #333; color: #fff; border: none; padding: 5px 10px; font-size: 11px; cursor: pointer; border-radius: 3px; margin-bottom: 5px; }
.spoiler-content { display: none; padding: 10px; background: rgba(0,0,0,0.05); border-left: 3px solid #333; }
blockquote { margin: 15px 0; padding: 10px 15px; border-left: 4px solid var(--border-color); background-color: rgba(0,0,0,0.03); color: var(--text-muted); font-style: italic; font-size: 13px; }

/* SAĞ SIDEBAR WIDGET STİLLERİ */
.widget { margin-bottom: 20px; }
.widget-title { font-size: 14px; font-weight: bold; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; margin-bottom: 10px; color: var(--text-main); }

/* --- 9. MOBİL UYUMLULUK --- */
@media (max-width: 992px) {
    /* Tablet ve Mobilde Sağ Sidebarı Gizle */
    .right-sidebar-wrapper { display: none; }
    /* İçerik alanını tekrar genişlet */
    #primary-content { margin-right: 0; }
}

@media (max-width: 768px) {
    :root { --header-height: 90px; }
    .header-inner { flex-wrap: wrap; padding: 5px 10px; align-content: center; }
    #mobile-menu-toggle { display: block; order: 1; margin-right: 10px; height: 40px; }
    .logo { order: 2; font-size: 18px; margin-right: 10px; white-space: nowrap; height: 40px; display: flex; align-items: center; }
    .search-bar { display: block; order: 3; flex: 1; min-width: 100px; height: 40px; display: flex; align-items: center; }
    .search-bar form { width: 100%; }
    .search-bar input { width: 100% !important; height: 34px; font-size: 13px; }
    .search-bar button { display: none; }
    .header-actions-right { order: 4; width: 100%; display: flex; justify-content: flex-end; align-items: center; height: 35px; border-top: 1px solid var(--border-color); margin-top: 5px; padding-top: 5px; }
    .sidebar-wrapper { display: block; width: 100%; max-width: none; transform: translateX(-100%); box-shadow: 2px 0 10px rgba(0,0,0,0.1); z-index: 2000; }
    .sidebar-wrapper.active { transform: translateX(0); }
    #mobile-overlay.active { display: block; }
    #primary-content { margin-left: 0; width: 100%; padding: 15px; margin-top: var(--header-height); }
    .search-result-item { flex-direction: column; align-items: flex-start; }
}