/**
 * Estilos para o Gerenciador de Banners
 */

/* Forçar visibilidade do modal */
#bannerEditModal {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 99999 !important;
}

#bannerEditModal .modal-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 100000 !important;
}

/* Garantir que o modal apareça sobre tudo */
.modal {
  display: none;
  position: fixed;
  z-index: 99999 !important;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-content {
  background-color: #ffffff !important;
  margin: 5% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 100000 !important;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 1000;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
}

.banner-edit-modal {
  max-width: 800px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.banner-edit-modal h2 {
  color: #9d4edd;
  margin-bottom: 10px;
}

.banner-edit-modal p {
  color: #666;
  margin-bottom: 20px;
}

/* Container das imagens do banner */
.banner-images-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

/* Slot individual de imagem */
.banner-image-slot {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 10px;
  background: #f9f9f9;
  transition: all 0.3s ease;
}

.banner-image-slot:hover {
  border-color: #9d4edd;
  background: #f5f0ff;
}

/* Preview da imagem */
.banner-image-preview {
  position: relative;
  margin-bottom: 10px;
}

.banner-image-preview img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Overlay com controles */
.banner-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.banner-image-preview:hover .banner-image-overlay {
  opacity: 1;
}

.banner-image-overlay button {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-image-overlay button:hover {
  background: white;
  transform: scale(1.1);
}

.btn-change-image {
  color: #9d4edd;
}

.btn-remove-image {
  color: #ff4757;
}

/* Controles de tipo de mídia */
.banner-image-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.banner-image-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #666;
}

.banner-image-controls input[type="radio"] {
  margin: 0;
}

/* Slot para adicionar nova imagem */
.banner-image-slot.add-new {
  border-style: dashed;
  border-color: #9d4edd;
  background: #f5f0ff;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-add-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #9d4edd;
  cursor: pointer;
  padding: 20px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.banner-add-button:hover {
  background: rgba(157, 78, 221, 0.1);
  transform: scale(1.05);
}

.banner-add-button i {
  font-size: 24px;
}

.banner-add-button span {
  font-size: 12px;
  font-weight: 500;
}

/* Ações do modal */
.banner-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.banner-edit-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-preview {
  background: #3742fa;
  color: white;
}

.btn-preview:hover {
  background: #2f3542;
}

.btn-save {
  background: #2ed573;
  color: white;
}

.btn-save:hover {
  background: #26de81;
}

.btn-cancel {
  background: #ff4757;
  color: white;
}

.btn-cancel:hover {
  background: #ff3838;
}

/* Modal de prévia */
.banner-preview-modal {
  max-width: 600px;
  width: 90vw;
}

.banner-preview-container {
  margin: 20px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.btn-close-preview {
  width: 100%;
  padding: 10px;
  background: #666;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
}

.btn-close-preview:hover {
  background: #555;
}

/* Botão de edição nos banners */
.banner-edit-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(157, 78, 221, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  z-index: 5;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-edit-btn:hover {
  background: #9d4edd;
  transform: scale(1.1);
}

/* Responsividade */
@media (max-width: 768px) {
  .banner-edit-modal {
    width: 95vw;
    max-height: 90vh;
  }
  
  .banner-images-container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }
  
  .banner-image-preview img {
    height: 80px;
  }
  
  .banner-edit-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .banner-edit-actions button {
    justify-content: center;
  }
  
  .banner-edit-btn {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .banner-images-container {
    grid-template-columns: 1fr 1fr;
  }
  
  .banner-image-controls {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  
  .banner-image-controls label {
    font-size: 11px;
  }
}