/**
 * PDF Flipbook CSS
 * @package kepler
 */

#flipbook-etica-pdf {
  width: 100%;
  max-width: 2000px;
  margin: 0 auto;
  padding: 0 0 20px;
}

.flipbook-container {
  width: 100%;
  height: 600px;
  position: relative;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 10px;
  overflow: hidden;
}

/* Mostrar controles no hover */
.flipbook-container:hover .flipbook-controls,
.flipbook-container:hover .flipbook-zoom-controls {
  opacity: 1;
  visibility: visible;
}

/* Manter controles visíveis quando estão em foco ou hover */
.flipbook-controls:hover,
.flipbook-zoom-controls:hover {
  opacity: 1;
  visibility: visible;
}

.flipbook-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#flipbook {
  position: relative;
  width: 922px;
  height: 600px;
  margin: 0 auto;
}

#flipbook .page {
  width: 461px;
  height: 600px;
  background-color: white;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#flipbook .page img {
  max-width: 100%;
  max-height: 100%;
}

.flipbook-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 0;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.flipbook-zoom-controls {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 15px;
  border-radius: 50px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.flipbook-nav {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 50px;
}

.flipbook-zoom-info {
  color: #ecf0f1;
  font-size: 14px;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

.flipbook-zoom-btn {
  width: 35px;
  height: 35px;
  font-size: 18px;
  line-height: 1;
}

.flipbook-zoom-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.flipbook-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  border: none;
  font-size: 3rem;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.flipbook-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.flipbook-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  opacity: 0.5;
}

.flipbook-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.flipbook-page-info {
  color: #ecf0f1;
  font-size: 16px;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

.flipbook-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ecf0f1;
}

.flipbook-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsivo */
@media (max-width: 1024px) {
  #flipbook {
    width: 692px;
    height: 450px;
  }

  #flipbook .page {
    width: 346px;
    height: 450px;
  }

  .flipbook-container {
    height: 450px;
  }
}

@media (max-width: 768px) {
  #flipbook {
    width: 400px;
    height: 520px;
  }

  #flipbook .page {
    width: 400px;
    height: 520px;
  }

  .flipbook-container {
    height: 520px;
  }

  .flipbook-nav {
    gap: 15px;
    padding: 10px 20px;
  }

  .flipbook-btn {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  #flipbook {
    width: 300px;
    height: 390px;
  }

  #flipbook .page {
    width: 300px;
    height: 390px;
  }

  .flipbook-container {
    height: 390px;
  }
}
