/* Dergimiz Global, Flipbook & Interactive Studio Styles */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,400;1,600&family=Space+Grotesk:wght@500;600;700&family=Caveat:wght@600;700&family=Merriweather:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --primary-color: #4f46e5;
  --spine-shadow: rgba(0, 0, 0, 0.14);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-cinzel { font-family: 'Cinzel', serif; }
.font-serif { font-family: 'Playfair Display', serif; }
.font-display { font-family: 'Space Grotesk', sans-serif; }
.font-handwriting { font-family: 'Caveat', cursive; }
.font-book { font-family: 'Merriweather', serif; }

/* 3D Dergi Görünümü */
.magazine-spread {
  perspective: 2400px;
  transform-style: preserve-3d;
}

.magazine-page {
  aspect-ratio: 1 / 1.414; /* Standart A4 Dergi Oranı */
  box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.4), 0 10px 20px -8px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
}

/* Sayfa Kenar & Cilt Payları */
.page-left {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  background: linear-gradient(to right, #ffffff 93%, #f8fafc 98%, #e2e8f0 100%);
  border-right: 1px solid #cbd5e1;
}

.page-right {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
  background: linear-gradient(to left, #ffffff 93%, #f8fafc 98%, #e2e8f0 100%);
  border-left: 1px solid #cbd5e1;
}

.page-single {
  border-radius: 14px;
  box-shadow: 0 30px 50px -15px rgba(0, 0, 0, 0.45);
}

/* 3D Bükülme / Page Curl Efekti */
.page-curl-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.06) 50%, rgba(255,255,255,0.9) 60%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
  z-index: 30;
  border-bottom-right-radius: 12px;
}

.page-left .page-curl-corner {
  right: auto;
  left: 0;
  background: linear-gradient(225deg, transparent 50%, rgba(0,0,0,0.06) 50%, rgba(255,255,255,0.9) 60%, rgba(0,0,0,0.15) 100%);
  border-bottom-left-radius: 12px;
}

/* Gerçekçi Orta Cilt Gölgeleri */
.spine-shadow-left {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 45px;
  background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,0.11));
  pointer-events: none;
  z-index: 28;
}

.spine-shadow-right {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 45px;
  background: linear-gradient(to left, rgba(0,0,0,0), rgba(0,0,0,0.11));
  pointer-events: none;
  z-index: 28;
}

/* 3D Sayfa Çevirme Animasyonları */
@keyframes pageCurlTurn {
  0% {
    opacity: 0.3;
    transform: scale(0.97) rotateY(6deg);
    filter: brightness(0.9);
  }
  50% {
    transform: scale(0.99) rotateY(2deg);
    filter: brightness(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    filter: brightness(1);
  }
}

.animate-curl {
  animation: pageCurlTurn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Akıllı Mizanpaj Izgarası (Grid & Snapping Rehberleri) */
.page-grid-overlay {
  position: absolute;
  inset: 16px;
  pointer-events: none;
  z-index: 20;
  background-image: 
    linear-gradient(to right, rgba(99, 102, 241, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px dashed rgba(99, 102, 241, 0.25);
  border-radius: 8px;
}

/* SERBEST YERLEŞİM KATMANI ELEMANLARI (CANVAS ELEMENTS) */
.canvas-element {
  position: absolute;
  transition: box-shadow 0.15s ease;
  box-sizing: border-box;
}

.canvas-element.canvas-text-element {
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
}

.canvas-element.canvas-media-element {
  user-select: none;
  cursor: grab;
}

.canvas-element.canvas-media-element:active {
  cursor: grabbing;
}

.canvas-element.element-selected {
  outline: 2px solid #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3), 0 10px 20px -5px rgba(0, 0, 0, 0.2);
  z-index: 40 !important;
}

/* ŞABLON İÇİ DOĞRUDAN METİN DÜZENLEME & BOYUT/KONUM/AÇI KONTROLÜ */
.inline-editable-text {
  position: relative;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text;
  transition: background-color 0.15s ease, outline 0.15s ease;
  border-radius: 4px;
}

.inline-editable-text:hover {
  outline: 1.5px dashed rgba(37, 99, 235, 0.85) !important;
  background-color: rgba(37, 99, 235, 0.06) !important;
}

.inline-editable-text:focus,
.inline-selected {
  outline: 2px solid #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.22) !important;
  z-index: 45 !important;
  overflow: visible !important;
}

/* ŞABLON İÇİ FOTOĞRAFLAR: TAŞIMA, BOYUTLANDIRMA, DÖNDÜRME & SAĞ ÜST DEĞİŞTİR BUTONU */
.template-image-container {
  position: relative;
  cursor: grab;
  user-select: none;
}

.template-image-container:active {
  cursor: grabbing;
}

.template-image-container:hover {
  outline: 2px dashed #2563eb;
}

.template-image-container .img-change-badge,
.canvas-media-element .img-change-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  inset: auto;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
  cursor: pointer;
  z-index: 55;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.template-image-container:hover .img-change-badge,
.template-image-container.inline-selected .img-change-badge,
.canvas-media-element:hover .img-change-badge,
.canvas-media-element.element-selected .img-change-badge {
  opacity: 1;
}

.img-change-badge:hover {
  background: #2563eb !important;
  transform: scale(1.04);
}

/* Taşıma Kulakçığı (Move Handle - Metin ve Görseller İçin) */
.move-handle {
  position: absolute;
  top: -24px;
  left: 0;
  height: 20px;
  padding: 0 7px;
  background-color: #2563eb;
  color: #ffffff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: move;
  z-index: 54;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  user-select: none;
  white-space: nowrap;
}
.move-handle:hover {
  background-color: #1d4ed8;
}

/* 8 Noktalı Boyutlandırma Kulakçıkları */
.resize-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background-color: #ffffff;
  border: 2px solid #4f46e5;
  border-radius: 2px;
  z-index: 45;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.handle-n { top: -5px; left: calc(50% - 4px); cursor: ns-resize; }
.handle-s { bottom: -5px; left: calc(50% - 4px); cursor: ns-resize; }
.handle-e { right: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.handle-w { left: -5px; top: calc(50% - 4px); cursor: ew-resize; }

/* Döndürme Kulakçığı (Rotation Handle) */
.rotate-handle {
  position: absolute;
  top: -24px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  background-color: #4f46e5;
  border: 2px solid #ffffff;
  border-radius: 50%;
  cursor: grab;
  z-index: 46;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
.rotate-handle::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: calc(50% - 1px);
  width: 2px;
  height: 9px;
  background-color: #4f46e5;
}

/* Zengin Tipografi Araç Çubuğu (Floating Toolbar) */
.rich-text-bar {
  position: absolute;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 15px 30px rgba(0,0,0,0.6);
  z-index: 60;
  backdrop-blur: 8px;
}

/* Video Konteyneri */
.magazine-video-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 15px 25px -5px rgba(0,0,0,0.3);
}

.magazine-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Çift Sayfa Yayılma (Spread Overlap) */
.spread-element {
  position: absolute;
  z-index: 35;
}

/* Kitaplık Kartı 3D Hover */
.book-cover-card {
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
}

.book-cover-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 35px -10px rgba(79, 70, 229, 0.3);
}

/* Özel Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* =========================================================
   FLIPHTML5 v2 STUDIO PRO ARAYÜZ & BİLEŞEN STİLLERİ
   ========================================================= */

/* Sol Dikey İkon Rayı */
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 54px;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.18s ease;
  cursor: pointer;
}
.rail-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.rail-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* Sol Panel Sayfa Minyatür (Thumbnail) Kartları & Hover 4 İkon (Görsel 1 & 10) */
.page-thumb-card {
  position: relative;
  border-radius: 12px;
  padding: 10px;
  background: #1e293b;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}
.page-thumb-card:hover {
  border-color: #60a5fa;
  background: #1e293b;
}
.page-thumb-card.active {
  background: rgba(37, 99, 235, 0.18);
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}
.page-thumb-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.page-thumb-card:hover .page-thumb-actions {
  opacity: 1;
  pointer-events: auto;
}
.thumb-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: all 0.15s ease;
}
.thumb-action-btn:hover {
  background: #2563eb;
  border-color: #60a5fa;
  transform: scale(1.08);
}
.thumb-action-btn.danger:hover {
  background: #e11d48;
  border-color: #fb7185;
}

/* FlipHTML5 v2 Mavi Seçim Çerçevesi ve Sol Alt Döndürme İkonu (Görsel 2 & 5) */
.canvas-element.element-selected {
  outline: 2px solid #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 10px 25px -5px rgba(0, 0, 0, 0.22) !important;
  z-index: 45 !important;
}
.resize-handle {
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 50%;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.rotate-handle {
  position: absolute;
  bottom: -28px;
  top: auto;
  left: -18px;
  width: 24px;
  height: 24px;
  background-color: #ffffff;
  color: #1e293b;
  border: 1.5px solid #cbd5e1;
  border-radius: 50%;
  cursor: grab;
  z-index: 52;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}
.rotate-handle:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.rotate-handle::after {
  display: none;
}

/* Yüzen Beyaz Hızlı Araç Çubuğu (Görsel 2) */
.floating-context-toolbar {
  position: fixed;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.28), 0 4px 10px -2px rgba(15, 23, 42, 0.12);
  z-index: 80;
  user-select: none;
}

/* Sıcak Nokta (Hotspot) Nabız Animasyonu (Görsel 1 & 9) */
@keyframes hotspotPulse {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); transform: scale(1); }
  70% { box-shadow: 0 0 0 12px rgba(244, 63, 94, 0); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); transform: scale(1); }
}
.hotspot-pulse {
  animation: hotspotPulse 1.8s infinite;
}

/* Modern Switch Toggle (Görsel 3 & 6) */
.studio-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.studio-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.studio-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .2s;
  border-radius: 20px;
}
.studio-switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
.studio-switch input:checked + .studio-switch-slider {
  background-color: #2563eb;
}
.studio-switch input:checked + .studio-switch-slider:before {
  transform: translateX(16px);
}

/* Pan (El ile Tuval Kaydırma) Modu */
.canvas-pan-mode {
  cursor: grab !important;
}
.canvas-pan-mode:active {
  cursor: grabbing !important;
}

/* ============================================================================
 * FAZ 3: 3D DERGİ OKUYUCU (ST-PAGE-FLIP) & KİNETİK TİPOGRAFİ
 * ============================================================================ */
.flipbook-root {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  background: transparent;
}

.flipbook-root .page {
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.06);
}

.flipbook-root .page.--left {
  border-right: 1px solid rgba(0, 0, 0, 0.12);
}

.flipbook-root .page.--right {
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.flipbook-page-canvas-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
}

/* Kinetik Tipografi & Canlı Görseller (Faz 3) */
.anim-typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.anim-fade-in {
  animation: readerFadeIn 0.8s ease-out forwards;
}

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

.anim-shimmer {
  background: linear-gradient(90deg, #d97706 0%, #fef08a 50%, #d97706 100%);
  background-size: 200% auto;
  color: transparent !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  animation: shimmerAnim 2.5s linear infinite;
}

@keyframes shimmerAnim {
  to { background-position: 200% center; }
}

.anim-pulse {
  animation: readerPulse 2s ease-in-out infinite;
}

@keyframes readerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}


