/**
 * Print-specific styles for survey reports
 */

@media print {
  /* General print styles */
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    background-color: white !important;
  }

  /* Hide elements that shouldn't be printed */
  nav,
  header,
  footer,
  button,
  .no-print,
  [role="navigation"],
  #printButton,
  .MuiAppBar-root,
  .MuiDrawer-root,
  .MuiButton-root {
    display: none !important;
  }

  /* Container adjustments */
  .MuiContainer-root,
  .MuiGrid-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Card styling */
  .MuiCard-root {
    box-shadow: none !important;
    border: 1px solid #e0e0e0 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    margin-bottom: 15mm !important;
  }

  /* Typography adjustments */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .MuiTypography-h1,
  .MuiTypography-h2,
  .MuiTypography-h3,
  .MuiTypography-h4,
  .MuiTypography-h5,
  .MuiTypography-h6 {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  /* Grid layout adjustments for print */
  .MuiGrid-item {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Ensure proper table display */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  th,
  td {
    border: 1px solid #e0e0e0 !important;
  }

  /* Ensure images are properly displayed */
  img {
    max-width: 100% !important;
  }

  /* Page breaks */
  .page-break {
    page-break-before: always !important;
    break-before: always !important;
  }

  /* Progress bars and charts */
  .MuiLinearProgress-root,
  .apexcharts-canvas {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Styles for html2canvas */
.html2canvas-container {
  background-color: white !important;
}

/* Make sure all elements have background colors for html2canvas */
.html2canvas-capture .MuiPaper-root,
.html2canvas-capture .MuiCard-root {
  background-color: white !important;
}

.html2canvas-capture .MuiLinearProgress-colorPrimary {
  background-color: #e0e0e0 !important;
}

.html2canvas-capture .MuiLinearProgress-barColorPrimary {
  background-color: #0765ff !important;
}

/* Ensure charts are properly captured */
.html2canvas-capture .apexcharts-canvas {
  display: inline-block !important;
}

/* Ensure all text is visible */
.html2canvas-capture text {
  font-family: "Mulish", sans-serif !important;
}

/* Minimal overflow prevention for html2canvas capture */
.html2canvas-capture {
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Ensure content doesn't get cut off */
.html2canvas-capture * {
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* Fix common layout issues */
.html2canvas-capture .MuiGrid-container {
  overflow: visible !important;
}

.html2canvas-capture .MuiCard-root,
.html2canvas-capture .MuiPaper-root {
  overflow: visible !important;
}
