/* Nova - hikaye platformu - acik tema, mobil-uygulama hissiyatli tasarim */

:root {
  --bg: #f6f6fa;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f0f7;
  --border: #e7e6ef;
  --text: #17151f;
  --text-dim: #6f6d80;
  --accent: #6c4ab6;
  --accent-soft: #efe9fb;
  --accent-2: #e3a93c;
  --danger: #e1435b;
  --success: #1f9d63;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(23, 21, 31, 0.08);
  --shadow-sm: 0 4px 14px rgba(23, 21, 31, 0.06);

  --paper-bg: #fbf6ec;
  --paper-text: #2b2418;
  --paper-border: #e7dcc4;

  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', 'Noto Serif', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

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

img { max-width: 100%; display: block; }

.muted { color: var(--text-dim); }

/* ---------- Butonlar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-accent {
  background: linear-gradient(135deg, #8367d9, var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 74, 182, 0.28);
}
.btn-accent:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(225, 67, 91, 0.08); }

.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 999px; }
.full-width { width: 100%; }

/* ---------- Header (ikon tabanli, mobil uygulama gibi) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 6px;
  height: 62px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}
.logo .star { color: var(--accent); }

.icon-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: center;
}

.icon-nav-item {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-dim);
}
.icon-nav-item:hover { background: var(--surface-2); color: var(--text); }
.icon-nav-item.active { background: var(--accent-soft); color: var(--accent); }

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.nav-avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.nav-avatar-btn:hover { border-color: var(--accent); }
.nav-avatar-btn img,
.nav-avatar-btn span {
  width: 100% !important;
  height: 100% !important;
}

/* ---------- Kayan menu (profil) ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 22, 0.38);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 300px;
  max-width: 86vw;
  background: var(--surface);
  box-shadow: -14px 0 34px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 18px;
  overflow-y: auto;
}
.menu-overlay.open .menu-panel { transform: translateX(0); }

.menu-close {
  align-self: flex-end;
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.menu-user-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.menu-user-avatar img, .menu-user-avatar span { width: 100% !important; height: 100% !important; }
.menu-user-name { font-weight: 800; font-size: 1rem; }
.menu-user-sub { color: var(--text-dim); font-size: 0.8rem; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--font-ui);
  width: 100%;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .chev { color: var(--text-dim); }

/* ---------- Kayan raflar (ana sayfa carousel) ---------- */

.carousel-section { padding: 20px 0 2px; }

.carousel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  margin-bottom: 12px;
}
.carousel-head h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}
.carousel-head a { font-size: 0.82rem; color: var(--accent); font-weight: 700; }

.carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 16px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track .book-card {
  flex: 0 0 128px;
  scroll-snap-align: start;
}
.carousel-track .book-card .book-cover { height: 176px; }
.carousel-track .book-card .book-info { padding: 10px 2px 0; }
.carousel-track .book-card .book-summary,
.carousel-track .book-card .book-author { display: none; }
.carousel-track .book-card .book-title { font-size: 0.85rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.carousel-track .book-card .book-meta-row { padding-top: 4px; font-size: 0.72rem; }

/* ---------- Arama kutusu ---------- */

.search-row {
  position: relative;
  width: 100%;
}

.search-row .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  font-size: 0.95rem;
  pointer-events: none;
}

.search-row input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 13px 18px 13px 42px;
  font-size: 0.95rem;
  font-family: var(--font-ui);
}
.search-row input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Kategori kesif izgarasi (arama sayfasi) ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.category-card {
  position: relative;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}
.category-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35) 100%);
}
.category-card .cat-emoji {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.6rem;
  opacity: 0.85;
  z-index: 1;
}
.category-card span.cat-label { position: relative; z-index: 1; }

/* ---------- Chip filtre ---------- */

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Kitap izgarasi / kartlar ---------- */

.section { padding: 28px 0; }

.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 18px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: novaFadeUp 0.3s ease both;
}
.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-soft);
}

@keyframes novaFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.lib-toggle-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  transition: transform 0.12s ease, background 0.12s ease;
}
.lib-toggle-btn:hover { transform: scale(1.08); }
.lib-toggle-btn.active { background: var(--accent); color: #fff; }

.book-cover,
.book-hero-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: #fff;
}

.book-cover {
  height: 210px;
  padding: 18px 14px;
}

.book-cover::after,
.book-hero-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.book-cover .tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
  z-index: 2;
}

.cover-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
  position: relative;
  z-index: 1;
}

.cover-title {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.28;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-cover .cover-title { font-size: 1rem; }

.cover-rule {
  width: 30px;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  margin: 9px 0 6px;
  position: relative;
  z-index: 1;
}

.cover-author {
  font-size: 0.68rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.book-info {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.book-author {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.book-summary {
  color: var(--text-dim);
  font-size: 0.83rem;
  line-height: 1.45;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta-row {
  margin-top: auto;
  padding-top: 8px;
  color: var(--text-dim);
  font-size: 0.76rem;
  display: flex;
  justify-content: space-between;
}

.empty-state {
  color: var(--text-dim);
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 0.83rem;
  text-align: center;
}

/* ---------- Formlar ---------- */

.field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.field input[type="text"],
.field input[type="password"],
.field textarea,
.field select {
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  width: 100%;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
}

.field textarea { min-height: 90px; }

.hint { font-size: 0.8rem; color: var(--text-dim); }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: block; }
.alert-error {
  background: rgba(225, 67, 91, 0.08);
  border: 1px solid rgba(225, 67, 91, 0.3);
  color: #c22c47;
}
.alert-success {
  background: rgba(31, 157, 99, 0.08);
  border: 1px solid rgba(31, 157, 99, 0.3);
  color: #17794d;
}

/* ---------- Giris sayfasi ---------- */

.auth-wrap {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  box-sizing: border-box;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 30px;
  width: 100%;
  max-width: 380px;
  min-width: 0;
  box-shadow: var(--shadow);
}

@media (max-width: 420px) {
  .auth-card { padding: 26px 18px; }
}

.auth-card h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin: 0 0 6px;
  text-align: center;
}

.auth-card .sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-demo-hint {
  margin-top: 18px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.auth-demo-hint code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* ---------- Okuma sayfasi ---------- */

.book-hero {
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--border);
}

.book-hero-inner {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.book-hero-cover {
  width: 140px;
  height: 196px;
  border-radius: var(--radius);
  flex-shrink: 0;
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
}
.book-hero-cover .cover-icon { font-size: 1.8rem; }
.book-hero-cover .cover-title { font-size: 1.25rem; -webkit-line-clamp: 4; }
.book-hero-cover .cover-author { font-size: 0.74rem; }

.book-hero-info { flex: 1; min-width: 220px; }

.book-hero-info .genre-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.book-hero-info h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin: 0 0 6px;
}

.book-hero-info .author {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.book-hero-info .summary {
  color: var(--text-dim);
  max-width: 640px;
  line-height: 1.6;
}

.book-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ---------- Kitap istatistik satiri (begeni / yorum / okunma / paylas) ---------- */

.stats-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.stat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
}
.stat-btn:hover { color: var(--text); }
.stat-btn.liked { color: var(--danger); }
.stat-btn .stat-icon { font-size: 1.05rem; }

.cta-big {
  display: block;
  width: 100%;
  text-align: center;
  padding: 16px 20px;
  font-size: 1.05rem;
  border-radius: 999px;
  margin-top: 20px;
}

/* ---------- Okuma modu (sade) ---------- */

.reader-topbar,
.reader-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.reader-topbar {
  top: 0;
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%);
}
.reader-bottombar {
  bottom: 0;
  border-top: 1px solid var(--border);
  transform: translateY(100%);
  gap: 10px;
}

body.chrome-visible .reader-topbar,
body.chrome-visible .reader-bottombar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reader-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reader-icon-btn:hover { background: var(--surface-2); }
.reader-icon-btn.disabled { opacity: 0.35; pointer-events: none; }

.reader-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reader-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.chapter-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
}
.chapter-drawer-item {
  display: block;
  padding: 12px 10px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: var(--font-ui);
}
.chapter-drawer-item:hover { background: var(--surface-2); color: var(--text); }
.chapter-drawer-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Yorumlar ---------- */

.comments-section {
  max-width: 760px;
  margin: 0 auto 60px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.comment-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.comment-avatar { flex-shrink: 0; }

.comment-body { flex: 1; min-width: 0; }

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.comment-name { font-weight: 700; font-size: 0.92rem; }
.comment-date { font-size: 0.74rem; color: var(--text-dim); }

.comment-message {
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  font-size: 0.92rem;
}

.read-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 26px;
  padding: 28px 0 60px;
  align-items: start;
}

.chapter-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 78px;
}

.chapter-sidebar h3 {
  margin: 4px 6px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.chapter-list-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.chapter-list-item:hover { background: var(--surface-2); color: var(--text); }
.chapter-list-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft);
  font-weight: 700;
}

.reading-pane {
  background: var(--paper-bg);
  color: var(--paper-text);
  border: 1px solid var(--paper-border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.reading-pane .chapter-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--paper-border);
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.reading-pane .chapter-heading h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0;
}

.font-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.font-controls button {
  background: transparent;
  border: 1px solid var(--paper-border);
  color: var(--paper-text);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: 700;
}

.chapter-content {
  font-family: var(--font-serif);
  line-height: 1.85;
}
.chapter-content p { margin: 0 0 1.1em; }

.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--paper-border);
  gap: 10px;
  flex-wrap: wrap;
}
.chapter-nav .btn-ghost {
  border-color: var(--paper-border);
  color: var(--paper-text);
  background: transparent;
}
.chapter-nav .btn-ghost:hover { background: rgba(0,0,0,0.05); }
.chapter-nav a.disabled { pointer-events: none; opacity: 0.35; }

/* ---------- Yazma paneli ---------- */

.editor-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  padding: 28px 0 70px;
  align-items: start;
}

.editor-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 78px;
}

.my-books-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.my-book-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}
.my-book-item:hover { background: var(--surface-2); }
.my-book-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
.my-book-item .mini-cover {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.my-book-item .mini-info { min-width: 0; }
.my-book-item .mini-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-book-item .mini-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.editor-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 300px;
}

.editor-main .empty-state { border: none; padding: 60px 20px; }

.editor-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cover-picker-group {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}
.swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--accent); }

.emoji-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1.05rem;
}
.emoji-btn.selected { border-color: var(--accent); background: var(--accent-soft); }

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.chapters-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  flex-wrap: wrap;
}

.chapter-row .chapter-row-title { font-weight: 600; font-size: 0.92rem; }
.chapter-row .chapter-row-excerpt { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }
.chapter-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.chapter-editor-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 14px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-heading h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .read-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .chapter-sidebar,
  .editor-sidebar {
    position: static;
  }
  .reading-pane { padding: 24px 18px; }
}

@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
  .logo span:not(.star) { display: none; }
  .book-hero-cover { width: 112px; height: 158px; }
}

@media (max-width: 520px) {
  .book-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .book-hero-info .summary { margin: 0 auto; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
}

/* ---------- Profil sayfasi ---------- */

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.avatar-preview img,
.avatar-preview span {
  width: 100% !important;
  height: 100% !important;
  font-size: 2.4rem !important;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.file-input-label:hover { background: var(--accent-soft); }
.file-input-label input[type="file"] { display: none; }

/* ---------- Fotograf kirpma ---------- */

.crop-modal-box { max-width: 340px; text-align: center; }

.crop-circle-wrap {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  overflow: hidden;
  margin: 6px auto 18px;
  position: relative;
  background: #10131a;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 5px var(--border);
}
.crop-circle-wrap.dragging { cursor: grabbing; }
.crop-circle-wrap img {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  max-width: none;
}

.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
  margin-bottom: 4px;
}
.crop-zoom-row input[type="range"] { flex: 1; }

/* ---------- Modal (geri bildirim vb.) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 22, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.modal-box h3 {
  font-family: var(--font-serif);
  margin: 0 0 10px;
}

/* ---------- Geri bildirim yuzen buton ---------- */

.feedback-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.feedback-fab:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .feedback-fab-label { display: none; }
  .feedback-fab { padding: 12px 14px; font-size: 1.05rem; bottom: 16px; right: 16px; }
}

/* ---------- Toast bildirim ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--bg-alt);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Panel sekmeleri (yazar paneli - opsiyonel kullanim) ---------- */

.panel-tabs { display: flex; gap: 8px; margin: 18px 0 22px; flex-wrap: wrap; }
.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.tab-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
}

/* ---------- Geri bildirim listesi (panel) ---------- */

.feedback-list { display: flex; flex-direction: column; gap: 12px; }
.feedback-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.feedback-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.feedback-item-name { font-weight: 700; }
.feedback-item-meta { font-size: 0.76rem; color: var(--text-dim); }
.feedback-item-message { color: var(--text); line-height: 1.55; white-space: pre-wrap; }

/* ---------- Kapak onizleme (yazar paneli) ---------- */

.cover-preview-wrap { display: flex; justify-content: center; margin-bottom: 20px; }

/* ---------- Yazma akisi (kitap olusturma + bolum yazma) ---------- */

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.status-pill.draft { background: #fdf3dc; color: #9a7215; }
.status-pill.live { background: #e2f6ec; color: var(--success); }

.work-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.work-card .mini-cover {
  width: 52px;
  height: 72px;
  border-radius: 8px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
}
.work-card-info { flex: 1; min-width: 0; }
.work-card-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-card-sub { font-size: 0.8rem; color: var(--muted, #77738a); margin-top: 2px; }
.work-card-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }

.write-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.write-topbar .back-link {
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--text);
  padding: 4px 8px;
}
.write-topbar .write-book-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.write-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 0 130px;
}
.write-wrap .chapter-title-input {
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 10px 2px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
}
.write-wrap .chapter-title-input:focus { border-bottom-color: var(--accent); }
.write-wrap .chapter-content-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 55vh;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
}

.write-actions {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
}
.write-main-btn {
  padding: 15px 26px !important;
  font-size: 1.02rem !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(108, 74, 182, 0.35) !important;
}
.write-actions .btn-ghost { background: var(--bg-alt); }

.chapter-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--text);
  margin-bottom: 8px;
}
.chapter-pick-item.active { border-color: var(--accent); background: var(--accent-soft); }
