/* Mobil Uyumlu Yatay Kaydırmalı PDF Viewer CSS */
.pdf-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 99999;
  display: none;
  overflow: hidden;
}

.pdf-overlay.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pdf-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* PDF Header */
.pdf-header {
  height: 50px;
  padding: 0 16px;
  background-color: #f8f8f8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

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

.pdf-logo {
  height: 32px;
  width: auto;
}

.pdf-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-right: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Main content area - sidebar + canvas */
.pdf-main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Thumbnail Sidebar */
.pdf-sidebar {
  width: 180px;
  background-color: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-sidebar.hidden {
  display: none;
}

.pdf-thumbnail {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-height: 80px;
}

.pdf-thumbnail:hover {
  border-color: #999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.pdf-thumbnail.active {
  border-color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pdf-thumbnail canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
  background: white;
}

.pdf-thumbnail-number {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 11px;
  text-align: center;
  padding: 2px 0;
}

/* Toggle sidebar button */
.pdf-sidebar-toggle {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 60px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-left: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.pdf-sidebar-toggle:hover {
  background: #eee;
}

.pdf-sidebar-toggle svg {
  width: 16px;
  height: 16px;
  fill: #666;
  transition: transform 0.3s;
}

.pdf-sidebar-toggle.collapsed svg {
  transform: rotate(180deg);
}

/* Canvas Container - Yatay sayfa geçişi için */
.pdf-canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sayfalar wrapper - yatay yerleşim */
.pdf-pages-wrapper {
  height: 100%;
  display: flex;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Her sayfa container */
.pdf-page-container {
  min-width: 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  box-sizing: border-box;
}

/* Canvas elementi */
.pdf-page-canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: white;
  transition: transform 0.2s ease;
  transform-origin: center center;
  /* Yüksek çözünürlüklü render için image-rendering */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* PDF Control Bar */
.pdf-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  padding: 8px 16px;
  background-color: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  height: 60px;
}

/* Kontrol butonları */
.pdf-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.pdf-btn:hover:not(:disabled) {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.pdf-btn:active:not(:disabled) {
  transform: scale(0.95);
}

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

.pdf-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.pdf-btn.pdf-close {
  color: #dc3545;
  background: transparent;
}

.pdf-btn.pdf-close:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Küçük butonlar (zoom) */
.pdf-btn.pdf-zoom-in,
.pdf-btn.pdf-zoom-out {
  width: 35px;
  height: 35px;
}

.pdf-btn.pdf-zoom-in svg,
.pdf-btn.pdf-zoom-out svg {
  width: 20px;
  height: 20px;
}

/* Sayfa bilgisi */
.pdf-page-info {
  color: #333;
  font-size: 14px;
  font-weight: 500;
  padding: 0 10px;
  min-width: 100px;
  text-align: center;
}

/* Sayfa yükleniyor göstergesi */
.pdf-page-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(0, 0, 0, 0.5);
  font-size: 14px;
  gap: 10px;
}

.pdf-page-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  animation: pdf-spin 1s linear infinite;
}

/* Yükleniyor göstergesi */
.pdf-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  z-index: 10;
}

.pdf-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #333;
  animation: pdf-spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes pdf-spin {
  to { transform: rotate(360deg); }
}

/* Swipe ipucu */
.swipe-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  display: none;
  pointer-events: none;
  z-index: 100;
  animation: fadeInOut 3s ease;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  20%, 80% { opacity: 1; }
}

/* Mobil için optimizasyonlar */
@media (max-width: 768px) {
  .pdf-header {
    height: 45px;
    padding: 0 10px;
  }
  
  .pdf-logo {
    height: 24px;
  }
  
  .pdf-title {
    font-size: 14px;
  }
  
  .pdf-controls {
    height: 50px;
    padding: 5px 10px;
    gap: 8px;
  }
  
  .pdf-btn {
    width: 36px;
    height: 36px;
  }
  
  .pdf-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .pdf-page-info {
    font-size: 12px;
    min-width: 80px;
  }
  
  .pdf-page-container {
    padding: 5px;
  }
  
  .swipe-hint {
    font-size: 12px;
    padding: 8px 16px;
    bottom: 60px;
  }
  
  /* Mobilde sidebar gizle */
  .pdf-sidebar {
    display: none !important;
  }
  
  .pdf-sidebar-toggle {
    display: none !important;
  }
}

/* Çok küçük ekranlar için */
@media (max-width: 480px) {
  .pdf-controls {
    gap: 5px;
  }
  
  .pdf-btn {
    width: 32px;
    height: 32px;
  }
  
  .pdf-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Yayın kartına tıklanabilir görünüm */
.publication-card {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.publication-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.publication-card[data-pdf] {
  position: relative;
  cursor: pointer;
}

/* Pinch zoom desteği */
.pdf-page-container.zooming {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pdf-page-canvas.zoomed {
  cursor: grab;
}

.pdf-page-canvas.zoomed:active {
  cursor: grabbing;
}

/* Touch cihazlar için özel ayarlar */
@media (hover: none) and (pointer: coarse) {
  .pdf-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: none;
  }
  
  .pdf-btn:active:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
  }
}

/* Landscape mod için ayarlar */
@media (orientation: landscape) and (max-height: 500px) {
  .pdf-header {
    height: 40px;
  }
  
  .pdf-controls {
    height: 45px;
    padding: 3px 10px;
  }
  
  .pdf-btn {
    width: 32px;
    height: 32px;
  }
  
  .pdf-title {
    font-size: 13px;
  }
  
  .pdf-page-info {
    font-size: 11px;
  }
}