/* ═══════════════════════════════════════════════════════════════
   Hukuk Portal — Forum Tasarım Sistemi
   hukukportal.net (Astra/Elementor) marka diline uyumlu
   Renkler: #0067FF mavi · #0070b6 marka · #0F172A ink · #f7b500 vurgu
   Font: Nunito Sans
   ═══════════════════════════════════════════════════════════════ */

/* hukukportal.net ile birebir: gövde = Lora (serif), başlıklar = Nunito Sans */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Nunito+Sans:opsz,wght@6..12,600;6..12,700;6..12,800&display=swap');

:root {
  color-scheme: light;

  /* Tipografi — site ile birebir */
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;
  --font-head: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Tek marka mavisi — header ile aynı (#0070b6), tüm buton/linkler uyumlu */
  --primary: #0070b6;
  --primary-dark: #005d97;
  --primary-darker: #004a78;
  --primary-soft: #e0f0fb;
  --primary-softer: #f0f8fd;
  --brand: #0070b6;

  --ink: #0f172a;
  --ink-secondary: #364151;
  --muted: #64748b;
  --soft: #94a3b8;

  --panel: #ffffff;
  --surface: #f6f8fc;
  --surface-strong: #eef2f8;
  --line: #d1dae5;
  --line-soft: #e6ebf2;

  --gold: #f7b500;
  --gold-soft: #fff6dc;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 28px -8px rgba(15, 23, 42, 0.14);
  --shadow-primary: 0 6px 18px rgba(0, 112, 182, 0.28);

  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --container: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Başlıklar ve başlık-niteliğindeki UI öğeleri — Nunito Sans (site ile birebir) */
h1, h2, h3, h4, h5, h6,
.brand, .brand span, .page-head h1, .topic-title, .cat-body h3,
.widget-head, .modal-head h2, .post-aside .name, .stat-box strong,
.profile-hero h1, .empty h3 {
  font-family: var(--font-head);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ── Üst Bar ──────────────────────────────────────────────────── */
/* Header — site ile birebir: marka mavisi (#0070b6) zemin, beyaz logo */
.site-header {
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 50px; width: auto; flex: none; display: block; }
.brand-tag {
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.35); line-height: 1.2;
}
@media (max-width: 560px) { .brand-tag { display: none; } }

/* Mavi header üzerinde okunur öğeler */
.header-search input { border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.16); color: #fff; }
.header-search input::placeholder { color: rgba(255, 255, 255, 0.8); }
.header-search input:focus { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
.header-search svg { color: rgba(255, 255, 255, 0.85); }
.site-header .nav-link { color: rgba(255, 255, 255, 0.92); }
.site-header .nav-link:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.site-header .btn-ghost { border-color: rgba(255, 255, 255, 0.55); color: #fff; background: transparent; }
.site-header .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.site-header .btn-primary { background: #fff; color: var(--brand); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14); }
.site-header .btn-primary:hover { background: #eef4f9; color: var(--primary-darker); }

.header-search { flex: 1; max-width: 360px; position: relative; }
.header-search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 0 16px 0 40px; background: var(--surface); font-size: 14px; color: var(--ink); transition: 0.15s;
}
.header-search input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.header-search svg { position: absolute; left: 14px; top: 11px; width: 18px; height: 18px; color: var(--soft); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.nav-link { color: var(--ink-secondary); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: var(--radius-sm); transition: 0.15s; }
.nav-link:hover { background: var(--surface-strong); color: var(--ink); }

/* ── Butonlar ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; transition: 0.15s; white-space: nowrap; background: var(--surface-strong); color: var(--ink);
}
.btn:hover { background: var(--line-soft); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-secondary); }
.btn-ghost:hover { background: var(--surface-strong); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fde0e0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

/* ── Rozet ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 800; letter-spacing: 0.01em;
  line-height: 1.6; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-lg { font-size: 13px; padding: 4px 13px; }

/* ── Sayfa Düzeni ─────────────────────────────────────────────── */
main { padding: 26px 0 60px; min-height: calc(100vh - 66px); }
.layout { display: grid; grid-template-columns: 1fr 304px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { order: -1; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span.sep { color: var(--soft); }

/* ── Kart / Panel ─────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 14px; }

/* Kategori listesi */
.cat-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); transition: 0.12s; }
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: var(--primary-softer); }
.cat-icon { width: 46px; height: 46px; flex: none; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.cat-icon svg { width: 24px; height: 24px; }
.cat-body { flex: 1; min-width: 0; }
.cat-body h3 { margin: 0 0 2px; font-size: 16px; }
.cat-body h3 a { color: var(--ink); }
.cat-body h3 a:hover { color: var(--primary); }
.cat-body p { margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-stats { text-align: right; font-size: 12px; color: var(--muted); flex: none; min-width: 92px; }
.cat-stats strong { display: block; font-size: 16px; color: var(--ink); font-weight: 800; }
@media (max-width: 560px) { .cat-stats { display: none; } }

/* Konu listesi */
.topic-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); transition: 0.12s; }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--primary-softer); }
.topic-main { flex: 1; min-width: 0; }
.topic-title { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.topic-title a { color: var(--ink); }
.topic-title a:hover { color: var(--primary); }
.topic-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.topic-meta a { color: var(--ink-secondary); font-weight: 600; }
.topic-stats { display: flex; gap: 18px; flex: none; text-align: center; }
.topic-stats div { font-size: 12px; color: var(--muted); }
.topic-stats strong { display: block; font-size: 15px; color: var(--ink); }
@media (max-width: 620px) { .topic-stats { display: none; } }

.pill { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.03em; }
.pill-pin { background: var(--gold-soft); color: #92660a; }
.pill-lock { background: var(--surface-strong); color: var(--muted); }
.pill-cat { background: var(--primary-soft); color: var(--primary-darker); text-transform: none; }

/* ── Konu detayı / gönderiler ─────────────────────────────────── */
.post { display: grid; grid-template-columns: 188px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.post-aside { background: var(--surface); border-right: 1px solid var(--line-soft); padding: 18px 16px; text-align: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; background: var(--primary); }
.post-aside .name { font-weight: 800; font-size: 14px; color: var(--ink); word-break: break-word; }
.post-aside .name a { color: var(--ink); }
.post-aside .badge { margin-top: 8px; }
.personal-title { margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--brand); line-height: 1.3; }
.post-aside .stat-line { margin-top: 12px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 10px; }
.post-aside .stat-line b { color: var(--ink-secondary); }
.post-body { padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.post-content { font-size: 15px; color: var(--ink-secondary); line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; flex: 1; }
.post-content a { word-break: break-all; }
.post-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--muted); font-size: 13px; font-weight: 700; transition: 0.13s; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-darker); }
.icon-btn.muted { border: 0; }
@media (max-width: 640px) {
  .post { grid-template-columns: 1fr; }
  .post-aside { display: flex; align-items: center; gap: 12px; text-align: left; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 12px 16px; }
  .post-aside .avatar { margin: 0; width: 42px; height: 42px; font-size: 17px; }
  .post-aside .badge { margin-top: 0; }
  .post-aside .stat-line { display: none; }
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
.widget { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.widget-head { padding: 13px 16px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.widget-head svg { width: 16px; height: 16px; color: var(--primary); }
.widget-body { padding: 8px 0; }
.rank-item, .member-mini { display: flex; align-items: center; gap: 11px; padding: 9px 16px; }
.member-mini:hover { background: var(--surface); }
.rank-num { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-strong); color: var(--muted); }
.rank-num.top1 { background: var(--gold); color: #fff; }
.rank-num.top2 { background: #c0c8d4; color: #fff; }
.rank-num.top3 { background: #cd8e54; color: #fff; }
.member-mini .mm-body { flex: 1; min-width: 0; }
.member-mini .mm-name { font-weight: 700; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-mini .mm-name a { color: var(--ink); }
.member-mini .mm-rep { font-size: 11.5px; color: var(--muted); }
.ladder { padding: 6px 16px 12px; }
.ladder-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; }
.ladder-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ladder-row .lr-name { font-weight: 700; color: var(--ink); }
.ladder-row .lr-rep { margin-left: auto; font-size: 11.5px; color: var(--soft); }

/* ── Progress ─────────────────────────────────────────────────── */
.progress { height: 8px; background: var(--surface-strong); border-radius: var(--radius-full); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--brand)); border-radius: inherit; }

/* ── Formlar ──────────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-secondary); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px;
  font-size: 14.5px; color: var(--ink); background: #fff; transition: 0.15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

/* ── Bildirim / boş durum ─────────────────────────────────────── */
.notice { padding: 12px 15px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-success { background: var(--success-soft); color: var(--success); }
.notice-info { background: var(--primary-softer); color: var(--primary-darker); }
.empty { text-align: center; padding: 54px 24px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; color: var(--line); margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; color: var(--ink-secondary); font-size: 17px; }
.empty p { margin: 0; font-size: 14px; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--panel); border-radius: var(--radius-xl); width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto; animation: pop 0.18s ease;
}
.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }
.modal-head { padding: 22px 24px 6px; }
.modal-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 18px 24px 24px; }
.modal-tabs { display: flex; gap: 4px; padding: 16px 24px 0; }
.modal-tabs button { flex: 1; height: 38px; border: 0; background: transparent; font-weight: 800; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.modal-tabs button.active { color: var(--primary); border-color: var(--primary); }
.modal-close { position: absolute; }

/* ── Profil ───────────────────────────────────────────────────── */
.profile-hero { display: flex; align-items: center; gap: 20px; padding: 26px; }
.profile-hero .avatar { width: 84px; height: 84px; font-size: 34px; margin: 0; }
.profile-hero h1 { margin: 0 0 6px; font-size: 24px; }
.profile-meta { display: flex; gap: 22px; padding: 0 26px 22px; flex-wrap: wrap; }
.profile-meta .pm { font-size: 13px; color: var(--muted); }
.profile-meta .pm strong { display: block; font-size: 19px; color: var(--ink); }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.pagination button { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); font-weight: 700; color: var(--ink-secondary); }
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer a { font-weight: 700; }

/* ── Yardımcılar ──────────────────────────────────────────────── */
.muted { color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.hide { display: none !important; }
.tag { font-size: 12px; font-weight: 700; color: var(--brand); }

/* ── Yeni tasarım öğeleri (etiket, çözüldü, bildirim) ───────────── */
.pill-solved { background: var(--success-soft); color: var(--success); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--surface-strong); padding: 2px 9px; border-radius: var(--radius-full); }
.tag-chip:hover { background: var(--primary-soft); color: var(--primary-darker); }

.post-accepted { border-color: var(--success); box-shadow: 0 0 0 1px var(--success), var(--shadow-sm); }
.post-accepted .post-aside { background: var(--success-soft); }
.icon-btn.accepted { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.icon-btn svg { width: 15px; height: 15px; }

/* Bildirim zili */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.92); }
.bell:hover { background: rgba(255,255,255,0.16); color: #fff; }
.bell svg { width: 20px; height: 20px; }
.bell-dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--radius-full); background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; }

/* Bildirim listesi */
.notif { display: flex; gap: 13px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface); }
.notif.unread { background: var(--primary-softer); }
.notif-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.notif-ic svg { width: 18px; height: 18px; }
.notif-body { flex: 1; min-width: 0; font-size: 14px; }
