/* PDF Modal */
.pdf-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.pdf-modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pdf-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  color: white;
  cursor: pointer;
  z-index: 10001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: background 0.3s;
}

.pdf-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Flipbook Container */
.flipbook-container {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

/* Flipbook */
.flipbook {
  flex: 1;
  background: #f5f5f5;
  overflow: hidden;
  position: relative;
}

.flipbook .page {
  background: white;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.flipbook .page-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.flipbook .page-wrapper canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Loading and Error States */
.loading,
.error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #666;
  text-align: center;
}

.error {
  color: #e74c3c;
}

/* Flipbook Controls */
.flipbook-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--secondary-color);
  color: white;
  gap: 20px;
}

.flipbook-controls button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s;
  min-width: 120px;
}

.flipbook-controls button:hover:not(:disabled) {
  background: var(--primary-color);
}

.flipbook-controls button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
}

.flipbook-controls span {
  font-size: 16px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pdf-modal {
    padding: 10px;
  }

  .pdf-modal-content {
    border-radius: 4px;
  }

  .flipbook-container {
    height: 70vh;
    min-height: 400px;
  }

  .flipbook-controls {
    /* flex-direction: column; */
    gap: 10px;
    padding: 10px;
  }

  .flipbook-controls button {
    /* width: 100%; */
    min-width: auto;
  }

  .pdf-modal-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    font-size: 24px;
  }
}

/* Turn.js Custom Styles */
.turn-page {
  background-color: white !important;
}

.turn-page-shadow {
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0) 5%
  );
}

/* Flip Animation Hints */

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Hide animation hint after first interaction */
.flipbook.interacted::before {
  display: none;
}
/* Loading animation */
.loading {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Page transition */
.flipbook-page {
  transition: opacity 0.3s ease;
}

/* Navigation buttons styling */
.flipbook-controls button {
  transition: all 0.2s ease;
}

.flipbook-controls button:active {
  transform: scale(0.95);
}

/* Modal animation */
.pdf-modal {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pdf-modal-content {
  animation: slideUp 0.3s ease;
}

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

/* Responsive improvements */
@media (max-width: 768px) {
  .page-wrapper {
    padding: 0px !important;
  }

  .flipbook-controls button {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }
}

/* Swipe hint */
.swipe-hint {
  display: none;
}

@media (max-width: 768px) {
  .swipe-hint {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 10px;
    animation: fadeInOut 3s infinite;
  }
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* novi stilovi */

/* Poboljšani modal za PDF */
.pdf-modal-content {
  position: relative;
  width: 98%;
  height: 98%;
  margin: auto;
  top: 1%;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
}

/* Flipbook container */
.flipbook-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Flipbook area */
.flipbook {
  flex: 1;
  width: 100%;
  overflow: auto;
  position: relative;
  background: linear-gradient(45deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Page styles */
.flipbook-page {
  animation: fadeIn 0.5s ease;
}

.page-wrapper {
  transition: transform 0.3s ease;
}

.page-wrapper:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Navigation controls */
.flipbook-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--secondary-color);
  color: white;
  gap: 30px;
  flex-wrap: wrap;
}

.page-counter {
  font-size: 18px;
  font-weight: 600;
  color: #ecf0f1;
  min-width: 100px;
  text-align: center;
}

.nav-buttons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.nav-buttons button {
  background: #3498db;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-buttons button:hover:not(:disabled) {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-buttons button:disabled {
  background: #7f8c8d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .pdf-modal-content {
    width: 100%;
    height: 100%;
    top: 0;
    border-radius: 0;
  }

  .flipbook-controls {
    padding: 10px 15px;
    gap: 15px;
  }

  .page-counter {
    font-size: 16px;
    min-width: 80px;
  }

  .nav-buttons button {
    padding: 10px 15px;
    min-width: 110px;
    font-size: 14px;
  }

  /* .flipbook-page {
    padding: 10px;
  } */
}

/* Scrollbar styling */
.flipbook::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.flipbook::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.flipbook::-webkit-scrollbar-thumb {
  background: #3498db;
  border-radius: 4px;
}

.flipbook::-webkit-scrollbar-thumb:hover {
  background: #2980b9;
}

/* Zoom indicator */
.zoom-hint {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10002;
  animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loading animation */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s infinite;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.flipbook-page.slide-left {
  animation: slideInLeft 0.3s ease-out;
}

.flipbook-page.slide-right {
  animation: slideInRight 0.3s ease-out;
}

/* Indikator za swipe/drag */
.swipe-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: rgba(52, 152, 219, 0.7);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.swipe-indicator.left {
  left: 20px;
}

.swipe-indicator.right {
  right: 20px;
}

.flipbook.dragging .swipe-indicator {
  opacity: 1;
}

.flipbook.dragging-left .swipe-indicator.left {
  transform: translateY(-50%) translateX(-5px);
}

.flipbook.dragging-right .swipe-indicator.right {
  transform: translateY(-50%) translateX(5px);
}

/* Mobile optimizacija */
@media (max-width: 768px) {
  .swipe-hint {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 20px;
    margin: 0 auto;
    width: 200px;
    animation: fadeInOut 3s ease-in-out infinite;
  }

  @keyframes fadeInOut {
    0%,
    100% {
      opacity: 0.5;
    }
    50% {
      opacity: 1;
    }
  }
}

/* Prevencija selektovanja tokom draga */
.flipbook {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
