/* ==========================================================================
   NBOX FLIPBOOK (DİJİTAL KİTAP ÇEVİRME) STİLLERİ - LIGHT THEME
   Modern, ferah, akıcı ve responsive tasarım
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --primary: #1e8782;
  --primary-light: #2da19c;
  --primary-dark: #14615d;
  --primary-soft: #eaf6f5;
  
  --bg-app: #f4f6f8;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --shadow-book: 0 20px 45px -10px rgba(15, 23, 42, 0.16), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-floating: 0 10px 30px -5px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
}

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

body.flipbook-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   ÜST HEADER (LOGO ALANI & BUTONLAR)
   ========================================================================== */
.flipbook-header {
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Logo Alanı (WebP Optimize Slot) */
.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-slot-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  min-width: 110px;
}

/* Kullanıcının ekleyeceği veya varsayılan logo */
.site-logo {
  max-height: 40px;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

.header-catalog-title {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  padding-left: 14px;
}

.catalog-main-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.catalog-sub-badge {
  font-size: 0.725rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-contact {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(30, 135, 130, 0.25);
}
.btn-header-contact:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-header-pdf {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-header-pdf:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary-light);
}

/* ==========================================================================
   ANA KİTAP SAHNESİ (FLIPBOOK STAGE)
   ========================================================================== */
.flipbook-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  overflow: hidden;
  background: radial-gradient(circle at center, #ffffff 0%, #edf1f5 100%);
}

.zoom-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  will-change: transform;
}

.flipbook-stage.is-zoomed {
  cursor: grab;
}

.flipbook-stage.is-zoomed.is-panning {
  cursor: grabbing !important;
}

.flipbook-stage.is-zoomed .zoom-container {
  cursor: grab;
}

.flipbook-stage.is-zoomed.is-panning .zoom-container {
  cursor: grabbing !important;
}

/* Zoom yapıldığında sayfa çevirme swipe'ını engelle, sadece pan'e izin ver */
.flipbook-stage.is-zoomed .stf__parent {
  pointer-events: none;
}
.flipbook-stage.is-zoomed .zoom-container {
  pointer-events: auto;
}

/* StPageFlip Kitap Kabı */
.flip-book {
  box-shadow: var(--shadow-book);
  border-radius: 4px;
  background-color: #ffffff;
  overflow: visible !important;
  margin: 0 auto;
}

.page {
  background-color: #ffffff;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.02);
}

/* Sayfa Görselleri - Asla En-Boy Oranı Bozulamaz (Strict Aspect Ratio) */
.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  background-color: #ffffff;
}

/* Kitap Sırtı / Ortası Gölgesi */
.page.--left {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.page.--right {
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

/* Yan Sayfa Çevirme Okları */
.nav-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}

.nav-arrow-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-50%) scale(1.08);
}

.nav-arrow-btn.prev {
  left: 16px;
}

.nav-arrow-btn.next {
  right: 16px;
}

.nav-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   ALT KONTROL ÇUBUĞU (GLASSMORPHISM TOOLBAR)
   ========================================================================== */
.flipbook-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  padding: 6px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-floating);
  z-index: 80;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}

.tool-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.tool-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.tool-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tool-separator {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 3px;
  flex-shrink: 0;
}

.page-indicator-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0 4px;
  flex-shrink: 0;
}

.page-select {
  max-width: 220px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-select:focus {
  border-color: var(--primary);
}

/* Mobil için Kompakt Sayfa Rozeti */
.mobile-page-badge {
  display: none;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(30, 135, 130, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   KÜÇÜK SAYFA ÖNİZLEME ÇEKMECESİ (THUMBNAILS DRAWER)
   ========================================================================== */
.thumbnails-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 90;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.08);
}

.thumbnails-drawer.open {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drawer-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.drawer-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
}
.drawer-close-btn:hover {
  color: var(--text-main);
  background: #f1f5f9;
}

.thumbnails-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

.thumb-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.thumb-card:hover {
  transform: translateY(-2px);
}

.thumb-img {
  width: 72px;
  height: 102px;
  border-radius: 4px;
  border: 2px solid var(--border-color);
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.thumb-card.active .thumb-img {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 135, 130, 0.3);
}

.thumb-num {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==========================================================================
   YÜKLEME VE İPUCU ROZETİ
   ========================================================================== */
.flipbook-tip {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.725rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 60;
  animation: fadeOutTip 3.2s forwards;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes fadeOutTip {
  0% { opacity: 0; transform: translate(-50%, -6px); }
  15% { opacity: 0.95; transform: translate(-50%, 0); }
  70% { opacity: 0.95; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -8px); display: none; }
}

/* ==========================================================================
   RESPONSIVE UYUMLULUK
   ========================================================================== */
@media (max-width: 900px) {
  .flipbook-header {
    padding: 0 16px;
  }
  .header-catalog-title {
    display: none;
  }
  .nav-arrow-btn {
    width: 42px;
    height: 42px;
  }
  .nav-arrow-btn.prev {
    left: 10px;
  }
  .nav-arrow-btn.next {
    right: 10px;
  }
}

@media (max-width: 680px) {
  .flipbook-stage {
    padding: 8px 8px 75px 8px;
  }
  
  /* Mobilde masaüstü geniş select gizlenir, kompakt hap rozet açılır */
  .page-indicator-box {
    display: none;
  }
  .mobile-page-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  
  /* Mobilde kalabalık yapan ilk/son ve zoom reset gizlenir */
  #btnFirst, #btnLast, #btnZoomReset, .tool-separator:first-of-type {
    display: none;
  }
  
  .flipbook-toolbar {
    bottom: 10px;
    padding: 3px 8px;
    gap: 3px;
    max-width: 96vw;
  }
  
  .tool-btn {
    width: 34px;
    height: 34px;
  }
  
  .btn-header span.text {
    display: none;
  }
  .btn-header {
    padding: 7px 10px;
  }
  
  .nav-arrow-btn {
    display: none; /* Mobilde parmakla doğrudan dokunarak/kaydırarak çevrilir */
  }
}
