/* Estilos para el sistema de snapshots (copias de seguridad) */

/* Contenedor principal */
.section-container {
  margin-bottom: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #003087;
}

.section-description {
  color: #666;
  margin-bottom: 1.5rem;
}

/* Controles y acciones */
.snapshot-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.snapshot-name-input {
  display: flex;
  gap: 5px;
}

.snapshot-name-input input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 250px;
}

/* Tabla de snapshots */
.snapshots-table {
  width: 100%;
  border-collapse: collapse;
}

.snapshots-table th, .snapshots-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.snapshots-table th {
  background-color: #f5f5f5;
  font-weight: 600;
}

.snapshots-table tr:hover {
  background-color: #f9f9f9;
}

/* Estados y mensajes */
.warning-text {
  color: #e74c3c;
  font-weight: bold;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.loading-indicator {
  text-align: center;
  padding: 1rem;
  color: #666;
}

.error-message {
  text-align: center;
  padding: 1rem;
  color: #e74c3c;
}

.retry-btn {
  margin-top: 0.5rem;
}

/* Modal de confirmación - Versión mejorada para snapshots */
.snapshot-modal-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  text-align: center; /* Ayuda a centrar elementos inline-block */
}

/* Pseudo-elemento para mejorar el centrado vertical */
.snapshot-modal-overlay::before {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

.snapshot-modal-overlay.hidden {
  display: none !important;
}

.snapshot-modal-overlay:not(.hidden) {
  display: flex !important;
}

/* Mantener compatibilidad con estilos anteriores */
.modal {
  display: none !important;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  text-align: center;
}

.modal.hidden {
  display: none !important;
}

.modal:not(.hidden) {
  display: flex !important;
}

.modal-content, .snapshot-modal-content {
  background-color: #fff;
  border-radius: 10px;
  max-width: 500px;
  min-width: 320px;
  width: 90%;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  margin: auto;
  position: relative;
  padding: 0;
  transform: translateX(0) !important; /* Forzar centrado horizontal */
  left: auto !important; /* Eliminar cualquier posicionamiento izquierdo */
  right: auto !important; /* Eliminar cualquier posicionamiento derecho */
  top: auto !important; /* Asegurar que no haya desplazamientos verticales no deseados */
  animation: modalAppear 0.3s ease-out;
}

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

.modal-header, .snapshot-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eaeaea;
  position: relative;
}

.modal-header h3, .snapshot-modal-header h3 {
  margin: 0;
  color: #003087;
  font-size: 1.5rem;
  font-weight: 600;
  width: 90%;
}

.modal-close, #modal-close-btn, #delete-modal-close {
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: bold;
  line-height: 1;
  color: #666;
  position: absolute;
  right: 1.25rem;
  top: 1rem;
  transition: color 0.2s;
}

.modal-close:hover, #modal-close-btn:hover, #delete-modal-close:hover {
  color: #003087;
}

.modal-body, .snapshot-modal-body {
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

.modal-footer, .snapshot-modal-footer {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #eaeaea;
}

.snapshot-warning-text {
  color: #e74c3c;
  font-weight: bold;
  margin-top: 1rem;
}

/* Evitar scroll del body cuando el modal está abierto */
body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .snapshot-actions {
    margin-top: 1rem;
    width: 100%;
  }
  
  .snapshot-name-input {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .snapshot-name-input input {
    flex-grow: 1;
    min-width: auto;
  }
  
  .snapshots-table {
    display: block;
    overflow-x: auto;
  }
  
  /* Ajustes de modal para dispositivos móviles */
  .modal {
    padding: 15px;
  }
  
  .modal-content {
    width: 100%;
    min-width: 280px; /* Asegurar que sea legible en pantallas pequeñas */
    max-width: 100%;
  }
  
  .modal-header {
    padding: 1rem 1.25rem;
  }
  
  .modal-header h3 {
    font-size: 1.25rem;
    width: 85%;
  }
  
  .modal-body {
    padding: 1.25rem;
  }
  
  .modal-footer {
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
  }
  
  .modal-footer button {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }
}