/* ============================================================
   CSS Değişkenleri - Açık Tema (varsayılan)
   ============================================================ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   Karanlık Tema
   ============================================================ */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea      { background: #1e293b; color: var(--text); border-color: var(--border); }
[data-theme="dark"] th            { background: #1e293b; }
[data-theme="dark"] table         { background: var(--card); }
[data-theme="dark"] .tag          { background: #334155; color: var(--muted); }
[data-theme="dark"] nav a:hover   { background: #334155; }
[data-theme="dark"] .btn          { background: #1e293b; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn:hover    { background: #334155; }
[data-theme="dark"] .pagination button { background: #1e293b; color: var(--text); }
[data-theme="dark"] .badge-pending  { background: #451a03; color: #fde68a; }
[data-theme="dark"] .badge-approved { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-rejected { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-admin    { background: #1e3a8a; color: #bfdbfe; }
[data-theme="dark"] .badge-user     { background: #334155; color: #94a3b8; }
[data-theme="dark"] .alert-error    { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-success  { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .alert-info     { background: #1e3a8a; color: #bfdbfe; border-color: #1d4ed8; }
[data-theme="dark"] .alert-warning  { background: #451a03; color: #fde68a; border-color: #78350f; }
[data-theme="dark"] .skeleton       { background: linear-gradient(90deg, #334155 25%, #1e293b 50%, #334155 75%); }
[data-theme="dark"] .skeleton-card  { background: #1e293b; }
[data-theme="dark"] .markdown-body blockquote { border-color: var(--border); color: var(--muted); }
[data-theme="dark"] .markdown-body code       { background: #334155; }
[data-theme="dark"] .markdown-body pre        { background: #0f172a; }
[data-theme="dark"] .comment-item  { border-color: var(--border); }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
}

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

/* ============================================================
   Header
   ============================================================ */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--primary); }
nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
nav a, nav button {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
}
nav a:hover { background: #f1f5f9; text-decoration: none; }
nav .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
nav .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* Dark mode toggle butonu */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  line-height: 1;
}
.theme-toggle:hover { background: var(--bg); }

/* ============================================================
   Main
   ============================================================ */
main {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.page-header p  { color: var(--muted); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* ============================================================
   Skeleton loading
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.skeleton-title { height: 20px; width: 75%; margin-bottom: 12px; }
.skeleton-meta  { height: 13px; width: 55%; margin-bottom: 10px; }
.skeleton-line  { height: 13px; margin-bottom: 6px; }
.skeleton-line:last-child { width: 70%; }

/* ============================================================
   Toast bildirimleri
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  max-width: 360px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  animation: toastIn 0.25s ease;
  pointer-events: auto;
  cursor: pointer;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--primary); color: #fff; }
@keyframes toastIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 14px; }
label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea { resize: vertical; min-height: 120px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover { background: #f1f5f9; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { background: #a16207; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Like butonu */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.like-btn:hover  { border-color: #f43f5e; color: #f43f5e; }
.like-btn.liked  { border-color: #f43f5e; color: #f43f5e; background: #fff1f2; }

/* ============================================================
   Search bar
   ============================================================ */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input  { flex: 1; min-width: 200px; }
.search-bar select { max-width: 240px; min-width: 160px; }

/* ============================================================
   Article list / cards
   ============================================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.article-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary); }
.article-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.article-summary { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; flex: 1; }
.tag { display: inline-block; padding: 2px 8px; background: #f1f5f9; border-radius: 12px; font-size: 0.78rem; color: var(--muted); }

/* ============================================================
   Markdown içerik (article.html)
   ============================================================ */
.markdown-body {
  font-size: 1rem;
  line-height: 1.8;
  margin-top: 20px;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.4em 0 0.5em;
  font-weight: 700;
  line-height: 1.3;
}
.markdown-body h1 { font-size: 1.6rem; }
.markdown-body h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body p  { margin-bottom: 1em; }
.markdown-body ul,
.markdown-body ol { margin: 0 0 1em 1.5em; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  margin: 1em 0;
  color: var(--muted);
  background: var(--bg);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.markdown-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}
.markdown-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1em;
}
.markdown-body pre code { background: transparent; padding: 0; color: inherit; }
.markdown-body a { color: var(--primary); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5em 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin-bottom: 1em; }
.markdown-body table th,
.markdown-body table td { border: 1px solid var(--border); padding: 8px 12px; }
.markdown-body table th { background: var(--bg); font-weight: 600; }
.markdown-body img { max-width: 100%; border-radius: var(--radius); }

/* Markdown önizleme alanı */
.preview-pane {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 200px;
  background: var(--bg);
}

/* Editor sekmeleri */
.editor-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.editor-tab {
  padding: 8px 16px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.editor-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============================================================
   Yorumlar
   ============================================================ */
.comments-section { margin-top: 32px; }
.comments-section h2 { font-size: 1.2rem; margin-bottom: 16px; }
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.comment-content { font-size: 0.95rem; white-space: pre-wrap; word-break: break-word; }
.comment-form { margin-top: 20px; }
.comment-form textarea { min-height: 80px; }

/* ============================================================
   Badges
   ============================================================ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 500; }
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #15803d; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-admin    { background: #dbeafe; color: #1e40af; }
.badge-user     { background: #f1f5f9; color: #475569; }

/* ============================================================
   Tables
   ============================================================ */
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: #f8fafc; font-weight: 600; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table-wrapper { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; margin-bottom: 16px; }

/* ============================================================
   Stats grid
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Tabs
   ============================================================ */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============================================================
   Article detail
   ============================================================ */
.article-detail h1 { font-size: 1.8rem; margin-bottom: 8px; }
.article-detail .article-meta { font-size: 0.9rem; margin-bottom: 16px; }
.article-detail .article-summary {
  font-style: italic;
  border-left: 3px solid var(--primary);
  padding-left: 12px;
  margin: 16px 0;
  color: var(--muted);
}
.article-actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Profil */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.profile-info h1 { font-size: 1.4rem; }
.profile-info p  { color: var(--muted); font-size: 0.9rem; }

/* ============================================================
   Alerts
   ============================================================ */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.92rem; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--text); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Footer
   ============================================================ */
footer { text-align: center; padding: 16px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); background: var(--card); }

/* ============================================================
   Loading & empty
   ============================================================ */
.loading, .empty { text-align: center; padding: 40px; color: var(--muted); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  nav { width: 100%; justify-content: flex-start; }
  .articles-grid { grid-template-columns: 1fr; }
  .search-bar select { max-width: none; }
  #toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: 100%; }
}

/* ============================================================
   Trendyol Tarzı Kategori Şeridi
   ============================================================ */
.category-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 4px;
}
.category-strip::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  max-width: 80px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px 0;
  font-family: inherit;
  flex-shrink: 0;
  text-decoration: none;
}

.cat-pill-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card);
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  transition: border-color 0.2s, background 0.2s, transform 0.18s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cat-pill:hover .cat-pill-icon {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(37,99,235,0.13);
}

.cat-pill.active .cat-pill-icon {
  border-color: var(--primary);
  background: #dbeafe;
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px #2563eb22, 0 6px 18px rgba(37,99,235,0.15);
}

[data-theme="dark"] .cat-pill-icon {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
[data-theme="dark"] .cat-pill:hover .cat-pill-icon,
[data-theme="dark"] .cat-pill.active .cat-pill-icon {
  background: #1e3a8a44;
  border-color: #3b82f6;
}

.cat-pill-label {
  font-size: 0.70rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.cat-pill.active .cat-pill-label {
  color: var(--primary);
  font-weight: 700;
}
.cat-pill:hover .cat-pill-label {
  color: var(--primary);
}


/* ============================================================
   Zengin Editör Araç Çubuğu
   ============================================================ */
.rich-toolbar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  align-items: center;
}
.rich-toolbar textarea + * { border-radius: 0 0 var(--radius) var(--radius); }
.tb-btn {
  min-width: 32px;
  height: 30px;
  padding: 0 7px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-weight: 600;
}
.tb-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; flex-shrink: 0; }
.tb-select {
  height: 30px;
  padding: 0 6px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.tb-select:focus { outline: none; border-color: var(--primary); }
.rich-toolbar + textarea,
.rich-toolbar + div > textarea {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}
.editor-wrap textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Yorum onay badge */
.badge-pending-comment { background: #fef3c7; color: #92400e; padding: 2px 7px; border-radius: 8px; font-size: 0.75rem; }