/* ============================================================
   GOOGLE FONTS — Playfair Display, Amiri, IBM Plex Mono
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Amiri:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ============================================================
   TEMA DEĞİŞKENLERİ  (tek tema: parşömen)
   ============================================================ */
:root {
  --bg:          #f5f0e8;
  --panel:       #fdf8ef;
  --panel-2:     #f8f3e8;
  --text:        #2a1f0e;
  --muted:       #9a8460;
  --muted-2:     #7a6440;
  --accent:      #b8922a;
  --accent-dark: #a07820;
  --dark:        #2a1f0e;
  --dark-2:      #3d2f18;
  --error:       #8a3020;
  --ok:          #4a6a30;
  --border:      #ddd0b0;
  --border-2:    #cdc0a0;
  --topbar-bg:   #2a1f0e;
  --shadow:      0 12px 40px -16px rgba(42,31,14,.22);
  --shadow-sm:   0 2px 8px rgba(42,31,14,.12);
}

/* ============================================================
   TEMEL STILLER
   ============================================================ */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Playfair Display', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

button  { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: 'Playfair Display', Georgia, serif; }
::selection { background: #e8d8a0; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb {
  background: #d4c9a8;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Animasyonlar */
@keyframes barshimmer {
  0%   { background-position: 0 0; }
  100% { background-position: 28px 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--topbar-bg);
  color: #f5f0e8;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-right: 48px;
  text-decoration: none;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 1px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Amiri', serif;
  color: var(--dark);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  color: #f5f0e8;
}

nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}
nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  height: 56px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  color: #c9b98a;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  letter-spacing: .01em;
  transition: color .12s, border-color .12s;
}
nav a:hover         { color: #f5f0e8; }
nav a.active        { color: #f5c060; border-bottom-color: var(--accent); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.user {
  font-size: 12px;
  color: #c9b98a;
  font-style: italic;
}
.logout-btn {
  font-size: 12px;
  color: #c9b98a;
  padding: 6px 12px;
  border: 1px solid #4a3520;
  border-radius: 2px;
  background: none;
  width: auto;
  transition: color .12s, border-color .12s;
}
.logout-btn:hover { color: #f5f0e8; border-color: var(--accent); }

form.inline { display: inline; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 48px 60px;
}

/* ============================================================
   SAYFA BAŞLIKLARI
   ============================================================ */
h1 {
  font-size: 32px;
  margin: 0 0 6px;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--text);
}
h2 {
  font-size: 18px;
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--text);
}
p { margin: 0 0 1rem; }
.subtitle {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}

/* Altın çizgi ayırıcı */
.divider {
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 40px, var(--border) 40px);
  margin-bottom: 32px;
}

/* ============================================================
   KART
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card.auth {
  max-width: 400px;
  margin: 0 auto;
  padding: 42px 40px;
}

/* Auth sayfası ortalama wrapper */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, #fdf8ef 0%, #ede4d2 100%);
  padding: 40px 16px;
}

/* ============================================================
   FORM ELEMANLARı
   ============================================================ */
label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #4a3520;
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-size: 14px;
  margin-bottom: 16px;
  background: var(--panel);
  color: var(--text);
  transition: border-color .15s, outline .15s;
}
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
  background: #fff;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
select:focus { outline: 2px solid var(--accent); }

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-2);
  border-radius: 2px;
  font-size: 13px;
  background: var(--panel);
  color: var(--text);
  resize: vertical;
}
textarea:focus { border-color: var(--accent); outline: none; }

/* ============================================================
   BUTONLAR
   ============================================================ */
button {
  width: 100%;
  padding: 13px;
  background: var(--dark);
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .12s;
}
button:hover { background: var(--dark-2); }

button.btn-accent {
  background: var(--accent);
  color: var(--panel);
}
button.btn-accent:hover { background: var(--accent-dark); }

button.btn-ghost {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
}
button.btn-ghost:hover { background: #f0e8d4; }

button.btn-danger {
  background: var(--panel);
  border: 1px solid #ddc0b0;
  color: var(--error);
  font-weight: 400;
}
button.btn-danger:hover { background: #fbece8; }

button.link {
  width: auto;
  background: none;
  color: var(--muted);
  padding: 0;
  border: none;
  font-size: 13px;
  font-weight: 400;
}
button.link:hover { color: var(--accent); background: none; }

/* ============================================================
   BAĞLANTILAM
   ============================================================ */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: 13px; }

/* ============================================================
   MESAJLAR
   ============================================================ */
.error {
  color: var(--error);
  background: rgba(138,48,32,.08);
  padding: .6rem .8rem;
  border-radius: 2px;
  border-left: 3px solid var(--error);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.info {
  color: var(--ok);
  background: rgba(74,106,48,.08);
  padding: .6rem .8rem;
  border-radius: 2px;
  border-left: 3px solid var(--ok);
  font-size: 13.5px;
  margin-bottom: 16px;
}

/* ============================================================
   ROZET (BADGE)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 1px;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.badge-pending  { background: #f0ead8; color: #7a6440; border: 1px solid rgba(122,100,64,.2); }
.badge-pending::before  { background: #9a8460; }
.badge-running  { background: #f0e8f0; color: #5a3870; border: 1px solid rgba(90,56,112,.2); animation: pulse 1.4s ease-in-out infinite; }
.badge-running::before  { background: #7a6080; }
.badge-done     { background: #f0ead0; color: #6a5020; border: 1px solid rgba(106,80,32,.2); }
.badge-done::before     { background: #7a6040; }
.badge-error    { background: #f8e8e0; color: #8a3020; border: 1px solid rgba(138,48,32,.2); }
.badge-error::before    { background: #8a3020; }
.badge-paused   { background: #f8f0d8; color: #7a5810; border: 1px solid rgba(122,88,16,.2); }
.badge-paused::before   { background: #a07820; }

/* ============================================================
   İLERLEME ÇUBUĞU
   ============================================================ */
.progress-wrap {
  height: 4px;
  background: #ede4d0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: .35rem;
}
.progress-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .4s;
}
.progress-bar.running {
  background-image: linear-gradient(
    110deg,
    rgba(255,255,255,.35) 25%, transparent 25%,
    transparent 50%, rgba(255,255,255,.35) 50%,
    rgba(255,255,255,.35) 75%, transparent 75%
  );
  background-size: 28px 28px;
  animation: barshimmer .8s linear infinite;
}

/* ============================================================
   ESER KARTLARI (LIBRARY)
   ============================================================ */
.work-list {
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.work-card {
  background: var(--panel);
  padding: 18px 22px;
  cursor: pointer;
  transition: background .13s;
  border-bottom: 1px solid #ede4d0;
}
.work-card:last-child { border-bottom: none; }
.work-card:hover { background: var(--panel-2); }

.work-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.work-title-ar {
  font-family: 'Amiri', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.work-title-tr {
  font-weight: 600;
  font-size: 14px;
  color: #4a3520;
}
.work-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.work-meta .dot-sep { color: var(--border-2); }
.work-meta .model-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
}
.work-progress { margin-top: 12px; }

/* ============================================================
   YÜKLEME ALANI
   ============================================================ */
.upload-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 26px;
  margin-bottom: 36px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 22px;
}
.drop-zone {
  border: 1.5px dashed var(--border-2);
  border-radius: 2px;
  background: var(--panel-2);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop-zone:hover {
  border-color: var(--accent);
  background: #f2eada;
}
.drop-icon {
  font-family: 'Amiri', serif;
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 8px;
}
.drop-label { font-size: 14px; font-weight: 700; color: var(--accent); }
.drop-hint  { font-size: 12px; color: var(--muted); margin-top: 5px; font-style: italic; }

/* ============================================================
   İNDİRME LİNKLERİ
   ============================================================ */
.download-links { display: flex; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.btn-dl {
  font-size: .85rem;
  padding: .35rem .75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--accent);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-dl:hover { background: var(--accent); color: #fff; }
.btn-dl-edit {
  background: var(--dark);
  color: #f5f0e8;
  border-color: var(--dark);
  font-weight: 700;
}
.btn-dl-edit:hover { background: var(--dark-2); color: #f5f0e8; }

/* ============================================================
   ETİKETLER
   ============================================================ */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 1px;
  background: #f0e8d4;
  border: 1px solid #d4c090;
  color: #7a5018;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tag:hover { background: #e8d8b8; }
.tag-add   { background: var(--panel); border-color: var(--border-2); color: var(--muted); border-style: dashed; }
.tag-add:hover { border-color: var(--accent); color: var(--accent); background: var(--panel); }

/* ============================================================
   NOT BLOĞU
   ============================================================ */
.note-block {
  border-left: 3px solid var(--accent);
  padding: .5rem .75rem;
  margin-bottom: .75rem;
  background: var(--panel-2);
  border-radius: 0 2px 2px 0;
}
.note-body { margin: 0 0 .35rem; white-space: pre-wrap; font-style: italic; }

/* ============================================================
   ARAPÇA İÇERİK
   ============================================================ */
.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Amiri', serif;
  font-size: 22px;
  line-height: 2.5;
  color: var(--text);
}

/* ============================================================
   ADMİN
   ============================================================ */
.admin-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 18px 20px;
  min-width: 120px;
  box-shadow: var(--shadow-sm);
}
.stat-num   { font-size: 30px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-inactive td { opacity: .55; }
.admin-table a { color: var(--accent); }

/* ============================================================
   BENCHMARK
   ============================================================ */
.model-fieldset {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.model-fieldset legend { color: var(--muted); font-size: .85rem; padding: 0 .4rem; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  color: var(--text);
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--panel);
}
.checkbox-label input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; }

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.benchmark-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.benchmark-header {
  background: var(--panel-2);
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.benchmark-header code { font-size: .8rem; color: var(--muted); word-break: break-all; font-family: 'IBM Plex Mono', monospace; }
.benchmark-text { padding: 1rem; white-space: pre-wrap; line-height: 2; font-size: 1.05rem; }

/* ============================================================
   AYARLAR
   ============================================================ */
.settings-container { max-width: 680px; }

/* ============================================================
   SAYFA DETAYI (work_detail)
   ============================================================ */
.page-block { padding: .5rem 0; }
.page-label { font-size: .8rem; margin-bottom: .25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.page-text  { white-space: pre-wrap; line-height: 2.2; font-family: 'Amiri', serif; font-size: 1.1rem; }
.page-sep   { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }

/* Stats grid (detail sayfası) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-item {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.stat-item .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.stat-item .value { font-size: 17px; font-weight: 700; }

/* Cilt progress */
.volume-row { margin-bottom: 14px; }
.volume-row:last-child { margin-bottom: 0; }
.volume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 5px;
}
.volume-pages { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 11px; }

/* İşlemler grid */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-radius: 2px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  width: 100%;
  margin-bottom: 10px;
}
.action-btn:last-child { margin-bottom: 0; }
