/**
 * Estilos del formulario de citas Y MODAL UNIFICADO
 * Compartido entre panel de administración y reservas públicas
 * 
 * IMPORTANTE: Estos estilos garantizan que ambos formularios sean 100% idénticos
 * siguiendo principios SOLID - Single Source of Truth
 */

/* ==========================================
   MODAL UNIFICADO
   ========================================== */

.modal,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal.show,
.modal.active,
.modal-overlay.show,
.modal-overlay.active {
  display: flex !important;
}

.modal-content {
  background: #ffffff !important;
  border-radius: 12px !important;
  max-width: 480px !important;
  width: 100% !important;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  animation: modalFadeIn 0.2s ease;
  position: relative;
  padding: 24px !important;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Botón de cerrar (X) - Unificado con animación */
.close-modal,
.btn-close {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  border-radius: 50% !important;
  background: transparent !important;
  color: #6b7280 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
  z-index: 10;
}

.close-modal:hover,
.btn-close:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
  transform: rotate(90deg) !important; /* Animación de rotación en hover */
}

.close-modal .material-icons,
.btn-close .material-icons,
.close-modal svg,
.btn-close svg {
  font-size: 20px !important;
  width: 20px !important;
  height: 20px !important;
}

/* ==========================================
   FORMULARIO
   ========================================== */

/* Título del formulario con línea divisoria */
.modal-content h3,
.modal-header h3,
.modal h3,
#modal-body h3,
#modalBody h3 {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  margin-bottom: 16px !important;
  margin-top: 0 !important;
  padding-right: 32px !important; /* Espacio para botón X */
  padding-bottom: 16px !important;
  border-bottom: 1px solid #e5e7eb !important; /* Línea divisoria */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

/* Grupos de formulario */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #111827 !important;
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
  color: #111827 !important;
  transition: all 0.2s;
  background: #ffffff !important;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #054496 !important;
  box-shadow: 0 0 0 3px rgba(5, 68, 150, 0.1) !important;
}

.form-group input[readonly] {
  background: #f9fafb !important;
  color: #6b7280 !important;
  cursor: not-allowed;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px !important;
  color: #6b7280 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 0;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  opacity: 0.8;
}

.checkbox-label input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer;
  accent-color: #054496 !important;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + span {
  color: #111827 !important;
}

.checkbox-label span {
  font-size: 14px !important;
  font-weight: 400 !important;
  color: #111827 !important;
  user-select: none;
  line-height: 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

/* Detalles de la reserva - Fondo mejorado */
.reservation-details,
.booking-summary {
  background-color: #f9fafb !important; /* Fondo gris claro */
  border: 1px solid #e5e7eb !important; /* Borde sutil */
  border-radius: 8px !important;
  padding: 16px !important;
  margin-bottom: 20px !important;
  margin-top: 16px !important;
}

.reservation-details .detail-item,
.booking-summary .detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280 !important;
  font-size: 14px !important;
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

.reservation-details .detail-item:last-child,
.booking-summary .detail-item:last-child {
  margin-bottom: 0;
}

.reservation-details .detail-item .material-icons,
.booking-summary .detail-item .material-icons {
  font-size: 18px !important;
  color: #6b7280 !important; /* Iconos grises */
}

/* Acciones del formulario - Botones alineados a la derecha */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end !important; /* Botones a la derecha */
}

/* Botones del formulario - Estilo unificado */
.modal-actions .btn,
.modal-actions button.btn,
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions button.btn-primary,
.modal-actions button.btn-secondary {
  flex: 0 0 auto !important; /* NO expandir botones */
  min-width: 120px !important;
  padding: 12px 24px !important;
  border: none;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  box-sizing: border-box;
}

.modal-actions .btn-secondary,
.modal-actions button.btn-secondary {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  color: #111827 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.modal-actions .btn-secondary:hover,
.modal-actions button.btn-secondary:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
}

.modal-actions .btn-primary,
.modal-actions button.btn-primary {
  background: #054496 !important;
  color: white !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.modal-actions .btn-primary:hover,
.modal-actions button.btn-primary:hover {
  background: #043775 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.modal-actions .btn-primary:disabled,
.modal-actions button.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive - en móvil los botones se expanden full width */
@media (max-width: 640px) {
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-actions .btn,
  .modal-actions button.btn {
    width: 100% !important;
    flex: 1 1 auto !important;
  }
}
