@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #0b0f19;
  color: #f3f4f6;
}

/* Custom scrollbar for premium look */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Glassmorphism effects */
.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gradient-text {
  background: linear-gradient(135deg, #003bb0 0%, #00c6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-btn {
  background: linear-gradient(135deg, #003bb0 0%, #0056e0 100%);
  transition: all 0.3s ease;
}
.gradient-btn:hover {
  background: linear-gradient(135deg, #0056e0 0%, #003bb0 100%);
  box-shadow: 0 0 15px rgba(0, 59, 176, 0.4);
}

/* print styles for monthly PDF reports */
/* print styles for monthly PDF reports */
@media print {
  /* Force background colors and graphics printing */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: A4 portrait;
    margin: 1.2cm;
  }
  
  body {
    background-color: #ffffff !important;
    color: #111827 !important;
    font-size: 10pt;
    font-family: 'Inter', sans-serif !important;
    /* Reset flex/overflow constraint from Tailwind */
    display: block !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
  }

  main, .content-container {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Ocultar elementos interactivos en impresión */
  .no-print,
  #sidebar,
  button,
  .btn,
  #auth-status-container,
  #simulation-modal,
  .action-buttons,
  #lead-simulation-btn,
  #export-json-btn,
  #print-pdf-btn,
  #gemini-modal,
  #client-modal {
    display: none !important;
  }

  /* Forzar visibilidad y color en modo de impresión */
  .print-header {
    display: block !important;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }

  .print-header-title {
    font-size: 20pt;
    font-weight: 800;
    color: #081a3a !important;
    text-transform: uppercase;
  }

  .print-footer {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
    background: #ffffff !important;
  }

  /* Ajustar grid de KPIs para impresión */
  .kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 25px !important;
  }

  .kpi-card {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    padding: 12px !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  /* Forzar visibilidad de textos en KPIs */
  .kpi-card span, .kpi-card div {
    color: #475569 !important; /* Slate-600 */
  }
  .kpi-card span.text-white, .kpi-card .text-2xl {
    color: #081a3a !important; /* Deep navy for numbers */
    font-weight: 700 !important;
  }
  .kpi-card span.text-slate-400, .kpi-card span.text-slate-500 {
    color: #64748b !important;
  }

  /* Destacar la tarjeta de CPA en la impresión */
  #cpa-card {
    background-color: #eff6ff !important; /* Soft blue */
    border: 1px solid #93c5fd !important;
  }
  #cpa-card span, #cpa-card div {
    color: #1e40af !important;
  }
  #cpa-card span#kpi-cpa {
    color: #1d4ed8 !important;
  }

  /* Tablas de informes */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 25px !important;
    background: #ffffff !important;
  }

  th {
    background-color: #081a3a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-align: left !important;
    padding: 8px 10px !important;
    font-size: 9pt !important;
    border: 1px solid #081a3a !important;
  }

  td {
    border: 1px solid #e2e8f0 !important;
    padding: 8px 10px !important;
    color: #334155 !important;
    font-size: 9pt !important;
  }

  /* Override de colores de texto en tablas para legibilidad en impresión */
  table td, table td span {
    color: #334155 !important;
  }
  table td.text-white, table td.font-medium, table td.font-semibold {
    color: #0f172a !important; /* Casi negro */
    font-weight: 600 !important;
  }
  table td.text-right {
    text-align: right !important;
  }
  table td.text-center {
    text-align: center !important;
  }

  tr {
    page-break-inside: avoid !important;
  }

  /* Chips de estado de campaña */
  span.bg-green-500\/20 {
    background-color: #def7ec !important;
    color: #03543f !important;
    border: 1px solid #bdf2d5 !important;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
  }

  h2, h3 {
    color: #081a3a !important;
    font-size: 14pt !important;
    font-weight: 700 !important;
    margin-top: 15px !important;
    margin-bottom: 8px !important;
    page-break-after: avoid !important;
  }

  /* Forzar gráfico para impresión */
  #chart-section {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    margin-bottom: 25px !important;
    padding: 15px !important;
    page-break-inside: avoid !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #performance-chart {
    height: 280px !important;
    max-height: 280px !important;
  }
  #performance-chart .apexcharts-canvas,
  #performance-chart .apexcharts-canvas svg {
    height: 100% !important;
    width: 100% !important;
  }
  #chart-section h3, #chart-section p {
    color: #081a3a !important;
  }
  #chart-section p {
    color: #64748b !important;
    font-size: 8pt !important;
  }

  /* Soportar el listado cronológico completo en impresión */
  #conversions-log-section {
    page-break-inside: auto !important;
  }
  #conversions-log-section .max-h-80 {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* Ajustes del gráfico SVG en blanco y negro/escala de grises legible */
  .apexcharts-canvas svg {
    background: transparent !important;
  }
  .apexcharts-text {
    fill: #475569 !important; /* Slate-600 */
  }
  .apexcharts-legend-text {
    color: #0f172a !important;
  }
}

/* Cabecera oculta por defecto en pantalla */
.print-header, .print-footer {
  display: none;
}

/* ApexCharts premium dark overrides */
.apexcharts-tooltip {
  background: #0e1424 !important;
  border: 1px solid #1e293b !important;
  color: #f3f4f6 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  font-family: 'Inter', sans-serif !important;
}
.apexcharts-tooltip-title {
  background: #081a3a !important;
  border-bottom: 1px solid #1e293b !important;
  font-weight: 600 !important;
}
.apexcharts-xaxistooltip {
  background: #0e1424 !important;
  border: 1px solid #1e293b !important;
  color: #f3f4f6 !important;
  border-radius: 4px !important;
  font-family: 'Inter', sans-serif !important;
}

/* Date Range Picker active item */
#date-presets-list button.active {
  background: rgba(0, 59, 176, 0.2) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(0, 59, 176, 0.4) !important;
}
#date-presets-list button {
  border: 1px solid transparent;
}
