/* LAB NUTRICIONAL PROFESIONAL - CUSTOM STYLES & PRINT STYLES */

/* Importación de Fuentes Premium */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

body {
  font-family: 'Outfit', sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Efectos de Glassmorphism */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(241, 245, 249, 0.8);
}

.glass-panel-dark {
  background: rgba(15, 23, 42, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animaciones y Transiciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulseBorder {
  0%, 100% { border-color: rgba(99, 102, 241, 0.2); }
  50% { border-color: rgba(99, 102, 241, 0.6); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pulse-border-active {
  animation: pulseBorder 2s infinite ease-in-out;
}

@keyframes gradientAnimation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-bg {
  background: linear-gradient(-45deg, #4f46e5, #6366f1, #8b5cf6, #ec4899);
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Clases de utilidad para Octágonos */
.octagon-seal {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  transition: all 0.3s ease;
}

.octagon-seal:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* ESTILOS DE IMPRESIÓN (PDF Y FICHA TÉCNICA) */
@media print {
  /* Forzar tamaño de página A4 con márgenes adecuados */
  @page {
    size: A4 portrait;
    margin: 15mm 15mm 15mm 15mm;
  }

  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  /* Ocultar elementos no deseados en el PDF */
  .no-print, 
  header, 
  button, 
  select, 
  input[type="checkbox"],
  .action-buttons,
  .database-selector,
  .formula-sidebar,
  .editor-controls {
    display: none !important;
  }

  /* Convertir layouts de grid de edición en layouts planos de reporte */
  .print-full-width {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    grid-column: span 12 / span 12 !important;
  }

  .print-page-break {
    page-break-before: always;
  }

  /* Asegurar que las tarjetas e información no se corten a la mitad */
  .print-avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Estilos específicos para la Tabla Nutricional impresa */
  .nutritional-label-print {
    border: 2px solid #000000 !important;
    padding: 12px !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }

  /* Forzar visibilidad de fondos en PDF (impresión a color) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Reconfigurar el modal para impresión fluida en A4 */
  .print-modal-container {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
    inset: auto !important;
    z-index: auto !important;
    overflow: visible !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .print-modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
