/* Estilos profesionales para impresión de recetas médicas */

@page {
  size: A4;
  margin: 1.5cm;
}

/* Reseteo básico para impresión */
html, body {
  margin: 0;
  padding: 0;
  background: white;
  font-family: 'Helvetica', 'Arial', sans-serif;
  line-height: 1.5;
  color: #333;
}

/* Contenedor principal de la receta */
.receta-impresa {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  color: #333;
  font-size: 11pt;
}

/* Encabezado de la receta */
.receta-impresa .encabezado {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #2c5282;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.receta-impresa .logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.receta-impresa .logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.receta-impresa .info-consultorio h2 {
  margin: 0 0 5px 0;
  color: #2c5282;
  font-size: 18pt;
  font-weight: 600;
}

.receta-impresa .info-medico {
  text-align: right;
}

.receta-impresa .info-medico h3 {
  margin: 0 0 5px 0;
  font-size: 13pt;
  color: #2c5282;
}

/* Información del paciente */
.receta-impresa .info-paciente {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.receta-impresa .info-paciente h3 {
  margin: 0 0 8px 0;
  font-size: 13pt;
  color: #2c5282;
}

/* Sección RX - Medicamentos */
.receta-impresa .rx-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.receta-impresa .rx-symbol {
  margin-right: 10px;
  color: #2c5282;
  font-weight: bold;
  font-size: 18pt;
}

.receta-impresa .seccion-medicamentos {
  margin-bottom: 25px;
}

.receta-impresa .medicamento {
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 12px;
  background-color: #f8fafc;
}

.receta-impresa .medicamento h4 {
  margin: 0 0 8px 0;
  font-size: 12pt;
  color: #2c5282;
  font-weight: 600;
}

.receta-impresa .medicamento-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 15px;
}

.receta-impresa .medicamento-indicaciones {
  margin-top: 8px;
  padding: 8px;
  background-color: #f1f5f9;
  border-radius: 4px;
  grid-column: span 2;
}

/* Sección de Estudios y Recomendaciones */
.receta-impresa .seccion-adicional {
  margin-bottom: 20px;
}

.receta-impresa .seccion-adicional h4 {
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  font-size: 12pt;
  color: #2c5282;
}

.receta-impresa .seccion-adicional p {
  margin: 0;
  padding: 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

/* Firma del médico */
.receta-impresa .firma-medico {
  margin-top: 40px;
  text-align: center;
}

.receta-impresa .linea-firma {
  display: inline-block;
  width: 200px;
  border-bottom: 1px solid #2c5282;
  margin-bottom: 8px;
}

/* Pie de página */
.receta-impresa .pie-pagina {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 9pt;
  color: #64748b;
}

/* Ajustes específicos para impresión */
@media print {
  body {
    width: 100%;
    height: 100%;
  }
  
  .receta-impresa {
    width: 100%;
  }
  
  /* Evitar división de elementos importantes */
  .receta-impresa .encabezado,
  .receta-impresa .info-paciente,
  .receta-impresa .medicamento,
  .receta-impresa .seccion-adicional,
  .receta-impresa .firma-medico,
  .receta-impresa .pie-pagina {
    page-break-inside: avoid;
  }
  
  /* Ocultar elementos no imprimibles */
  .no-print, button, [role="button"], .dialog-header, .dialog-footer {
    display: none !important;
  }
}

/* Soporte para clases de Tailwind en impresión */
.p-8, .p-6, .p-4, .p-3, .p-2 {
  padding: 12px !important;
}

.mb-8, .mb-6, .mb-4 {
  margin-bottom: 16px !important;
}

.mt-8, .mt-6, .mt-4, .mt-2 {
  margin-top: 16px !important;
}

.border {
  border: 1px solid #e2e8f0 !important;
}

.border-t {
  border-top: 1px solid #e2e8f0 !important;
}

.border-b {
  border-bottom: 1px solid #e2e8f0 !important;
}

.rounded-lg, .rounded-md {
  border-radius: 6px !important;
}

.bg-white {
  background-color: white !important;
}

.bg-gray-50 {
  background-color: #f9fafb !important;
}

.text-primary {
  color: #2c5282 !important;
}

.font-bold, .font-semibold {
  font-weight: 600 !important;
}

.text-center {
  text-align: center !important;
}

.flex {
  display: flex !important;
}

.justify-between {
  justify-content: space-between !important;
}

.items-center {
  align-items: center !important;
}

.space-y-4 > * + * {
  margin-top: 16px !important;
}

.gap-2 {
  gap: 8px !important;
}

.gap-3 {
  gap: 12px !important;
}

.gap-4 {
  gap: 16px !important;
}

.text-xl {
  font-size: 16pt !important;
}

.text-lg {
  font-size: 14pt !important;
}

.text-sm {
  font-size: 10pt !important;
}

.text-xs {
  font-size: 9pt !important;
}

.text-gray-600 {
  color: #4b5563 !important;
}

.text-gray-500 {
  color: #6b7280 !important;
}

.mr-2 {
  margin-right: 8px !important;
}

.ml-2 {
  margin-left: 8px !important;
}
