:root {
  --bg-primary: #080808;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card2: #242424;
  --bg-tertiary: #1e1e1e;
  --bg-active: rgba(189,162,117,0.08);
  --bg-hover: rgba(255,255,255,0.04);
  --accent-red: #BDA275;
  --accent-red2: #d4b896;
  --accent-red-dark: #7B694C;
  --grad-red: linear-gradient(135deg, #BDA275, #7B694C);
  --text-primary: #f0f0f0;
  --text-secondary: #b0b0b0;
  --text-muted: #606060;
  --border: rgba(189,162,117,0.18);
  --border-hover: rgba(189,162,117,0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --glow: 0 0 20px rgba(189,162,117,0.15);
}

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

html { scroll-behavior: smooth; overflow-x: hidden; max-width: 100vw; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100vw;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }
img:not(.avatar-sm):not(.avatar-md):not(.nav-avatar):not(.comment-avatar):not(.chat-msg-avatar):not(.member-avatar):not(.profile-avatar):not(.fdm-avatar):not(.book-cover img):not(.book-detail-cover img):not(.group-cover img):not(.forum-detail-banner):not(.forum-card-banner) { object-fit: contain; }
* { box-sizing: border-box; min-width: 0; }

/* Belirli resim tipleri için cover */
.forum-detail-banner, .forum-card-banner, .book-cover img,
.group-cover img, .nav-avatar, .comment-avatar,
.chat-msg-avatar, .avatar-sm, .avatar-md, .member-avatar,
.profile-avatar, .fdm-avatar {
  object-fit: cover;
}

/* Global taşma önleme */
#app, .container, .page, .card, .card-body,
.forum-card, .book-card, .group-card,
.comment, .comment-body,
.chat-msg, .chat-msg-body, .chat-msg-text,
.forum-detail, .forum-detail-content,
.profile-header, .profile-info,
.ebook-reader, .ebook-page-content, .book-text, .book-title-heading {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ebook-reader, .ebook-page-content { box-sizing: border-box; }

/* Flex ve grid taşma */
.flex, [style*="display:flex"], [style*="display: flex"] {
  min-width: 0;
}
input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.2s;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent-red); }
textarea { resize: vertical; min-height: 100px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #0a0a0a 0%, rgba(10,10,10,0.97) 100%);
  border-bottom: 1px solid rgba(189,162,117,0.3);
  backdrop-filter: blur(12px);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0;
  flex-shrink: 0;
  overflow: visible;
}
.brand-icon {
  width: 32px; height: 32px;
  background: var(--grad-red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900;
  color: white;
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: rgba(189,162,117,0.1); }
.nav-auth { display: flex; gap: 8px; align-items: center; }
.nav-user { position: relative; display: flex; align-items: center; gap: 8px; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s;
}
.nav-user-btn:hover { border-color: var(--border-hover); }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); }
.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fadeDown 0.15s ease;
}
@keyframes fadeDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  background: none; border: none; width: 100%; text-align: left;
  transition: all 0.15s;
}
.dropdown-item:hover { background: rgba(189,162,117,0.08); color: var(--text-primary); }
.dropdown-item.text-danger { color: var(--accent-red2); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.mobile-menu { display: none; flex-direction: column; padding: 8px 20px 12px; gap: 2px; }
.mobile-nav-link { padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 15px; }
.mobile-nav-link:hover { color: var(--text-primary); background: rgba(189,162,117,0.08); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 20px; }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; margin-left: auto; }
  .mobile-menu { display: flex; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: none;
  transition: all 0.2s; cursor: pointer;
  white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-primary { background: var(--grad-red); color: white; box-shadow: 0 2px 12px rgba(189,162,117,0.3); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(189,162,117,0.5); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--border-hover); background: rgba(189,162,117,0.05); }
.btn-danger { background: var(--accent-red-dark); color: white; }
.btn-danger:hover { background: var(--accent-red); }
.btn-ghost { background: none; border: none; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page { padding: 40px 0; }
.page-header { margin-bottom: 32px; }
.page-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.page-subtitle { color: var(--text-secondary); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
@media (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
/* ===== CARDS ===== */
.card {
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid rgba(189,162,117,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--border-hover); box-shadow: 0 0 20px rgba(189,162,117,0.1); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); }

.book-card {
  background: linear-gradient(180deg, #5a371f 0%, #2f1a0f 100%);
  border: 1px solid rgba(189,162,117,0.14);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.book-card:hover { transform: translateY(-2px); border-color: rgba(189,162,117,0.25); box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.book-cover { aspect-ratio: 2/3; overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)); display: flex; align-items: center; justify-content: center; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 32px; }
.video-list-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.books-list-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.books-list-header .page-subtitle { display:block !important; font-size:15px; font-weight:600; color:var(--text-secondary); }
.video-list-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap:16px; }
.video-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(189,162,117,0.06));
  border: 1px solid rgba(189,162,117,0.16);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display:flex;
  flex-direction:column;
  height:100%;
}
.video-card:hover { transform: translateY(-2px); border-color: var(--border-hover); box-shadow: 0 10px 24px rgba(0,0,0,0.3); }
.video-thumb { aspect-ratio: 16/9; background: var(--bg-card2); display:flex; align-items:center; justify-content:center; }
.video-thumb img { width:100%; height:100%; object-fit:cover; }
.video-thumb-placeholder { color: var(--text-muted); font-size: 28px; }
.video-card-body { padding: 14px; display:grid; gap:8px; flex:1; }
.video-card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height:1.35; }
.video-card-meta { font-size: 12px; color: var(--text-secondary); display:flex; flex-wrap:wrap; gap:6px; }
.video-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.video-page-layout { display:grid; grid-template-columns:minmax(0, 1.55fr) minmax(280px, 0.8fr); gap:20px; align-items:start; }
.video-main-column { display:grid; gap:16px; min-width:0; }
.video-side-panel { position:sticky; top:88px; }
.video-player-card { display:block; }
.video-player-shell { position: relative; background:#000; border-radius: 18px; overflow:hidden; border:1px solid var(--border); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
.video-player { width:100%; aspect-ratio:16/9; background:#000; }
.video-ad-overlay { position:absolute; display:flex; flex-direction:column; gap:6px; padding:12px 14px; border-radius:14px; background: rgba(0,0,0,0.75); color:#fff; font-size:13px; line-height:1.4; z-index: 5; min-width:180px; max-width:260px; }
.video-ad-overlay.hidden { display:none; }
.video-ad-overlay a { color:#fff; text-decoration:none; }
.video-ad-overlay.bottom-right { bottom:16px; right:16px; }
.video-ad-overlay.bottom-left { bottom:16px; left:16px; }
.video-ad-overlay.top-right { top:16px; right:16px; }
.video-ad-overlay.top-left { top:16px; left:16px; }
.video-ad-overlay .video-ad-link { display:grid; gap:8px; }
.video-ad-overlay .video-ad-video { width:100%; max-height:120px; border-radius:8px; object-fit:cover; background:#000; }
.video-ad-overlay .video-ad-copy { display:grid; gap:2px; }
.video-comment-like.liked { color: var(--accent-red); }
.video-meta-block, .video-comments-card { background: var(--bg-card); border:1px solid var(--border); border-radius: var(--radius); padding: 18px; display:grid; gap:14px; }
.video-title { font-size: clamp(20px, 2vw, 28px); font-weight: 800; line-height:1.2; }

/* Prevent long titles from overflowing their containers
   Applies a 2-line clamp with ellipsis fallback for supported browsers.
   Ensures responsive wrapping and avoids layout breakage. */
.page-title, .video-title, .book-title, .forum-card-title, .forum-card .forum-card-title,
.forum-detail-title, .video-card-title, .book-detail-title, .book-title-heading,
.card-title, .list-card-title, .forum-detail .forum-detail-title, .video-player-card .video-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  max-width: 100%;
  white-space: normal;
}

/* Ensure flex children can shrink so titles don't force overflow */
.forum-card-body, .card-body, .video-card-body, .book-detail-info, .page-header {
  min-width: 0;
}
.video-author-row, .video-stats-row, .video-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.video-author-link { display:inline-flex; align-items:center; gap:8px; color: var(--text-primary); font-weight:600; }
.video-description-card { background: rgba(255,255,255,0.02); border:1px solid rgba(189,162,117,0.12); border-radius: 12px; padding: 12px; }
.video-description-title { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.video-description-text { font-size: 14px; color: var(--text-primary); line-height: 1.7; }
.video-description-text a { color: #60a5fa; text-decoration: underline; }
.comment-form { display:flex; gap:8px; align-items:flex-start; }
.comment-form textarea { min-height: 72px; }
.comment-form .btn { flex-shrink:0; }
@media (max-width: 1024px) {
  .video-page-layout { grid-template-columns: 1fr; }
  .video-side-panel { position: static; }
}
@media (max-width: 768px) {
  .video-list-header { flex-direction: column; align-items: stretch; }
  .video-list-grid { grid-template-columns: 1fr; gap: 12px; }
  .video-card { border-radius: 14px; }
  .video-card-body { padding: 12px; }
  .video-title { font-size: 20px; }
  .video-actions { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-actions .btn { width: 100%; justify-content: center; }
  .comment-form { flex-direction: column; }
  .comment-form .btn { width: 100%; }
  .video-meta-block, .video-comments-card { padding: 14px; }
  .video-ad-overlay { min-width: 140px; max-width: calc(100% - 24px); font-size: 12px; padding: 10px 12px; }
  /* Reals styles */
  .reals-container { position: relative; height: 100vh; }
  .reals-list { position: relative; height: 100vh; }
  .reals-item { width: 100%; height: 100vh; display:flex; align-items:flex-end; justify-content:flex-start; padding:16px; box-sizing:border-box; }
  .reals-video { width:100%; height:100%; object-fit:cover; border-radius:0; }
  .reals-meta { position:absolute; bottom:20px; left:16px; right:16px; color:#fff; }
  .reals-user { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
  .reals-actions { display:flex; gap:8px; margin-top:8px; }
}

.book-info { padding: 16px; display: grid; gap: 8px; }
.book-title { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.book-author, .book-pages { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.book-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-top: 6px; }

.book-detail-header { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.book-detail-cover { width: 100%; min-height: 360px; border-radius: var(--radius); overflow: hidden; background: var(--bg-card2); display: flex; align-items: center; justify-content: center; }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }

/* Restore brown background for book detail cover to match original style */
.book-detail-cover { background: linear-gradient(180deg, #5a371f 0%, #2f1a0f 100%); }
.book-detail-info { display: grid; gap: 16px; }
.book-detail-title { font-size: 32px; font-weight: 800; }
.book-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--text-secondary); font-size: 13px; }
.book-preface { background: rgba(255,255,255,0.02); border: 1px solid rgba(189,162,117,0.12); border-radius: 16px; padding: 16px; color: var(--text-primary); line-height: 1.7; }
.book-preface strong { display: block; margin-bottom: 8px; color: var(--text-primary); }

.ebook-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.ebook-toc { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ebook-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ebook-toolbar button { border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); padding: 8px 12px; border-radius: var(--radius-sm); }
.ebook-toolbar {
  /* match the book brown header to the book background */
  background: linear-gradient(180deg, #5a371f 0%, #2f1a0f 100%);
  padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08);
}
.ebook-page-counter { color: var(--text-secondary); font-size: 13px; }
.ebook-page-content { background: var(--book-bg, #F4ECD8); border: 1px solid rgba(0,0,0,0.12); border-radius: var(--radius); padding: 40px 48px; min-height: 360px; box-shadow: 0 2px 12px rgba(0,0,0,0.10), inset 0 0 0 1px rgba(0,0,0,0.06); }
.book-title-heading { font-size: 26px; font-weight: 700; margin-bottom: 18px; font-family: 'Literata', Georgia, serif; color: var(--book-text, #2c1a0e); }

/* Hide H1 headings inside ebook pages (e.g. 'Giriş') since page titles are managed elsewhere */
.ebook-page-content h1, .ebook-page-content .book-title-heading {
  display: none !important;
}
.book-text { font-size: inherit; color: var(--book-text, #2c1a0e); line-height: 2.0; white-space: pre-wrap; font-family: 'Literata', Georgia, serif; }
.ebook-page-image { width: 100%; max-height: 320px; border-radius: 16px; margin-bottom: 18px; object-fit: cover; }
.ebook-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ebook-nav-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; width: calc(50% - 6px); padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); text-decoration: none; }
.ebook-nav-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.page-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.page-item:last-child { border-bottom: none; }
.page-num { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(189,162,117,0.12); color: var(--accent-red); font-weight: 700; font-size: 14px; }
.page-title { color: var(--text-primary); font-weight: 600; }

/* Hide top-level page titles from rendering on the page while keeping document.title intact */
.page-title { display: none !important; }
.resume-card { border: 1px solid rgba(59,130,246,0.2); background: rgba(59,130,246,0.08); border-radius: 18px; padding: 18px 22px; }

@media (max-width: 1024px) {
  .book-detail-header { grid-template-columns: 1fr; }
  .ebook-layout { grid-template-columns: 1fr; }
  .ebook-toc { display: none; }
}

@media (max-width: 768px) {
  .book-cover { aspect-ratio: 2/3; height: auto; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--bg-primary);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(189,162,117,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; padding: 40px 20px; }
.hero-title {
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 900; letter-spacing: 6px;
  background: linear-gradient(135deg, #f5f5f5, #a3a3a3);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 16px;
}
.hero-subtitle { font-size: 18px; color: var(--text-secondary); margin-bottom: 36px; font-weight: 400; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== SECTION ===== */
.section { margin-bottom: 60px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title-bar { width: 4px; height: 22px; background: var(--grad-red); border-radius: 2px; }

/* ===== FORUM CARD ===== */
.forum-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid rgba(189,162,117,0.15);
  border-radius: var(--radius);
  display: flex; overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}
.forum-card:hover { border-color: var(--border-hover); box-shadow: var(--glow); transform: translateY(-2px); }
.forum-card-accent { width: 4px; background: var(--grad-red); flex-shrink: 0; }
.forum-card-body { padding: 18px; flex: 1; min-width: 0; }
.forum-card-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-card-preview { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-card-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.forum-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.forum-meta-item i { color: var(--accent-red); font-size: 11px; }
.forum-card-banner {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  margin: 10px 10px 10px 0;
  align-self: center;
  border: 1px solid rgba(255,255,255,0.07);
}

/* Forum etiketleri */
.forum-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.forum-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 20px; cursor: pointer; transition: opacity 0.15s;
  text-decoration: none; white-space: nowrap;
}
.forum-tag:hover { opacity: 0.75; }
.forum-tag-custom {
  background: rgba(88,101,242,0.12);
  color: #7c87f5;
  border: 1px solid rgba(88,101,242,0.25);
}

/* ===== BOOK CARD ===== */
.book-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid rgba(189,162,117,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.book-card:hover { border-color: var(--border-hover); box-shadow: var(--glow); transform: translateY(-2px); }
.book-cover {
  aspect-ratio: 2/3;
  background: var(--bg-card2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; position: relative;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover-placeholder { font-size: 48px; color: var(--text-muted); }
.book-info { padding: 14px; flex: 1; }
.book-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; overflow-wrap: anywhere; max-width: 100%; }
.book-author { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.book-pages { font-size: 12px; color: var(--text-muted); }
.book-desc { font-size: 12px; color: var(--text-secondary); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== GROUP CARD ===== */
.group-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid rgba(189,162,117,0.15);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.group-card:hover { border-color: var(--border-hover); box-shadow: var(--glow); transform: translateY(-2px); }
.group-cover { aspect-ratio: 16/9; background: var(--bg-card2); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.group-cover img { width: 100%; height: 100%; object-fit: cover; }
.group-cover-placeholder { font-size: 40px; color: var(--text-muted); }
.group-info { padding: 14px; overflow: hidden; min-width: 0; flex: 1; display: flex; flex-direction: column; }
.group-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-red { background: rgba(189,162,117,0.15); color: var(--accent-red2); border: 1px solid rgba(189,162,117,0.3); }
.badge-gray { background: rgba(163,163,163,0.1); color: var(--text-secondary); border: 1px solid rgba(163,163,163,0.2); }
.badge-green { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-orange { background: rgba(249,115,22,0.1); color: #fb923c; border: 1px solid rgba(249,115,22,0.2); }
.badge-blue { background: rgba(59,130,246,0.1); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-purple { background: rgba(139,92,246,0.1); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-secondary); }
.checkbox-label input { width: auto; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--accent-red2); margin-top: 4px; }

/* ===== TOGGLE SWITCH ===== */
.book-privacy-toggle {
  background: linear-gradient(135deg, rgba(189,162,117,0.08) 0%, rgba(189,162,117,0.04) 100%);
  border: 1px solid rgba(189,162,117,0.2);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  background: rgba(255,255,255,0.1);
  border-radius: 14px;
  transition: background 0.3s ease;
  border: 1px solid rgba(255,255,255,0.15);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: white;
  top: 1px;
  left: 1px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

@media (max-width: 600px) {
  .book-privacy-toggle {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .toggle-header {
    width: 100%;
  }
}

/* ===== AUTH PAGES ===== */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; text-align: center; }
.auth-subtitle { color: var(--text-secondary); text-align: center; margin-bottom: 32px; font-size: 14px; }
.auth-link { color: var(--accent-red2); }
.auth-link:hover { text-decoration: underline; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }

/* ===== PROFILE ===== */
.profile-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #111111 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  display: flex; gap: 24px; align-items: flex-start;
}
@media (max-width: 600px) { .profile-header { flex-direction: column; } }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); border: 3px solid var(--border); }
.profile-avatar-placeholder { width: 100px; height: 100px; border-radius: 50%; background: var(--bg-card2); border: 3px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--text-muted); }
.profile-info { flex: 1; text-align: center; }
.profile-username { font-size: 26px; font-weight: 800; margin-bottom: 2px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.profile-title { font-size: 13px; font-weight: 600; color: var(--accent-red2); margin-top: 4px; margin-bottom: 4px; }
.profile-bio { color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }

/* Rozet satırı */
.profile-badges-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; margin-bottom: 4px; }
.profile-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; border: 1px solid;
  white-space: nowrap;
}
.profile-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.profile-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: var(--bg-card2); border: 1px solid var(--border); border-radius: 20px; font-size: 12px; color: var(--text-secondary); transition: all 0.2s; }
.profile-link:hover { border-color: var(--border-hover); color: var(--text-primary); }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 22px; font-weight: 700; color: var(--accent-red2); }
.profile-stat-label { font-size: 12px; color: var(--text-muted); }
.level-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid; }
.progress-bar { background: var(--bg-card2); border-radius: 4px; height: 6px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; background: var(--grad-red); border-radius: 4px; transition: width 0.4s; }

/* ===== FORUM DETAIL ===== */
.forum-detail { max-width: 800px; margin: 0 auto; overflow: hidden; }
.forum-detail-header { margin-bottom: 24px; overflow: hidden; }
.forum-detail-title { font-size: 28px; font-weight: 800; margin-bottom: 12px; word-break: break-word; overflow-wrap: anywhere; }
.forum-detail-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); margin-bottom: 0; }
.forum-detail-banner { width: 100%; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/6; object-fit: cover; display: block; }
.forum-detail-content { font-size: 15px; line-height: 1.8; color: var(--text-primary); white-space: pre-wrap; margin-bottom: 16px; word-break: break-word; overflow-wrap: anywhere; max-width: 100%; overflow: hidden; }

/* Forum çoklu resim galerisi */
.forum-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}
.forum-gallery-item { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; }
.forum-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.forum-gallery-item:hover img { transform: scale(1.04); }
.forum-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.forum-action-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); transition: all 0.2s; }
.forum-action-btn:hover, .forum-action-btn.active { border-color: var(--border-hover); color: var(--accent-red2); background: rgba(189,162,117,0.05); }
.forum-action-btn.liked { color: var(--accent-red2); border-color: var(--accent-red); }

/* ===== COMMENTS ===== */
.comments-section { }
.comments-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.comment { display: flex; gap: 12px; margin-bottom: 20px; }
.comment-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); flex-shrink: 0; }
.comment-body { flex: 1; background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comment-author { font-size: 13px; font-weight: 600; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-content { font-size: 14px; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 24px; }
.comment-form textarea { flex: 1; min-height: 80px; }

/* ===== BOOK DETAIL ===== */
.book-detail-header { display: flex; gap: 28px; margin-bottom: 32px; }
@media (max-width: 600px) { .book-detail-header { flex-direction: column; } }
.book-detail-cover { width: 160px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; background: var(--bg-card2); }
.book-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-detail-info { flex: 1; }
.book-detail-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; word-break: break-word; overflow-wrap: anywhere; }
.book-detail-meta { display:flex; flex-wrap:wrap; gap:12px; align-items:center; font-size:13px; color:var(--text-secondary); margin-bottom:14px; }
.book-detail-meta span { display:flex; align-items:center; gap:6px; }
.book-detail-author { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.book-preface { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.chapters-list { margin-top: 24px; }
.chapter-item { margin-bottom: 12px; }
.chapter-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; padding: 8px 12px; background: rgba(189,162,117,0.05); border-left: 3px solid var(--accent-red); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.page-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: var(--radius-sm); transition: background 0.15s; }
.page-item:hover { background: var(--bg-card2); }
.page-num { font-size: 12px; color: var(--text-muted); width: 28px; flex-shrink: 0; }
.page-title { font-size: 14px; color: var(--text-primary); flex: 1; }

/* ===== PAGE READER ===== */
.page-reader { max-width: 720px; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-red2); }
.page-reader-title { font-size: 26px; font-weight: 800; margin-bottom: 24px; }
.page-reader-content { font-size: 15px; line-height: 1.9; color: var(--text-primary); white-space: pre-wrap; margin-bottom: 40px; }
.page-nav { display: flex; justify-content: space-between; gap: 12px; }
.page-nav-btn { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: all 0.2s; }
.page-nav-btn:hover { border-color: var(--border-hover); background: rgba(189,162,117,0.05); }
.page-nav-btn.prev { text-align: left; }
.page-nav-btn.next { text-align: right; justify-content: flex-end; }
.page-nav-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.page-nav-title { font-size: 14px; font-weight: 600; }

/* ===== GROUP CHAT ===== */
.group-detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
@media (max-width: 900px) { .group-detail-layout { grid-template-columns: 1fr; } }
.chat-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: 520px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-card2); flex-shrink: 0; object-fit: cover; }
.chat-msg-body { flex: 1; }
.chat-msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.chat-msg-name { font-size: 13px; font-weight: 600; }
.chat-msg-time { font-size: 11px; color: var(--text-muted); }
.chat-msg-text { font-size: 14px; color: var(--text-primary); background: var(--bg-card2); padding: 8px 12px; border-radius: 0 8px 8px 8px; display: inline-block; max-width: 100%; word-break: break-word; }
.chat-msg-img { max-width: 200px; border-radius: 8px; margin-top: 4px; cursor: pointer; }
.chat-input-bar { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.chat-input-bar input { flex: 1; min-width: 0; }
.chat-input-bar button { flex-shrink: 0; }
.chat-input-bar label { flex-shrink: 0; cursor: pointer; }
.group-sidebar-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.member-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.member-item:last-child { border-bottom: none; }
.member-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); }

/* ===== SETTINGS ===== */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
@media (max-width: 768px) { .settings-layout { grid-template-columns: 1fr; } }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.15s; }
.settings-nav-item:hover, .settings-nav-item.active { color: var(--text-primary); background: rgba(189,162,117,0.08); }
.settings-nav-item.active { color: var(--accent-red2); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--bg-card); border: 1px solid rgba(189,162,117,0.25); border-radius: var(--radius); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.7); animation: slideUp 0.2s ease; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 20px 24px 0; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 18px; transition: color 0.15s; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 0 24px 24px; }

/* ===== MENTION & HASHTAG ===== */
.inline-mention {
  color: #5865F2; font-weight: 600; text-decoration: none;
  background: rgba(88,101,242,0.1); border-radius: 4px; padding: 0 3px;
  transition: background .15s;
}
.inline-mention:hover { background: rgba(88,101,242,0.2); }
.inline-hashtag {
  color: #5865F2; font-weight: 600; text-decoration: none;
  transition: opacity .15s;
}
.inline-hashtag:hover { opacity: 0.75; }

/* ===== TOAST ===== */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 14px; min-width: 220px; max-width: 360px; box-shadow: var(--shadow); animation: toastIn 0.25s ease; display: flex; align-items: center; gap: 10px; pointer-events: all; }
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(189,162,117,0.5); }
.toast.success i { color: #4ade80; }
.toast.error i { color: var(--accent-red2); }
@keyframes toastIn { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== USER BADGE ===== */
.user-badge { display: inline-flex; align-items: center; gap: 6px; }
.user-vip { font-size: 12px; color: #fbbf24; }
.user-plus { font-size: 12px; color: #818cf8; }

/* ===== SEARCH ===== */
.search-bar { position: relative; margin-bottom: 24px; }
.search-bar input { padding-left: 40px; }
.search-bar i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border: none; background: none; border-bottom: 2px solid transparent; transition: all 0.2s; cursor: pointer; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-red2); border-bottom-color: var(--accent-red); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 15px; }

/* ===== SPINNER ===== */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent-red); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 60px; }

/* ===== MISC ===== */
.hidden { display: none !important; }
.text-red { color: var(--accent-red2); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.grow { flex: 1; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); }
.avatar-md { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-card2); }
.avatar-placeholder { display: flex; align-items: center; justify-content: center; background: var(--bg-card2); color: var(--text-muted); font-size: 0.7em; }
pre, .page-reader-content { font-family: 'Inter', sans-serif; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ===== EBOOK READER ===== */
.ebook-reader {
  min-width: 0;
  width: 100%;
  background: linear-gradient(180deg, #5a371f 0%, #2f1a0f 100%);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  overflow: hidden;
  box-sizing: border-box;
}
.ebook-toolbar {
  background: linear-gradient(180deg, #5a371f 0%, #2f1a0f 100%);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 60px;
  z-index: 10;
  min-width: 0;
  overflow: hidden;
}
.ebook-page-content {
  padding: 32px 36px;
  font-size: 17px;
  line-height: 1.9;
  color: #e8ddd0;
  font-family: 'Georgia', serif;
  min-height: 500px;
  word-break: break-word;
  overflow-wrap: anywhere;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}
.ebook-page-content .book-title-heading {
  display: none !important;
}
.ebook-page-content .book-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .ebook-page-content { padding: 20px 16px; font-size: 15px; }
  .ebook-reader { border-radius: 8px; }
  .ebook-toolbar { padding: 10px 12px; }
}
.ebook-page-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  margin-bottom: 24px;
  border-radius: 8px;
}
.ebook-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid rgba(189,162,117,0.15);
  background: #111;
}
.ebook-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(189,162,117,0.1);
  border: 1px solid rgba(189,162,117,0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.ebook-nav-btn:hover { background: rgba(189,162,117,0.2); border-color: var(--accent-red); }
.ebook-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.ebook-page-counter {
  font-size: 13px;
  color: var(--text-muted);
}
.ebook-toc {
  background: #161010;
  border-right: 1px solid rgba(189,162,117,0.15);
  width: 240px;
  flex-shrink: 0;
}
.ebook-layout {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 0;
  align-items: flex-start;
  overflow: hidden;
}
.font-size-controls button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.font-size-controls button:hover { border-color: var(--accent-red); color: var(--text-primary); }


/* ===================================
   MOBİL OPTİMİZASYON – KAPSAMLI
   =================================== */

/* --- Genel mobil iyileştirmeler --- */
@media (max-width: 768px) {
  body { font-size: 14px; }

  .container { padding: 0 12px; }
  .page { padding: 20px 0 40px; }
  .page-title { font-size: 22px; }
  .page-header { margin-bottom: 20px; }

  /* Navbar mobil */
  .nav-container { padding: 0 12px; gap: 8px; height: 54px; }
  .nav-auth { gap: 6px; }
  .nav-auth .btn { padding: 5px 10px; font-size: 12px; }
  #new-btn-wrap .btn { padding: 5px 10px; font-size: 12px; }
  .nav-user-btn { padding: 5px 8px; gap: 6px; font-size: 13px; }
  .nav-avatar { width: 24px; height: 24px; }

  /* Mobile menu geliştirilmiş */
  .mobile-menu {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 6px 12px 10px;
  }
  .mobile-nav-link {
    padding: 11px 12px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
  }

  /* Hero mobil */
  .hero { min-height: 320px; }
  .hero-content { padding: 30px 16px; }
  .hero-title { font-size: 42px; letter-spacing: 3px; margin-bottom: 10px; }
  .hero-subtitle { font-size: 14px; margin-bottom: 24px; }
  .hero-buttons { gap: 10px; }
  .btn-lg { padding: 11px 20px; font-size: 14px; }

  /* Forum kartları */
  .forum-card { flex-direction: column; }
  .forum-card-accent { width: 100%; height: 3px; }
  .forum-card-body { padding: 14px; }
  .forum-card-banner { width: 100%; height: 160px; min-height: unset; margin: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .forum-card-title { font-size: 15px; }
  .forum-card-meta { gap: 10px; }
  .forum-meta-item { font-size: 11px; }

  /* Kitap grid */
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Bölüm başlıkları */
  .section { margin-bottom: 36px; }
  .section-header { margin-bottom: 16px; }
  .section-title { font-size: 17px; }

  /* Forum detay */
  .forum-detail { max-width: 100%; }
  .forum-detail-title { font-size: 20px; }
  .forum-detail-meta { gap: 10px; font-size: 12px; }
  .forum-detail-banner { aspect-ratio: 16/7; }
  .forum-detail-content { font-size: 14px; }
  .forum-actions { gap: 8px; }
  .forum-action-btn { padding: 7px 12px; font-size: 12px; }

  /* Yorumlar */
  .comment-form { gap: 8px; }
  .comment-avatar { width: 32px; height: 32px; }
  .comment-body { padding: 10px 12px; }
  .comment-content { font-size: 13px; }

  /* Modal */
  .modal { max-height: 95vh; max-width: 100%; margin: 0; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-header { padding: 16px 16px 0; }
  .modal-body { padding: 0 16px 20px; }

  /* Arama */
  .search-bar { margin-bottom: 16px; }
  .search-bar input { font-size: 15px; padding: 11px 11px 11px 38px; }

  /* Profil */
  .profile-header { padding: 20px 16px; gap: 16px; }
  .profile-avatar { width: 80px; height: 80px; }
  .profile-avatar-placeholder { width: 80px; height: 80px; font-size: 32px; }
  .profile-username { font-size: 20px; }
  .profile-stats { gap: 16px; }
  .profile-stat-num { font-size: 18px; }

  /* Kitap detay */
  .book-detail-header { gap: 16px; }
  .book-detail-cover { width: 120px; }
  .book-detail-title { font-size: 20px; }

  /* Grup */
  .group-detail-layout { grid-template-columns: 1fr; gap: 16px; }
  .chat-container { height: 420px; }
  .chat-input-bar { padding: 8px; gap: 6px; }

  /* Ayarlar */
  .settings-layout { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; gap: 4px; }
  .settings-nav-item { white-space: nowrap; flex-shrink: 0; }

  /* Toast */
  #toast-container { bottom: 12px; right: 12px; left: 12px; }
  .toast { min-width: unset; max-width: 100%; }

  /* Butonlar */
  .btn { font-size: 13px; }

  /* Sayfa okuyucu */
  .page-reader { max-width: 100%; }
  .page-nav { flex-direction: column; gap: 8px; }
  .page-nav-btn { width: 100%; }
  .ebook-page-content { padding: 24px 16px; font-size: 15px; }
  .ebook-toolbar { padding: 10px 12px; top: 54px; }
  .ebook-layout { flex-direction: column; }
  .ebook-toc { width: 100%; }
  .ebook-toolbar { position: sticky; top: 0; left: 0; right: 0; z-index: 12; }
  .ebook-page-content { overflow-x: hidden; }
  .ebook-page-content .book-title-heading { display: none !important; }
  .ebook-page-content .book-text { word-break: break-word; }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
  }
  .page-header > div { width: 100%; }
  .page-title, .page-subtitle { width: 100%; }
  .page-title { white-space: normal; overflow-wrap: break-word; }
  .page-subtitle { white-space: normal; }

  .forum-card { width: 100%; overflow: hidden; }
  .forum-card-body { min-width: 0; }
  .forum-card-title, .forum-card-preview, .forum-card-meta, .forum-meta-item { overflow-wrap: anywhere; }
  .forum-card-banner { width: 100%; height: auto; }

  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-2 { grid-template-columns: 1fr; }

  .video-card { width: 100%; }
  .video-card-body { min-width: 0; }
  .video-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .profile-links, .profile-stats, .forum-actions { width: 100%; }
  .profile-links { justify-content: flex-start; flex-wrap: wrap; }

  .book-detail-header { flex-direction: column; }
  .book-detail-cover { width: 100%; max-width: 100%; }

  .ebook-toolbar button, .ebook-nav-btn, .forum-action-btn { width: 100%; justify-content: center; }

  .tabs { overflow-x: auto; padding-bottom: 0; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; }

  .form-row { grid-template-columns: 1fr; gap: 12px; }
  input, textarea, select { font-size: 16px; } /* iOS zoom önleme */
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hero-title { font-size: 34px; }
  .forum-detail-title { font-size: 18px; }
  .book-detail-header { flex-direction: column; }
  .book-detail-cover { width: 100%; max-width: 100%; align-self: center; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .profile-links { justify-content: center; }
  .profile-stats { justify-content: center; }
  .page-nav-btn.prev .page-nav-title,
  .page-nav-btn.next .page-nav-title { display: none; }

  .container, .page, .ebook-page-content, .ebook-reader, .forum-card, .video-card, .profile-header, .book-detail-header, .ebook-toolbar {
    width: 100%;
    max-width: 100%;
  }
  .ebook-page-content { padding: 18px 14px; }
  .page-title, .page-subtitle, .forum-card-title, .video-card-title, .book-detail-title {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  .ebook-toolbar { gap: 8px; }
  .ebook-toolbar button { flex: 1; }
}

/* --- Dokunma hedefleri --- */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .dropdown-item { min-height: 44px; }
  .mobile-nav-link { min-height: 44px; }
  .tab { min-height: 44px; }
  .forum-action-btn { min-height: 40px; }
  input, textarea, select { min-height: 44px; }
  .nav-mobile-toggle { padding: 8px; min-width: 44px; min-height: 44px; }
}

/* ===== NAVBAR MOBİL OVERFLOW FIX ===== */
@media (max-width: 768px) {
  .nav-container { padding: 0 12px; gap: 0; height: 54px; overflow: visible; }
  .nav-brand { flex: 1; min-width: 0; }
  .nav-auth { display: none !important; }
  #new-btn-wrap { display: none !important; }
  .nav-user-btn span { display: none; }
  .nav-user-btn i.fa-chevron-down { display: none; }
  .nav-user-btn { padding: 5px 8px; border: none; background: none; gap: 0; }
  #nav-user { gap: 4px !important; flex-shrink: 0; }
  .nav-mobile-toggle { display: block; margin-left: 4px; flex-shrink: 0; }
  .navbar { overflow: visible; }
}

/* Mobile menu içine auth + yeni butonları ekle */
@media (max-width: 768px) {
  .mobile-menu-auth { display: flex; gap: 8px; padding: 8px 12px 4px; }
  .mobile-menu-auth .btn { flex: 1; justify-content: center; }
  .mobile-menu-new { display: flex; gap: 6px; padding: 4px 12px 8px; border-bottom: 1px solid rgba(189,162,117,0.15); margin-bottom: 4px; }
  .mobile-menu-new .btn { flex: 1; justify-content: center; font-size: 12px; padding: 7px 8px; }
}
@media (min-width: 769px) {
  .mobile-menu-auth, .mobile-menu-new { display: none; }
}
@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    z-index: 90;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  }
  .mobile-bottom-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    padding: 4px 0;
    transition: color 0.15s;
  }
  .mobile-bottom-bar a.active,
  .mobile-bottom-bar a:hover { color: var(--accent-red2); }
  .mobile-bottom-bar i { font-size: 18px; }
  body { padding-bottom: 60px; }
  #toast-container { bottom: 72px; }
}
@media (min-width: 769px) {
  .mobile-bottom-bar { display: none; }
}

/* ===== DM / MESAJLAŞMA ===== */

/* ---- Layout ---- */
.dm-layout {
  display: flex;
  height: calc(100svh - 60px);
  overflow: hidden;
  background: var(--bg-primary);
}

/* ---- Sidebar ---- */
.dm-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s;
}
.dm-sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.dm-sidebar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.dm-sidebar-actions { display: flex; align-items: center; gap: 4px; }
.dm-hidden-toggle-btn {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: var(--bg-card2); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0;
}
.dm-hidden-toggle-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.dm-search-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dm-search {
  width: 100%; padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.dm-search:focus { border-color: var(--border-hover); }

/* Hidden panel */
.dm-hidden-panel { border-bottom: 1px solid var(--border); background: var(--dm-reply-bg, rgba(189,162,117,0.04)); flex-shrink: 0; }
.dm-hidden-panel.hidden { display: none; }
.dm-hidden-panel-content { padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.dm-hidden-panel-header { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.dm-hidden-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.dm-empty-small { padding: 8px 0; font-size: 12px; color: var(--text-muted); }
.dm-conv-lock { margin-left: 6px; font-size: 11px; color: var(--accent-red2); }

/* Conv list */
.dm-conv-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dm-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
}
.dm-conv-item:hover, .dm-conv-item.active { background: var(--bg-active); }
.dm-conv-item.dm-unread .dm-conv-name { font-weight: 700; color: var(--text-primary); }
.dm-conv-info { flex: 1; min-width: 0; }
.dm-conv-name-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dm-conv-name { font-size: 14px; color: var(--text-primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-conv-last { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-unread-badge {
  background: var(--accent-red); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 10px; flex-shrink: 0;
}

/* ---- Main area ---- */
.dm-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.dm-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); gap: 10px; padding: 24px;
  text-align: center;
}

/* ---- Chat ---- */
.dm-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }

.dm-chat-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary);
  flex-shrink: 0;
  min-height: 54px;
  gap: 8px;
}
.dm-chat-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.dm-chat-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dm-chat-username {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Message bubbles */
.dm-msg-wrap { display: flex; align-items: flex-end; gap: 8px; width: 100%; min-width: 0; }
.dm-msg-wrap.dm-own { flex-direction: row-reverse; }
.dm-msg-content { display: flex; flex-direction: column; max-width: 68%; min-width: 0; }
.dm-msg-wrap.dm-own .dm-msg-content { align-items: flex-end; }
.dm-msg-bubble {
  padding: 6px 11px; border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  word-break: break-word; overflow-wrap: anywhere;
  white-space: pre-wrap;
  width: fit-content; max-width: 100%;
}
.dm-msg-wrap:not(.dm-own) .dm-msg-bubble {
  background: var(--bg-card2);
  border: 1px solid var(--border-hover);
  border-radius: 4px 14px 14px 14px;
  color: var(--text-primary);
}
.dm-msg-wrap.dm-own .dm-msg-bubble {
  /* Baz olarak her zaman card2 (#242424) kullan, üstüne accent overlay */
  background: var(--bg-card2);
  background-image: linear-gradient(var(--dm-own-bg, rgba(189,162,117,0.45)), var(--dm-own-bg, rgba(189,162,117,0.45)));
  border: 1px solid var(--dm-own-border, rgba(189,162,117,0.5));
  border-radius: 14px 4px 14px 14px;
  color: var(--text-primary);
}
.dm-msg-bubble.dm-deleted {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  font-style: italic; font-size: 12px;
}
.dm-msg-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.dm-reply-preview {
  background: var(--bg-card); background-image: linear-gradient(var(--dm-reply-bg, rgba(189,162,117,0.15)), var(--dm-reply-bg, rgba(189,162,117,0.15)));
  border-left: 3px solid var(--accent-line, var(--accent-red));
  border-radius: 4px; padding: 4px 8px; margin-bottom: 4px;
  max-width: 100%;
}
.dm-shared-forum {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; cursor: pointer;
  min-width: 160px; max-width: 220px; transition: border-color 0.2s;
}
.dm-shared-forum:hover { border-color: var(--accent-red); }
.dm-msg-cb-wrap { display: none; align-items: center; }

/* Hover: show menu btn */
.dm-msg-menu-btn { opacity: 0; transition: opacity 0.15s; }
@media (hover: none) { .dm-msg-menu-btn { opacity: 1; } }

/* ---- Reply bar ---- */
.dm-reply-bar {
  display: none;
  padding: 7px 14px;
  background: var(--bg-card2);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  font-size: 12px; color: var(--text-muted);
}
.dm-reply-bar.visible { display: flex; }

/* ---- Input bar ---- */
.dm-input-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.dm-input-wrap {
  flex: 1; min-width: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 22px;
  display: flex; align-items: flex-end;
  padding: 6px 12px;
  transition: border-color 0.2s;
}
.dm-input-wrap:focus-within { border-color: var(--border-hover); }
.dm-input-wrap textarea {
  flex: 1; background: transparent; border: none; resize: none;
  color: var(--text-primary); font-size: 14px; outline: none;
  padding: 2px 0; line-height: 1.5; max-height: 120px;
  overflow-y: auto; font-family: inherit;
}
.dm-input-img-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 15px; padding: 0 6px 0 0; cursor: pointer;
  align-self: flex-end; margin-bottom: 2px; transition: color 0.15s;
  flex-shrink: 0;
}
.dm-input-img-btn:hover { color: var(--accent-red2); }
.dm-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad-red); border: none; color: #fff;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px var(--dm-own-border, rgba(189,162,117,0.3));
}
.dm-send-btn:hover { transform: scale(1.06); }
.dm-img-preview-wrap {
  display: none; position: relative; flex-shrink: 0; margin-bottom: 4px;
}
.dm-img-preview-wrap img { height: 48px; border-radius: 6px; object-fit: cover; display: block; }
.dm-img-clear {
  position: absolute; top: -6px; right: -6px;
  background: var(--accent-red); color: #fff; border: none; border-radius: 50%;
  width: 16px; height: 16px; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ---- Sel actions bar ---- */
.dm-sel-actions-bar {
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dm-sel-actions-bar.visible { display: flex; }

/* ---- Mobile responsive ---- */
@media (max-width: 768px) {
  .dm-layout {
    height: calc(100svh - 60px - 56px);
    flex-direction: row;
    position: relative;
  }
  /* On mobile: sidebar is absolute full-width by default, chat hidden */
  .dm-sidebar {
    position: absolute; inset: 0;
    width: 100%; z-index: 2;
    border-right: none;
  }
  .dm-main {
    position: absolute; inset: 0;
    z-index: 3;
    display: none;
  }
  /* When chat open: show main, hide sidebar */
  .dm-layout.dm-mobile-chat-open .dm-sidebar { display: none; }
  .dm-layout.dm-mobile-chat-open .dm-main { display: flex; }

  .dm-mobile-back-btn { display: inline-flex !important; }

  .dm-msg-content { max-width: 82%; }
  .dm-msg-bubble { font-size: 13px; padding: 5px 10px; }
  .dm-input-bar { padding: 8px 10px; }
  .dm-messages { padding: 12px 10px 8px; }
  .dm-chat-header { padding: 8px 12px; }

  /* Keyboard push fix - input stays at bottom */
  .dm-chat {
    height: 100%;
    display: flex; flex-direction: column;
  }
}

/* ---- Touch: always show menu btn ---- */
@media (pointer: coarse) {
  .dm-msg-menu-btn { opacity: 0.6; }
  .dm-msg-wrap:active .dm-msg-menu-btn { opacity: 1; }
}


/* ===== MOBİL TAŞMA - KAPSAMLI FİX ===== */
@media (max-width: 768px) {
  /* Genel taşma engeli */
  body, html { overflow-x: hidden !important; }

  /* Tüm içerik konteynerleri */
  .container { padding: 0 12px !important; overflow: hidden; box-sizing: border-box !important; }

  /* Her şey sığsın */
  *, *::before, *::after { max-width: 100%; box-sizing: border-box; }

  /* Flex içlerinde min-width zorunlu */
  .nav-container, .forum-card-meta, .profile-links,
  .profile-stats, .forum-actions, .section-header,
  .chat-msg, .chat-msg-body, .comment, .comment-body,
  .forum-detail-meta { flex-wrap: wrap !important; }

  /* Metinler taşmasın */
  .forum-card-title, .forum-card-preview,
  .book-title, .book-desc, .group-name, .group-desc,
  .forum-detail-title, .forum-detail-content,
  .comment-content, .chat-msg-text,
  .profile-username, .page-reader-title,
  .page-reader-content, h1, h2, h3, h4, p {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
  }

  /* Resimler taşmasın — ama avatar ve kapak görsellerinin yüksekliğine dokunma */
  img { max-width: 100% !important; }
  img:not(.avatar-sm):not(.avatar-md):not(.nav-avatar):not(.comment-avatar):not(.chat-msg-avatar):not(.member-avatar):not(.profile-avatar):not(.fdm-avatar) { height: auto !important; }

  /* Grid: 2 sütun kitaplar için, tek kolon diğerleri */
  .grid-2, .form-row { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

  /* Grup detay */
  .group-detail-layout { grid-template-columns: 1fr !important; gap: 12px !important; }
  .chat-container { height: 380px !important; }

  /* Forum meta kayma */
  .forum-detail-meta { gap: 8px !important; font-size: 12px !important; }
  .forum-detail-meta span { flex-shrink: 0; }

  /* Profil */
  .profile-header { flex-direction: column !important; }

  /* Kitap detay */
  .book-detail-header { flex-direction: column !important; }
  .book-detail-cover { width: 100% !important; max-width: 160px !important; align-self: center !important; }

  /* Textarea ve input iOS zoom engeli */
  input, textarea, select { font-size: 16px !important; }

  /* Forum card banner */
  .forum-card { flex-direction: column !important; }
  .forum-card-accent { width: 100% !important; height: 3px !important; }
  .forum-card-banner { width: 100% !important; height: 160px !important; min-height: unset !important; margin: 0 !important; border-radius: 0 0 var(--radius) var(--radius) !important; }

  /* Ebook mobil */
  .ebook-page-content { padding: 20px 16px !important; font-size: 15px !important; }
  .ebook-layout { flex-direction: column !important; overflow: hidden !important; }
  .ebook-reader { border-radius: 8px !important; overflow: hidden !important; }

  /* Sayfa okuyucu */
  .page-nav { flex-direction: column !important; }
  .page-nav-btn { width: 100% !important; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 36px !important; }
  .page-title { font-size: 20px !important; }
  .forum-detail-title { font-size: 18px !important; }
  .btn { font-size: 13px !important; }
}

/* ===== DUYURU BANNER ===== */
#announcements-container {
  width: 100%;
  position: relative;
  z-index: 900;
}
.announcement-banner {
  width: 100%;
  border-bottom: 2px solid;
  border-top: 2px solid;
}
.announcement-banner.ann-top { border-top: none; }
.ann-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.ann-text { flex: 1; font-size: 14px; line-height: 1.5; }
.ann-text strong { margin-right: 6px; }
.ann-close {
  background: rgba(0,0,0,0.2);
  border: none;
  color: inherit;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.ann-close:hover { opacity: 1; }
.ann-size-small .ann-inner { padding: 6px 20px; }
.ann-size-small .ann-text { font-size: 12px; }
.ann-size-large .ann-inner { padding: 16px 20px; }
.ann-size-large .ann-text { font-size: 16px; }
@media (max-width: 600px) {
  .ann-inner { padding: 8px 12px; }
  .ann-text { font-size: 13px; }
}

/* ===== MOBİL GÖRSEL BOZULMA DÜZELTMELERİ ===== */
@media (max-width: 768px) {
  /* Tüm container'lar taşmasın */
  * { max-width: 100%; }
  img { max-width: 100%; height: auto; display: block; }

  /* Profil fotoğrafı cover kalacak */
  .profile-avatar, .nav-avatar, .book-cover img,
  .forum-detail-banner, .forum-card-banner,
  .group-cover img, .comment-avatar,
  .chat-msg-avatar, .avatar-sm, .avatar-md, .member-avatar { object-fit: cover !important; }

  /* Profil header overflow */
  .profile-header { overflow: hidden; word-break: break-word; }
  .profile-username { font-size: 18px !important; word-break: break-all; }

  /* Forum card banner overfit */
  .forum-card { overflow: hidden; }
  .forum-card-body { padding: 10px 12px; }

  /* Grup kapak taşmasın */
  .group-cover { max-height: 140px; overflow: hidden; }
  .group-cover img { width: 100%; height: 140px; object-fit: cover; }

  /* Kitap ızgara */
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  /* Buton taşmaları */
  .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Mesaj alanı input */
  .dm-input-bar textarea { font-size: 14px; }
  .dm-msg-wrap { max-width: 100%; }

  /* Avatar yükseklikleri mobile'da bozulmasın */
  .avatar-sm { width: 32px !important; height: 32px !important; flex-shrink: 0 !important; }
  .avatar-md { width: 40px !important; height: 40px !important; flex-shrink: 0 !important; }
  .nav-avatar { width: 32px !important; height: 32px !important; flex-shrink: 0 !important; }
  .comment-avatar { width: 34px !important; height: 34px !important; flex-shrink: 0 !important; }
  .chat-msg-avatar { width: 34px !important; height: 34px !important; flex-shrink: 0 !important; }
  .member-avatar { width: 34px !important; height: 34px !important; flex-shrink: 0 !important; }
  .profile-avatar { flex-shrink: 0 !important; }
  .fdm-avatar { flex-shrink: 0 !important; }

  /* Floating DM widget mobilde de göster (küçük) */
}

/* ===== MÜZİK SİSTEMİ ===== */
.music-table { display: flex; flex-direction: column; gap: 2px; }
.music-table-header {
  display: flex; align-items: center; padding: 8px 14px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.music-row {
  display: flex; align-items: center; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; transition: background 0.15s; gap: 12px;
}
.music-row:hover { background: var(--bg-card2); }
.music-row:hover .music-play-mini { opacity: 1; }
.music-num { width: 30px; font-size: 13px; color: var(--text-muted); text-align: center; flex-shrink: 0; }
.music-info { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.music-cover-wrap { position: relative; flex-shrink: 0; }
.music-cover { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block; }
.music-cover-ph { width: 44px; height: 44px; border-radius: 6px; background: var(--bg-card2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 16px; }
.music-play-mini {
  position: absolute; inset: 0; border-radius: 6px;
  background: rgba(0,0,0,0.6); border: none; color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; cursor: pointer;
}
.music-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { font-size: 12px; color: var(--text-secondary); }
.music-dist { width: 160px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-date { width: 120px; font-size: 12px; color: var(--text-muted); }
.music-plays { width: 60px; font-size: 12px; color: var(--text-muted); }

/* DETAIL */

/* GLOBAL PLAYER */
#global-music-player {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 8000;
  background: var(--bg-secondary); border-top: 1px solid rgba(189,162,117,0.2);
  backdrop-filter: blur(12px); display: none;
}
.gplayer-inner { display: flex; align-items: center; padding: 8px 20px; gap: 16px; max-width: 1200px; margin: 0 auto; }
.gplayer-info { display: flex; align-items: center; gap: 10px; min-width: 200px; flex: 0 0 220px; }
.gplayer-cover { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.gplayer-cover-ph { width: 44px; height: 44px; border-radius: 6px; background: var(--bg-card2); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.gplayer-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.gplayer-artist { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.gplayer-controls { display: flex; align-items: center; gap: 8px; }
.gplayer-btn { background: none; border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 50%; transition: color 0.15s; }
.gplayer-btn:hover { color: var(--text-primary); }
.gplayer-play { background: var(--accent-red); color: #fff !important; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.gplayer-progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.gplayer-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; min-width: 32px; }
.gplayer-bar-wrap { flex: 1; position: relative; }
.gplayer-bar-bg { height: 4px; background: var(--border); border-radius: 4px; position: relative; }
.gplayer-bar-fill { height: 100%; background: var(--accent-red); border-radius: 4px; transition: width 0.1s; }
.gplayer-seek { position: absolute; top: 50%; left: 0; width: 100%; transform: translateY(-50%); opacity: 0; cursor: pointer; height: 16px; margin: 0; padding: 0; }
.gplayer-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 6px; margin-left: 8px; }
.gplayer-close:hover { color: var(--text-primary); }
.gplayer-vol-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gplayer-vol-btn { background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer; padding: 4px; }
.gplayer-vol-btn:hover { color: var(--text-primary); }
.gplayer-vol-slider { -webkit-appearance: none; appearance: none; width: 72px; height: 4px; border-radius: 4px; background: var(--border); outline: none; cursor: pointer; }
.gplayer-vol-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-red); cursor: pointer; }
.gplayer-vol-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-red); cursor: pointer; border: none; }

/* Mobil müzik */
@media (max-width: 768px) {
  .music-detail-header { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .music-detail-cover, .music-detail-cover-ph { width: 160px; height: 160px; }
  .music-detail-title { font-size: 22px; }
  .music-detail-artist { font-size: 15px; }
  .music-dist, .col-dist { display: none !important; }
  .music-date { width: 80px; }
  .gplayer-inner { padding: 6px 10px; gap: 8px; }
  .gplayer-info { min-width: 0; flex: 0 0 120px; }
  .gplayer-title { max-width: 100px; font-size: 11px; }
  .gplayer-artist { max-width: 100px; }
  .gplayer-btn:not(.gplayer-play):not(#gp-close) { display: none; }
  .gplayer-vol-wrap { display: none; }
  #global-music-player { bottom: 56px; } /* bottom bar yüksekliği */
}


/* ===== MOBİL DÜZELTME - ÇAKIŞAN KURALLARI GİDER ===== */

/* Avatar ve sabit boyutlu elemanlar max-width:100% kuralından muaf */
.nav-avatar, .comment-avatar, .chat-msg-avatar, .fdm-avatar,
.avatar-sm, .avatar-md, .member-avatar, .profile-avatar,
.profile-avatar-placeholder, .music-cover, .gplayer-cover,
.gplayer-cover-ph, .music-cover-ph {
  max-width: unset !important;
}

/* ebook-toolbar butonları tüm genişliği almasın */
@media (max-width: 768px) {
  .ebook-toolbar button { width: auto !important; flex: 0 0 auto !important; }
  .ebook-nav-btn { width: auto !important; flex: 1 !important; max-width: 48% !important; }
  .ebook-nav { gap: 8px !important; }

  /* forum-action-btn full width olmamalı - wrap etsin */
  .forum-action-btn { width: auto !important; flex-shrink: 0 !important; }
  .forum-actions { flex-wrap: wrap !important; gap: 8px !important; }

  /* btn ellipsis sadece flex olmayanlarda sorun çıkarıyor */
  .btn { overflow: visible !important; text-overflow: clip !important; }

  /* kitap grid: 2 kolon küçük ekranda daha iyi */
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

  /* Müzik listesi mobil - sütunları gizle */
  .music-table-header { display: none !important; }
  .music-row { padding: 8px 10px; gap: 8px; }
  .music-num { width: 22px; font-size: 12px; }
  .music-plays { display: none !important; }
  .music-date { display: none !important; }

  /* DM layout düzeltme */
  .dm-layout { height: calc(100vh - 60px - 60px); }
  .dm-sidebar { max-height: 350px; }
  .dm-chat { height: 100%; min-height: 260px; }

  /* Modal tam genişlik + bottom sheet */
  .modal { border-radius: 20px 20px 0 0 !important; max-width: 100% !important; }

  /* Video player mobil */
  .video-player-card { grid-template-columns: 1fr !important; }
  .video-ad-overlay { font-size: 11px !important; padding: 8px 10px !important; min-width: 120px !important; }

  /* Profil stat sayıları taşmasın */
  .profile-stats { gap: 12px !important; flex-wrap: wrap !important; justify-content: center !important; }
  .profile-stat-num { font-size: 16px !important; }

  /* Section header flex wrap */
  .section-header { flex-wrap: wrap; gap: 8px; }

  /* Footer mobil */
  #site-footer { margin-bottom: 60px; }

  /* Şarkı kartı grid */
  .grid-2 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
}

@media (max-width: 480px) {
  /* Çok küçük ekranlarda tek kolon */
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  
  /* Müzik detay header */
  .music-detail-header { gap: 12px; }
  .music-detail-cover, .music-detail-cover-ph { width: 140px !important; height: 140px !important; }

  /* Profil avatar küçült */
  .profile-avatar, .profile-avatar-placeholder { width: 70px !important; height: 70px !important; font-size: 28px !important; }
  .profile-username { font-size: 16px !important; }

  /* Ebook nav butonlar yan yana sığsın */
  .ebook-nav-btn { padding: 8px 10px !important; font-size: 12px !important; }
  .ebook-nav-btn span:not(.sr-only) { display: none; }
}

/* Nav profil resmi link */
.nav-avatar-link { display:flex;align-items:center;text-decoration:none; }
.nav-avatar-link:hover .nav-avatar { box-shadow:0 0 0 2px var(--accent-red); }

/* ===== ŞARKI DETAY SAYFASI ===== */
.song-detail-page { max-width:960px; margin:0 auto; padding:24px 16px 60px; }
.song-detail-hero { display:flex; gap:36px; align-items:flex-start; background:var(--bg-card); border:1px solid var(--border); border-radius:20px; padding:32px; margin-bottom:24px; }
.song-detail-cover-wrap { flex-shrink:0; }
.song-detail-cover { width:240px; height:240px; border-radius:16px; object-fit:cover; box-shadow:0 12px 48px rgba(0,0,0,0.55); display:block; }
.song-detail-cover-ph { width:240px; height:240px; border-radius:16px; background:linear-gradient(135deg,var(--bg-card2),var(--bg-card)); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:64px; color:var(--text-muted); }
.song-detail-meta-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:10px; }
.song-detail-type { font-size:11px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--accent-red2); }
.song-detail-title { font-size:30px; font-weight:900; line-height:1.15; word-break:break-word; color:var(--text-primary); }
.song-detail-artist { font-size:17px; color:var(--text-secondary); font-weight:500; }
.song-detail-info-row { display:flex; flex-wrap:wrap; gap:8px; }
.song-detail-tag { background:var(--bg-card2); border:1px solid var(--border); border-radius:20px; padding:3px 12px; font-size:12px; color:var(--text-muted); display:flex; align-items:center; gap:5px; }

/* Player */
.song-detail-player { background:var(--bg-card2); border:1px solid var(--border); border-radius:14px; padding:18px 20px; }
.sdp-top-row { display:flex; align-items:center; gap:12px; }
.sdp-play-btn { width:46px; height:46px; border-radius:50%; background:var(--accent-red); border:none; color:#fff; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:transform 0.1s,filter 0.1s; }
.sdp-play-btn:hover { filter:brightness(1.15); transform:scale(1.05); }
.sdp-progress-wrap { flex:1; display:flex; align-items:center; gap:8px; min-width:0; }
.sdp-time { font-size:11px; color:var(--text-muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
.sdp-bar-bg { flex:1; height:5px; background:rgba(255,255,255,0.1); border-radius:5px; position:relative; cursor:pointer; }
.sdp-bar-fill { height:100%; background:var(--accent-red); border-radius:5px; pointer-events:none; transition:width 0.1s; }
.sdp-seek { position:absolute; top:50%; left:0; width:100%; transform:translateY(-50%); opacity:0; cursor:pointer; height:18px; margin:0; padding:0; }
.sdp-vol-wrap { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.sdp-vol-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:14px; padding:4px; display:flex; align-items:center; }
.sdp-vol-slider { -webkit-appearance:none; appearance:none; width:80px; height:4px; border-radius:4px; background:var(--border); outline:none; cursor:pointer; }
.sdp-vol-slider::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:12px; height:12px; border-radius:50%; background:var(--accent-red); cursor:pointer; }
.sdp-vol-slider::-moz-range-thumb { width:12px; height:12px; border-radius:50%; background:var(--accent-red); cursor:pointer; border:none; }

.song-detail-actions-row { display:flex; gap:8px; flex-wrap:wrap; }
.song-detail-uploader { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-muted); }
.song-detail-uploader-link { display:flex; align-items:center; gap:5px; color:var(--text-secondary); text-decoration:none; font-weight:500; }
.song-detail-uploader-link:hover { color:var(--accent-red2); }
.song-share-note { background:rgba(189,162,117,0.06); border:1px solid rgba(189,162,117,0.15); border-radius:10px; padding:10px 14px; font-size:13px; color:var(--text-secondary); display:flex; align-items:flex-start; gap:8px; }
.song-share-note i { color:var(--accent-red2); margin-top:2px; flex-shrink:0; }
.song-lyrics-section { background:var(--bg-card); border:1px solid var(--border); border-radius:16px; padding:28px 32px; }
.song-lyrics-title { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--text-muted); margin-bottom:20px; display:flex; align-items:center; gap:8px; }
.song-lyrics-text { font-size:15px; line-height:2.1; color:var(--text-secondary); white-space:pre-wrap; font-family:'Georgia',serif; }

/* Responsive */
@media (max-width:680px) {
  .song-detail-hero { flex-direction:column; align-items:center; padding:20px 16px; gap:20px; text-align:center; }
  .song-detail-cover, .song-detail-cover-ph { width:180px; height:180px; }
  .song-detail-title { font-size:22px; }
  .song-detail-info-row { justify-content:center; }
  .song-detail-actions-row { justify-content:center; }
  .sdp-vol-wrap { display:none; }
  .song-lyrics-section { padding:20px 16px; }
}

/* ===== ARKADAŞLAR GRID ===== */
.friends-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) {
  .friends-page-grid { grid-template-columns: 1fr; gap: 16px; }
  /* Arkadaş kartı adı taşmasın */
  .friend-card .card-body, .friend-card { overflow: hidden; }
  .friend-card [style*="flex:1"] { min-width: 0; overflow: hidden; }
  .friend-card a, .friend-card div { word-break: break-word; overflow-wrap: break-word; }
}

/* ===== BİLDİRİMLER SAYFASI ===== */
.notif-page-item { transition: background 0.15s; }
.notif-page-item:hover { background: var(--bg-hover) !important; }
.notif-page-unread { background: rgba(189,162,117,0.06) !important; border-left: 3px solid var(--accent-red) !important; }

/* ===== MOBİL PAGE-HEADER TAŞMA DÜZELTMESİ ===== */
@media (max-width: 768px) {
  /* Inline style'ları override et */
  .page-header { flex-direction: column !important; align-items: flex-start !important; justify-content: flex-start !important; flex-wrap: wrap !important; gap: 10px !important; }
  .page-header > * { max-width: 100% !important; flex-shrink: 1 !important; }
  .page-header > div[style] { width: 100% !important; }
  /* Butonlar sola yaslanmış grupla */
  .page-header > div > .btn,
  .page-header > div[style*="display:flex"] { flex-wrap: wrap !important; gap: 8px !important; }
  /* Bildirim dropdown mobilde gizle */
  #notif-btn-wrap .dropdown-menu { display: none !important; }
}

/* ===== PLAYLİST STİLLERİ ===== */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 600px) { .pl-grid { grid-template-columns: 1fr; } }

.pl-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.pl-card:hover { border-color: var(--border-hover); box-shadow: var(--glow); }
.pl-card-icon {
  width: 52px; height: 52px; border-radius: 10px;
  background: var(--grad-red);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; flex-shrink: 0;
}
.pl-card-body { flex: 1; min-width: 0; }
.pl-card-name { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pl-card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Playlist songs table */
.pl-songs-table { display: flex; flex-direction: column; gap: 2px; }
.pl-song-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: grab;
}
.pl-song-row:hover { background: var(--bg-hover); border-color: var(--border); }
.pl-song-row.pl-dragging { opacity: 0.4; border-color: var(--accent-red); }
.pl-song-row.pl-drag-over { border-color: var(--accent-red); background: var(--bg-active); }
.pl-drag-handle { color: var(--text-muted); font-size: 13px; cursor: grab; padding: 0 4px; opacity: 0.5; }
.pl-song-row:hover .pl-drag-handle { opacity: 1; }
.pl-song-num { width: 24px; text-align: center; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.pl-song-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

/* Add to playlist button on music list */
.btn-pl-add {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 7px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-pl-add:hover { color: var(--accent-red2); border-color: var(--accent-red2); background: var(--bg-active); }

/* Add-to-playlist dropdown */
.pl-add-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* Playlist search modal row */
.pl-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.pl-search-row:hover { background: var(--bg-hover); }
.pl-search-row-added { opacity: 0.6; }

/* Global player: mode buttons (shuffle, repeat) */
.gplayer-mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.gplayer-mode-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.gplayer-mode-btn.active { color: var(--accent-red2); }

@media (max-width: 600px) {
  .gplayer-mode-btn { display: none; }
  .gplayer-mode-btn#gp-shuffle, .gplayer-mode-btn#gp-repeat { display: inline-block; font-size: 11px; padding: 4px 6px; }
}
