/* ============================================================================
   MAHFUZ — Modern PDF Platformu Tasarım Sistemi, Animasyonlar ve PDF Canvas CSS
   ============================================================================ */

@keyframes mahfuzFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mahfuzFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-5px);
  }
}

.animate-fade-up {
  animation: mahfuzFadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fade-up-delay-1 {
  animation: mahfuzFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

.animate-fade-up-delay-2 {
  animation: mahfuzFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

.animate-float-slow {
  animation: mahfuzFloat 4s ease-in-out infinite;
}

/* İnce Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(225, 29, 72, 0.75);
}

/* PDF Okuyucu Sahnesi */
.mahfuz-reader-stage {
  position: relative;
  padding: 24px;
  overflow-y: auto;
  overflow-x: auto;
  scroll-behavior: smooth;
}

.mahfuz-pages-stream {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
}

.mahfuz-pages-stream.dual-spread-mode {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  align-items: start;
  gap: 24px;
}

.mahfuz-pdf-page-wrapper {
  position: relative;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.25s ease;
}

.mahfuz-pdf-page-wrapper:hover {
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(225, 29, 72, 0.35);
}

.mahfuz-pdf-page-wrapper.pdf-night-invert .mahfuz-pdf-render-canvas {
  filter: invert(0.92) hue-rotate(180deg) contrast(1.04);
}

.mahfuz-pdf-render-canvas {
  display: block;
  position: relative;
  z-index: 1;
}

.mahfuz-highlight-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mahfuz-annotation-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.mahfuz-annotation-canvas.drawing-active {
  z-index: 12;
  pointer-events: auto;
  cursor: crosshair;
}

.mahfuz-pdf-text-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  line-height: 1.0;
  user-select: text;
  -webkit-user-select: text;
  pointer-events: auto;
  cursor: text;
}

.mahfuz-pdf-text-layer.drawing-blocked {
  pointer-events: none;
  user-select: none;
}

.mahfuz-pdf-text-layer span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  user-select: text;
  -webkit-user-select: text;
}

.mahfuz-pdf-text-layer span::selection {
  background: rgba(250, 204, 21, 0.48);
  color: transparent;
}

.mahfuz-marquee-selection {
  position: absolute;
  border: 1.5px dashed #e11d48;
  background: rgba(225, 29, 72, 0.14);
  pointer-events: none;
  z-index: 15;
}

.mahfuz-sticky-layer {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
}

.mahfuz-sticky-pin {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mahfuz-sticky-pin:hover {
  transform: translate(-50%, -50%) scale(1.18);
}

.mahfuz-secret-blur {
  filter: blur(5px);
  user-select: none;
  transition: filter 0.25s ease;
}

.mahfuz-secret-blur.unlocked {
  filter: none;
  user-select: text;
}


/* Taşınabilir / Yüzen Sol Kalem ve Araçlar Menüsü */
.mahfuz-floating-toolbar {
  position: absolute;
  z-index: 35;
  touch-action: none;
  user-select: none;
  transition: box-shadow 0.2s ease, opacity 0.18s ease;
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.mahfuz-floating-toolbar.is-dragging {
  cursor: grabbing !important;
  box-shadow: 0 28px 60px -10px rgba(0, 0, 0, 0.45), 0 0 0 1.5px rgba(59, 130, 246, 0.6);
  opacity: 0.96;
}

.mahfuz-toolbar-grip {
  cursor: grab;
}

.mahfuz-toolbar-grip:active {
  cursor: grabbing;
}

.mahfuz-floating-toolbar.is-minimized {
  width: auto !important;
  min-width: 0 !important;
}

.mahfuz-floating-toolbar.is-minimized #floatingToolbarContent {
  display: none !important;
}

.mahfuz-floating-toolbar:not(.is-minimized) #floatingToolbarMini {
  display: none !important;
}

.mahfuz-tool-btn {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.mahfuz-tool-btn.active {
  background-color: #18181b !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.dark .mahfuz-tool-btn.active {
  background-color: #f4f4f5 !important;
  color: #09090b !important;
}

.mahfuz-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.mahfuz-color-swatch:hover {
  transform: scale(1.22);
}

.mahfuz-color-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #3b82f6;
}

.dark .mahfuz-color-swatch.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #121216, 0 0 0 4px #60a5fa;
}

.mahfuz-size-chip {
  transition: all 0.12s ease;
  cursor: pointer;
}

.mahfuz-size-chip.active {
  background-color: #18181b;
  color: #ffffff;
}

.dark .mahfuz-size-chip.active {
  background-color: #f4f4f5;
  color: #09090b;
}

.mahfuz-preview-disc-box {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.15) 1px, transparent 1px);
  background-size: 6px 6px;
  border-radius: 8px;
}

@media print {
  .no-print {
    display: none !important;
  }
  .drm-protected-no-print {
    display: none !important;
  }
}
