/* =====================================================================
   OKUMA DEFTERİ KATMANI – sadece defterle ilgili stiller
   ===================================================================== */
.jn-hidden { display: none !important; }
body.jn-lock { overflow: hidden; }

/* ---- Sağ alttaki defter düğmesi ---- */
.jn-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  display: none; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.jn-fab.jn-show { display: flex; }
.jn-fab img { width: 62px; height: auto; display: block; filter: drop-shadow(0 4px 8px rgba(80, 10, 15, .35)); transition: filter .25s ease; }
.jn-fab span { font: 600 11px 'Plus Jakarta Sans', sans-serif; color: #8b262a; background: rgba(255,255,255,.9); border-radius: 10px; padding: 1px 8px; }
.jn-fab:hover { transform: translateY(-8px); }
.jn-fab:hover img { filter: drop-shadow(0 0 10px rgba(255, 196, 120, .95)) drop-shadow(0 0 22px rgba(255, 120, 100, .55)) brightness(1.08); }

/* ---- Katman ---- */
.jn-overlay { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; }
.jn-backdrop { position: absolute; inset: 0; background: rgba(24, 8, 10, .78); backdrop-filter: blur(3px); }
.jn-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  border: none; background: #8b262a; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.jn-close:hover { background: #6d1d20; }

/* Kapalı defter */
.jn-closed { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.jn-closed img { height: min(68vh, 520px); width: auto; max-width: 86vw; cursor: pointer; filter: drop-shadow(0 18px 36px rgba(0,0,0,.55)); }
.jn-closed.jn-grow { animation: jnGrow .55s cubic-bezier(.2,.8,.2,1); transform-origin: right bottom; }
@keyframes jnGrow { from { transform: translate(38vw, 38vh) scale(.12); opacity: .2; } to { transform: none; opacity: 1; } }
.jn-open-btn {
  background: #8b262a; color: #fff; border: none; border-radius: 24px; padding: 12px 30px; font: 600 15px 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: background .2s, transform .2s;
}
.jn-open-btn:hover { background: #a02d32; transform: translateY(-2px); }

/* Açık defter */
.jn-wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100vw; }
.jn-wrap.jn-appear { animation: jnAppear .45s ease; }
@keyframes jnAppear { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.jn-book {
  box-sizing: border-box; width: min(96vw, calc((100vh - 130px) * 1.38)); padding: 1.7% 2%;
  background: linear-gradient(180deg, #a02c31, #7a1b1f); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,255,255,.08);
}
.jn-spread { position: relative; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1440 / 1022; perspective: 2600px; background: #f3e9d9; border-radius: 4px; overflow: visible; }
.jn-spread::after { /* ortadaki oluk gölgesi */
  content: ''; position: absolute; top: 0; bottom: 0; left: 46%; width: 8%; pointer-events: none; z-index: 6;
  background: linear-gradient(90deg, transparent, rgba(60,25,10,.22) 45%, rgba(60,25,10,.34) 50%, rgba(60,25,10,.22) 55%, transparent);
}
.jn-page { position: relative; overflow: hidden; background: #fbf6ec; }
.jn-pl { box-shadow: inset -2px 0 6px rgba(0,0,0,.08); }
.jn-pr { box-shadow: inset 2px 0 6px rgba(0,0,0,.08); }
.jn-page canvas, .jn-face canvas { display: block; width: 100%; height: 100%; }
.jn-spread.jn-fade .jn-page { opacity: 0; transition: opacity .14s; }
.jn-spread .jn-page { transition: opacity .14s; }

/* Tek sayfa görünümü (telefon / dik ekran) */
.jn-spread.jn-single { grid-template-columns: 1fr; aspect-ratio: 720 / 1022; }
.jn-spread.jn-single::after { display: none; }
.jn-spread.jn-single .jn-pr { display: none; }
.jn-book:has(.jn-single) { width: min(96vw, calc((100vh - 140px) * 0.70)); padding: 2.5%; }

/* Sayfa çevirme yaprağı */
.jn-leaf { position: absolute; top: 0; width: 50%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.45,.05,.35,1); z-index: 7; }
.jn-leaf-r { left: 50%; transform-origin: left center; }
.jn-leaf-l { left: 0; transform-origin: right center; }
.jn-leaf-r.jn-flip { transform: rotateY(-180deg); }
.jn-leaf-l.jn-flip { transform: rotateY(180deg); }
.jn-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fbf6ec; overflow: hidden; }
.jn-face.jn-back { transform: rotateY(180deg); }

/* Araç çubuğu */
.jn-toolbar { display: flex; align-items: center; gap: 12px; color: #fff; font: 500 13px 'Plus Jakarta Sans', sans-serif; }
.jn-toolbar button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 20px; min-width: 40px; height: 36px; padding: 0 14px; font-size: 20px; cursor: pointer; line-height: 1; }
.jn-toolbar button:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.jn-toolbar button:disabled { opacity: .35; cursor: default; }
.jn-toolbar .jn-pdf { font-size: 13px; font-weight: 600; margin-left: 10px; background: #8b262a; border-color: #b04a4f; }
.jn-ind { min-width: 84px; text-align: center; }

.jn-loading { position: absolute; z-index: 6; color: #fff; font: 600 15px 'Plus Jakarta Sans', sans-serif; background: rgba(0,0,0,.5); padding: 12px 22px; border-radius: 20px; }

@media (max-width: 640px) {
  .jn-fab img { width: 52px; }
  .jn-toolbar { gap: 8px; }
  .jn-toolbar .jn-pdf { margin-left: 4px; padding: 0 10px; }
  .jn-closed img { height: min(60vh, 420px); }
}

/* ---- Arama çubuğu düzeltmesi ----
   Genel input kuralı arama kutusunun içine ikinci bir çerçeve ve ekstra boşluk ekliyordu;
   burada kaldırılıyor ve yükseklik yandaki profil rozetiyle eşitleniyor. Diğer özellikler aynı. */
.search-container .search-input-wrapper { padding: 6px 14px; box-sizing: border-box; min-height: 36px; }
.search-container .search-input-wrapper input[type="text"] {
  border: none; padding: 0; border-radius: 0; background: transparent; width: 100%; font-size: 13px; line-height: 1.4; box-shadow: none;
}
.user-profile-badge { box-sizing: border-box; min-height: 36px; }

/* ---- Sol taraftaki sayfa şeridi (PowerPoint gibi) ---- */
.jn-thumbs {
  position: absolute; left: 12px; top: 58px; bottom: 64px; width: 96px; z-index: 4; overflow-y: auto; overflow-x: hidden;
  padding: 8px 8px 2px; background: rgba(255,255,255,.07); border-radius: 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent;
}
.jn-th { margin-bottom: 12px; cursor: pointer; text-align: center; color: #ecd9d9; font: 600 11px 'Plus Jakarta Sans', sans-serif; }
.jn-thc { border: 2px solid transparent; border-radius: 3px; background: #fbf6ec; aspect-ratio: 720 / 1022; overflow: hidden; transition: border-color .15s, transform .15s; }
.jn-thc canvas { display: block; width: 100%; height: 100%; }
.jn-th span { display: block; margin-top: 3px; }
.jn-th:hover .jn-thc { border-color: #fff; transform: scale(1.03); }
.jn-th.jn-on .jn-thc { border-color: #ff9aa2; box-shadow: 0 0 0 2px rgba(255,154,162,.45); }
.jn-th.jn-on span { color: #ff9aa2; }
.jn-toolbar .jn-tglth { display: none; }
@media (min-width: 761px) { .jn-book { width: min(calc(100vw - 260px), calc((100vh - 130px) * 1.38)); } }
@media (max-width: 760px) {
  .jn-thumbs { display: none; left: 0; top: calc(56px + env(safe-area-inset-top, 0px)); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 80px; border-radius: 0 12px 12px 0; background: rgba(24,8,10,.88); box-shadow: 4px 0 18px rgba(0,0,0,.35); }
  .jn-toolbar { position: relative; z-index: 6; }
  .jn-thumbs.jn-open { display: block; }
  .jn-toolbar .jn-tglth { display: inline-block; }
}

/* ---- Aylık plandan kitap çıkaran kırmızı eksi düğmesi ---- */
.btn-remove-plan {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1.5px solid #e3a5a8; background: #fff; color: #c1121f; cursor: pointer; flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.btn-remove-plan svg { stroke-width: 3; }
.btn-remove-plan:hover { background: #c1121f; border-color: #c1121f; color: #fff; transform: scale(1.12); box-shadow: 0 2px 8px rgba(193,18,31,.35); }
.btn-remove-plan:active { transform: scale(.9); box-shadow: none; }

/* ---- Sayfa yığını: kalın kitap görünümü ---- */
.jn-book { padding-left: 3.4% !important; padding-right: 3.4% !important; }
.jn-stack {
  position: absolute; top: 0.5%; bottom: 0.5%; width: 0; z-index: 1; transition: width .35s ease; pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.jn-stack-l {
  right: 100%; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(50,25,10,.38), rgba(50,25,10,0) 80%), repeating-linear-gradient(90deg, #f7f0e2 0 2px, #d9cdb6 2px 3px);
}
.jn-stack-r {
  left: 100%; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, rgba(50,25,10,0) 20%, rgba(50,25,10,.38)), repeating-linear-gradient(90deg, #d9cdb6 0 1px, #f7f0e2 1px 3px);
}
.jn-stack::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.14), transparent 8%, transparent 92%, rgba(0,0,0,.14)); }
@media (min-width: 761px) {
  .jn-book { width: min(calc(100vw - 260px), calc((100vh - 130px) * 1.4)); }
  .jn-overlay.jn-nothumbs .jn-thumbs { display: none; }
  .jn-overlay.jn-nothumbs .jn-book { width: min(calc(100vw - 90px), calc((100vh - 130px) * 1.4)); }
  .jn-toolbar .jn-tglth { display: inline-block; }
}
/* seçili sayfa: kırmızı çerçeve */
.jn-th.jn-on .jn-thc { border-color: #d81e2d; box-shadow: 0 0 0 2px rgba(216,30,45,.55), 0 0 10px rgba(216,30,45,.5); }
.jn-th.jn-on span { color: #ff8a93; }
