/* Container principal da imagem */
.enhanced-zoom-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background: #f8f9fa;
  min-height: 400px;
}

.enhanced-zoom-container:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.zoomable-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
  cursor: grab;
  user-select: none;
  transform-origin: 0 0;
}

.zoomable-image:active {
  cursor: grabbing;
}

/* Overlay de interação */
.zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, 
    transparent 70%, 
    rgba(0, 0, 0, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 12px;
}

.enhanced-zoom-container:hover .zoom-overlay {
  opacity: 1;
}

.zoom-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(5px);
  animation: fadeInUp 0.5s ease;
}

.zoom-hint i {
  font-size: 1rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Painel de controles */
.zoom-controls-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10;
}

.enhanced-zoom-container:hover .zoom-controls-panel {
  opacity: 1;
  transform: translateY(0);
}

.zoom-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e9ecef;
  color: #495057;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.zoom-btn:hover {
  background: #b31b00;
  color: white;
  border-color: #b31b00;
  transform: scale(1.1);
}

.zoom-btn:active {
  transform: scale(0.95);
}

/* Indicador de zoom */
.zoom-indicator {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 15px;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.enhanced-zoom-container:hover .zoom-indicator {
  opacity: 1;
  transform: translateY(0);
}

.zoom-percentage {
  font-weight: 600;
  color: #b31b00;
  min-width: 45px;
  text-align: center;
}

.zoom-slider-container {
  width: 150px;
}

.zoom-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  background: linear-gradient(to right, #dee2e6, #b31b00);
  border-radius: 3px;
  outline: none;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b31b00;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.zoom-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b31b00;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Lente de zoom */
.zoom-lens {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  display: none;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3),
              inset 0 0 20px rgba(255, 255, 255, 0.5);
  z-index: 5;
}

.zoom-lens::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: #b31b00;
  border-radius: 50%;
  box-shadow: 0 0 10px #b31b00;
}

/* Modal de tela cheia */
.fullscreen-zoom-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  animation: modalFadeIn 0.3s ease;
}

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

.modal-container {
  width: 95%;
  height: 95%;
  margin: 2.5% auto;
  background: #1a1a1a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  background: #2d2d2d;
  border-bottom: 1px solid #404040;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #adb5bd;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.modal-title {
  flex: 1;
  padding: 0 30px;
  color: white;
}

.modal-title h5 {
  margin: 0;
  font-size: 1.2rem;
}

.image-info {
  font-size: 0.9rem;
  color: #adb5bd;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #404040;
  color: #adb5bd;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #b31b00;
  color: white;
  border-color: #b31b00;
}

.modal-body {
  flex: 1;
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fullscreen-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: grab;
  transition: transform 0.3s ease;
  user-select: none;
}

.fullscreen-image:active {
  cursor: grabbing;
}

.drag-handle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  backdrop-filter: blur(10px);
}

.modal-zoom-out,
.modal-zoom-in {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-zoom-out:hover,
.modal-zoom-in:hover {
  background: #b31b00;
}

.modal-zoom-slider {
  width: 200px;
  height: 6px;
  -webkit-appearance: none;
  background: linear-gradient(to right, #6c757d, #b31b00);
  border-radius: 3px;
  outline: none;
}

.modal-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #b31b00;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.modal-zoom-level {
  color: white;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

.modal-footer {
  padding: 20px 30px;
  background: #2d2d2d;
  border-top: 1px solid #404040;
}

.image-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #404040;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #b31b00;
  border-color: #b31b00;
}

.image-counter {
  font-size: 0.9rem;
  color: #adb5bd;
}

/* Animações de zoom */
.zoom-in-effect {
  animation: zoomIn 0.3s ease;
}

.zoom-out-effect {
  animation: zoomOut 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes zoomOut {
  from { transform: scale(1.1); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsividade */
@media (max-width: 992px) {
  .zoom-controls-panel {
    flex-direction: row;
    top: auto;
    bottom: 20px;
    right: 50%;
    transform: translateX(50%) translateY(20px);
  }
  
  .zoom-indicator {
    left: 50%;
    transform: translateX(-50%) translateY(10px);
  }
  
  .zoom-slider-container {
    width: 120px;
  }
}

@media (max-width: 768px) {
  .modal-container {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }
  
  .modal-header {
    padding: 15px;
  }
  
  .modal-zoom-controls {
    width: 90%;
    padding: 10px 15px;
  }
  
  .modal-zoom-slider {
    width: 150px;
  }
  
  .zoom-hint {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}