/* =============================================
   Turkey PDF Viewer — Overlay & Preview Styles
   ============================================= */

#pdf-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 99999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

#pdf-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 35px;
  position: relative;
}

.pdf-page {
  position: relative;
  margin-bottom: 30px;
  background: #000000;
  padding: 5px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.pdf-loading-shell {
  min-height: 360px;
  align-items: center;
}

.pdf-loading-shell .pdf-shell-message {
  color: #ffffff;
  font-size: 16px;
}

/* ---- Preview Loader (image + spinner shown on open) ---- */

.pdf-preview-loader {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.pdf-preview-loader img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
  filter: blur(2px);
}

.pdf-preview-loader.sized img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
}

.pdf-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

/* ---- Spinner ---- */

.pdf-spinner {
  width: 64px;
  height: 64px;
  margin-bottom: 15px;
}

.pdf-spinner svg {
  width: 100%;
  height: 100%;
  animation: pdf-spin 1s linear infinite;
}

@keyframes pdf-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.pdf-loader-text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  margin-top: 15px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.pdf-loader-subtext {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  margin-top: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ---- Fade transitions ---- */

.pdf-preview-page.fade-out {
  animation: fade-out-preview 0.4s ease-out forwards;
}

@keyframes fade-out-preview {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.98); }
}

canvas {
  max-width: 100%;
  height: auto;
  display: block;
  background: #fff;
  animation: fade-in-canvas 0.5s ease-in;
}

@keyframes fade-in-canvas {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Header ---- */

#pdf-header {
  position: fixed;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10000;
}

/* ---- Icon helpers ---- */

.close-icon {
  position: relative;
  width: 36px;
  height: 36px;
}

.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 3px;
  background: currentColor;
  border-radius: 1.5px;
  transform-origin: center;
}

.close-icon::before { transform: translate(-50%, -50%) rotate(45deg); }
.close-icon::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.download-icon {
  width: 36px;
  height: 36px;
  position: relative;
}

.download-icon::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 18px;
  background: currentColor;
  border-radius: 1.5px;
}

.download-icon::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid currentColor;
}

.download-icon .base {
  position: absolute;
  bottom: 3px;
  left: 4px;
  right: 4px;
  height: 3px;
  background: currentColor;
  border-radius: 1.5px;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  .pdf-loader-text {
    font-size: 14px;
  }

  .pdf-spinner {
    width: 52px;
    height: 52px;
  }
}
