/* ============================================================
   METİN2 FORUM TEMASI
   Koyu gece zemini + amber/altın vurgu (Yang parası rengi)
   XenForo tarzı kart düzeni, modern ve responsive
   ============================================================ */

:root {
    /* Renk paleti — Reign2 (derin siyah + kraliyet altını + mor) */
    --bg:          #08060a;   /* en arka zemin - reign2 teması */
    --bg-alt:      #0f0d14;   /* bloklar */
    --bg-card:     #15121d;   /* kartlar */
    --bg-hover:    #1c1828;   /* hover */
    --border:      #2a2336;   /* kenarlıklar */
    --border-soft: #1d1828;

    --text:        #e8e4f0;   /* ana metin */
    --text-dim:    #9088a3;   /* soluk metin */
    --text-muted:  #635a73;   /* en soluk */

    --accent:      #e0a516;   /* kraliyet altını */
    --accent-warm: #ffd23f;   /* parlak altın */
    --accent-dark: #b8860b;   /* koyu altın */

    --royal:       #9b59ff;   /* kraliyet moru */
    --royal-dark:  #6c3fc4;

    --green:       #3fb950;   /* başarı/online */
    --red:         #ff3860;   /* uyarı/sat */
    --blue:        #4a9eda;   /* link/al */

    --radius:      11px;
    --radius-sm:   7px;
    --shadow:      0 2px 10px rgba(0,0,0,.5);
    --shadow-lg:   0 12px 40px rgba(0,0,0,.6);

    --font:        'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display:'Cinzel', 'Poppins', serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-warm); }

img { max-width: 100%; }

/* ---------- Düzen / Konteyner ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Üst bar (ince, sosyal linkler) ---------- */
.topbar {
    background: #0a0e14;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12.5px;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 38px; }
.topbar a { color: var(--text-dim); margin-left: 18px; }
.topbar a:hover { color: var(--accent); }
.topbar-left { color: var(--text-muted); }

/* ---------- Header (logo + arama) ---------- */
.header {
    background: linear-gradient(180deg, #161e2a, #121823);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo {
    font-size: 26px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -.5px;
}
.logo-img { height: 46px; width: auto; display: block; }
.logo-text { font-family: var(--font-display); font-weight: 700; letter-spacing: .5px; }
.logo b { color: var(--accent); font-weight: 700; }
.logo .logo-mark {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent-dark));
    border-radius: 10px;
    display: grid; place-items: center;
    color: #0f141c; font-weight: 800; font-size: 21px;
    font-family: var(--font-display);
    box-shadow: 0 3px 14px rgba(224,165,22,.4);
}

/* Arama kutusu */
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 9px 16px 9px 40px;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box::before {
    content: "🔍"; position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); font-size: 13px; opacity: .5;
}

/* ---------- Navigasyon ---------- */
.nav {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; list-style: none; }
.nav-links a {
    display: block;
    padding: 14px 18px;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 13.5px;
    border-bottom: 2px solid transparent;
    transition: all .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active { color: var(--accent); border-bottom-color: var(--accent); }

.nav-account { display: flex; align-items: center; gap: 8px; }
.nav-account .username-link { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; padding: 6px 10px; border-radius: var(--radius-sm); }
.nav-account .username-link:hover { background: var(--bg-hover); }

/* ---------- Butonlar ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn:hover { background: var(--border); color: var(--text); border-color: var(--text-muted); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #0f141c; border: none; font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-warm), var(--accent)); color: #0f141c; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Sayfa gövdesi ---------- */
.page { flex: 1; padding: 24px 0 40px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 600; color: var(--text); }
.page-title small { display: block; font-size: 13px; font-weight: 400; color: var(--text-dim); margin-top: 2px; }

/* İki sütun düzeni (içerik + sidebar) */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); }

/* ---------- Kategori bloğu ---------- */
.category { margin-bottom: 22px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.category-head {
    background: linear-gradient(180deg, #181221, #0f0d14);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.category-icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(224,165,22,.18), rgba(155,89,255,.12));
    border: 1px solid var(--border);
    display: grid; place-items: center;
    font-size: 20px;
}
.category-head .cat-text { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.category-head h2 { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--font-display); letter-spacing: .3px; }
.category-head h2 a { color: var(--text); }
.category-head .cat-desc { font-size: 12px; color: var(--text-dim); }

/* ---------- Forum node satırı ---------- */
.node {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border-soft);
    transition: background .12s;
}
.node:last-child { border-bottom: none; }
.node:hover { background: var(--bg-hover); }
.node-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1f1830, #15121d);
    border: 1px solid var(--border);
    display: grid; place-items: center;
    font-size: 20px; color: var(--accent);
}
.node.unread .node-icon { background: linear-gradient(135deg, var(--accent-dark), #7a5708); color: #0f0d14; border: none; box-shadow: 0 0 12px rgba(224,165,22,.3); }
.node-main { flex: 1; min-width: 0; }
.node-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.node-title a { color: var(--text); }
.node-title a:hover { color: var(--accent); }
.node-desc { font-size: 12.5px; color: var(--text-dim); }
.node-stats { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--text-dim); min-width: 90px; }
.node-stats b { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.node-last { flex-shrink: 0; width: 220px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.node-last .last-info { min-width: 0; }
.node-last .last-title { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.node-last .last-meta { color: var(--text-dim); font-size: 11.5px; }
.node-last .last-meta a { color: var(--text-dim); }

/* ---------- Avatar (sade) ---------- */
.avatar {
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-grid; place-items: center;
    color: #fff; font-weight: 600;
    overflow: hidden;
    vertical-align: middle;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initial { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; }

/* ============================================================
   RÜTBE ÇERÇEVELERİ
   Her rütbenin kendine özgü çerçevesi + rozeti var.
   ============================================================ */
.avatar-frame {
    position: relative;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    vertical-align: middle;
}
/* Çerçeve halkası (arka pseudo eleman) */
.avatar-frame::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    z-index: 0;
    background: var(--border);
}
/* İç avatar (resim/harf) — halkanın üstünde */
.avatar-frame-inner {
    position: relative;
    z-index: 1;
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-card);
    display: grid; place-items: center;
}
.avatar-frame-inner img { width: 100%; height: 100%; object-fit: cover; }
.avatar-frame-inner .avatar-initial { width: 100%; height: 100%; color: #fff; font-weight: 700; }

/* Rozet (sağ altta küçük ikon) */
.avatar-rozet {
    position: absolute;
    right: -2px; bottom: -2px;
    z-index: 2;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg);
    border: 2px solid var(--bg-alt);
    line-height: 1;
}

/* --- Üye (sade gri halka) --- */
.fr-uye::before { background: var(--border); }

/* --- Gold Üye (altın gradyan + hafif parıltı) --- */
.fr-gold::before {
    background: linear-gradient(135deg, #ffd23f, #b8860b, #ffd23f);
    box-shadow: 0 0 10px rgba(224,165,22,.45);
}

/* --- VIP (mor-camgöbeği gradyan) --- */
.fr-vip::before {
    background: linear-gradient(135deg, #9b59ff, #4ad6e0, #9b59ff);
    box-shadow: 0 0 12px rgba(155,89,255,.5);
}

/* --- Lonca Başkanı (zümrüt + bronz kalkan) --- */
.fr-lonca::before {
    background: conic-gradient(from 0deg, #21c4a6, #1a8c76, #2fd6b4, #21c4a6);
    box-shadow: 0 0 12px rgba(33,196,166,.5);
}

/* --- Savaş Birincisi (ateş halkası, dönen) --- */
.fr-savas::before {
    background: conic-gradient(from 0deg, #ff5a36, #ffb340, #ff3860, #ff5a36);
    box-shadow: 0 0 16px rgba(255,90,54,.6);
    animation: fr-spin 6s linear infinite;
}

/* --- Kral (altın taç, güçlü parıltı, dönen) --- */
.fr-kral::before {
    inset: -4px;
    background: conic-gradient(from 0deg, #ffd23f, #fff3b0, #e0a516, #ffd23f, #b8860b, #ffd23f);
    box-shadow: 0 0 20px rgba(255,210,63,.7), 0 0 6px rgba(255,210,63,.5);
    animation: fr-spin 8s linear infinite;
}

/* --- Moderatör (yeşil halka) --- */
.fr-mod::before {
    background: linear-gradient(135deg, #3fb950, #2a8c3a, #3fb950);
    box-shadow: 0 0 10px rgba(63,185,80,.45);
}

/* --- Yönetici (kraliyet kırmızı-altın-mor, dönen + güçlü parıltı) --- */
.fr-admin::before {
    inset: -4px;
    background: conic-gradient(from 0deg, #ff3860, #ffd23f, #9b59ff, #ff3860, #e0a516, #ff3860);
    box-shadow: 0 0 22px rgba(255,56,96,.6), 0 0 8px rgba(255,210,63,.5);
    animation: fr-spin 5s linear infinite;
}

@keyframes fr-spin { to { transform: rotate(360deg); } }

/* Hareketi azalt tercih edilmişse durdur */
@media (prefers-reduced-motion: reduce) {
    .fr-savas::before, .fr-kral::before, .fr-admin::before { animation: none; }
}

/* ---------- Rütbe etiketi (isim yanı / profilde) ---------- */
.rutbe-etiket {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    border: 1px solid;
}
.re-uye   { color: #9088a3; border-color: rgba(144,136,163,.3); background: rgba(144,136,163,.1); }
.re-gold  { color: #ffd23f; border-color: rgba(224,165,22,.4);  background: rgba(224,165,22,.12); }
.re-vip   { color: #b78cff; border-color: rgba(155,89,255,.4);  background: rgba(155,89,255,.14); }
.re-lonca { color: #2fd6b4; border-color: rgba(33,196,166,.4);  background: rgba(33,196,166,.12); }
.re-savas { color: #ff7a5c; border-color: rgba(255,90,54,.4);   background: rgba(255,90,54,.12); }
.re-kral  { color: #ffd23f; border-color: rgba(255,210,63,.5);  background: rgba(255,210,63,.16); font-weight: 700; }
.re-mod   { color: #5fd46e; border-color: rgba(63,185,80,.4);   background: rgba(63,185,80,.12); }
.re-admin { color: #ff6b86; border-color: rgba(255,56,96,.45);  background: rgba(255,56,96,.14); font-weight: 700; }

/* ---------- Sidebar ---------- */
.sidebar > .widget { margin-bottom: 18px; }
.widget { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.widget-head { padding: 11px 15px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); background: linear-gradient(180deg, #1c2536, #161e2a); }
.widget-body { padding: 6px 0; }
.widget-row { display: flex; align-items: center; gap: 10px; padding: 9px 15px; font-size: 12.5px; }
.widget-row:hover { background: var(--bg-hover); }
.widget-row .wr-main { min-width: 0; flex: 1; }
.widget-row .wr-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.widget-row .wr-meta { color: var(--text-dim); font-size: 11.5px; }

/* İstatistik widget */
.stats-grid { padding: 14px 15px; }
.stats-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.stats-row dt { color: var(--text-dim); }
.stats-row dd { color: var(--text); font-weight: 600; }
.stats-row.highlight dd { color: var(--accent); }

/* Online üyeler */
.online-list { padding: 12px 15px; font-size: 12.5px; line-height: 1.9; }
.online-list a { color: var(--accent); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; }

/* ---------- Konu listesi (forum içi) ---------- */
.topic-list { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.topic-list-head { display: flex; padding: 11px 18px; background: linear-gradient(180deg, #1c2536, #161e2a); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.topic-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); transition: background .12s; }
.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--bg-hover); }
.topic-avatar { flex-shrink: 0; }
.topic-main { flex: 1; min-width: 0; }
.topic-title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.topic-title a { color: var(--text); }
.topic-title a:hover { color: var(--accent); }
.topic-meta { font-size: 12px; color: var(--text-dim); }
.topic-meta a { color: var(--text-dim); }
.topic-stats { flex-shrink: 0; text-align: center; width: 70px; font-size: 12px; color: var(--text-dim); }
.topic-stats b { display: block; color: var(--text); font-size: 14px; }
.topic-last { flex-shrink: 0; width: 150px; font-size: 11.5px; color: var(--text-dim); text-align: right; }

/* Etiket/prefix rozeti */
.prefix { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-right: 6px; vertical-align: middle; }
.prefix-red { background: rgba(217,83,79,.18); color: #f08a87; }
.prefix-green { background: rgba(63,185,80,.18); color: #6ed47c; }
.prefix-blue { background: rgba(74,158,218,.18); color: #7bbee8; }
.prefix-amber { background: rgba(224,165,22,.18); color: var(--accent-warm); }

/* Sabit/kilit ikonları */
.topic-flags { display: inline-flex; gap: 5px; margin-right: 5px; }
.topic-flags span { font-size: 12px; opacity: .7; }

/* ---------- Konu görüntüleme (mesajlar) ---------- */
.post { display: flex; gap: 0; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.post-side { flex-shrink: 0; width: 170px; background: var(--bg-card); border-right: 1px solid var(--border); padding: 18px 15px; text-align: center; }
.post-side .avatar { margin: 0 auto 10px; }
.post-author { font-weight: 600; color: var(--text); font-size: 14px; margin-bottom: 3px; }
.post-author.admin { color: var(--accent); }
.post-usertitle { font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px; }
.post-userstats { font-size: 11.5px; color: var(--text-muted); border-top: 1px solid var(--border-soft); padding-top: 10px; text-align: left; line-height: 1.8; }
.post-userstats .us-row { display: flex; justify-content: space-between; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-head { padding: 11px 18px; border-bottom: 1px solid var(--border-soft); font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; }
.post-content { padding: 18px; color: var(--text); line-height: 1.7; flex: 1; word-wrap: break-word; }
.post-content p { margin-bottom: 12px; }
.post-content p:last-child { margin-bottom: 0; }
.post-foot { padding: 10px 18px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Form / kutu ---------- */
.box { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.box-head { padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; background: linear-gradient(180deg, #1c2536, #161e2a); }
.box-body { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-control {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(224,165,22,.12); }
textarea.form-control { min-height: 160px; resize: vertical; line-height: 1.6; }
select.form-control { cursor: pointer; }

/* ---------- Flash / uyarı mesajları ---------- */
.alert { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; border: 1px solid; }
.alert-info { background: rgba(74,158,218,.12); border-color: rgba(74,158,218,.3); color: #9cc9ed; }
.alert-success { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.3); color: #8ad696; }
.alert-error { background: rgba(217,83,79,.12); border-color: rgba(217,83,79,.3); color: #f0a8a5; }

/* ---------- Boş durum ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty-icon { font-size: 42px; opacity: .4; margin-bottom: 12px; }

/* ---------- Footer ---------- */
.footer { background: #0a0e14; border-top: 1px solid var(--border); padding: 30px 0; margin-top: auto; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-info { font-size: 13px; color: var(--text-dim); }
.footer-info b { color: var(--accent); }
.footer-links { display: flex; gap: 18px; font-size: 13px; }
.footer-links a { color: var(--text-dim); }
.footer-stats { display: flex; gap: 24px; font-size: 12.5px; color: var(--text-dim); }
.footer-stats b { color: var(--text); }

/* ---------- Sayfalama ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: var(--radius-sm); background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
.pagination a:hover { background: var(--bg-hover); color: var(--text); }
.pagination .current { background: var(--accent); color: #0f141c; border-color: var(--accent); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .node-last { display: none; }
    .node-stats { min-width: 70px; }
    .topic-last { display: none; }
    .nav-links a { padding: 14px 12px; }
    .search-box { display: none; }
}
@media (max-width: 600px) {
    .topbar-right { display: none; }
    .post-side { width: 90px; padding: 12px 8px; }
    .post-userstats { display: none; }
    .node-stats { display: none; }
    .topic-stats { width: 50px; }
    .page-title { font-size: 19px; }
    .nav-links { font-size: 12px; }
    .footer .wrap { flex-direction: column; text-align: center; }
}
