/**
 * NEO360 - Estilos para Modales
 * Patrón de diseño: PresupuestosMediciones
 */

/* ============================================================================
   OVERLAY Y CONTENEDOR PRINCIPAL
   ============================================================================ */
.neo360-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: neo360ModalFadeIn 0.2s ease-out;
}

@keyframes neo360ModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.neo360-modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: neo360ModalSlideIn 0.3s ease-out;
}

@keyframes neo360ModalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================================================
   HEADER DEL MODAL
   ============================================================================ */
.neo360-modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e8ecf0;
  background: #fafbfc;
}

.neo360-modal-hdr h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.neo360-modal-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a9ab0;
  transition: all 0.2s;
  font-size: 18px;
}

.neo360-modal-close:hover {
  background: #e8ecf0;
  color: #e74c3c;
}

/* ============================================================================
   BODY DEL MODAL
   ============================================================================ */
.neo360-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Grid de formularios */
.neo360-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.neo360-form-grid .neo360-form-full {
  grid-column: 1 / -1;
}

/* Grupos de formulario */
.neo360-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.neo360-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
}

.neo360-form-group label span {
  color: #e74c3c;
}

.neo360-form-group input,
.neo360-form-group select,
.neo360-form-group textarea {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
}

.neo360-form-group input:focus,
.neo360-form-group select:focus,
.neo360-form-group textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.neo360-form-group input::placeholder,
.neo360-form-group textarea::placeholder {
  color: #b0b8c0;
}

.neo360-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================================================
   FOOTER DEL MODAL
   ============================================================================ */
.neo360-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e8ecf0;
  background: #fafbfc;
}

.neo360-modal-footer .btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
}

.neo360-modal-footer .btn-lim {
  background: white;
  color: #2c3e50;
  border: 1px solid #e0e0e0;
}

.neo360-modal-footer .btn-lim:hover {
  background: #f5f6fa;
  border-color: #3498db;
}

.neo360-modal-footer .btn-crear {
  background: linear-gradient(135deg, #27ae60, #229954);
  color: white;
}

.neo360-modal-footer .btn-crear:hover {
  background: linear-gradient(135deg, #229954, #1c7a44);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.neo360-modal-footer .btn-pers {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
}

.neo360-modal-footer .btn-pers:hover {
  background: linear-gradient(135deg, #2980b9, #1c6ea4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* ============================================================================
   MODAL GRANDE (para formularios extensos)
   ============================================================================ */
.neo360-modal-large {
  max-width: 800px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  .neo360-modal {
    width: 95%;
    max-height: 95vh;
  }

  .neo360-form-grid {
    grid-template-columns: 1fr;
  }

  .neo360-modal-hdr {
    padding: 16px 20px;
  }

  .neo360-modal-body {
    padding: 20px;
  }

  .neo360-modal-footer {
    padding: 12px 20px;
    flex-direction: column-reverse;
  }

  .neo360-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================================
   ESTILOS ESPECÍFICOS PARA CAMPOS
   ============================================================================ */
.neo360-form-hint {
  font-size: 11px;
  color: #8a9ab0;
  margin-top: 4px;
}

.neo360-form-error {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 4px;
}

.neo360-form-group.has-error input,
.neo360-form-group.has-error select,
.neo360-form-group.has-error textarea {
  border-color: #e74c3c;
}

.neo360-form-group.has-error input:focus,
.neo360-form-group.has-error select:focus,
.neo360-form-group.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}
