/**
 * Print CSS - Print-specific styles
 * Optimized for financial reports and statements
 */

@media print {
  /* Reset for print */
  * {
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }

  /* Hide interactive elements */
  .sidebar,
  .header-bar,
  .btn,
  .modal,
  .dropdown,
  .nav-item,
  .mode-toggle,
  .action-card,
  button,
  input[type="button"],
  input[type="submit"],
  .print-hide {
    display: none !important;
  }

  /* Show print-only elements */
  .print-only {
    display: block !important;
  }

  /* Layout adjustments */
  body {
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
    margin: 0;
    padding: 0;
  }

  .main-layout {
    display: block;
  }

  .content-area {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: none;
  }

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

  .no-break {
    page-break-inside: avoid;
  }

  /* Headers and titles */
  .page-header h2 {
    font-size: 18pt;
    font-weight: bold;
    color: #000;
    margin-bottom: 10pt;
    text-align: center;
  }

  .page-header p {
    font-size: 10pt;
    color: #666;
    text-align: center;
    margin-bottom: 20pt;
  }

  /* Cards for print */
  .card {
    border: 1px solid #ccc;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 20pt;
    background: #fff;
    page-break-inside: avoid;
  }

  .card-header {
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
    padding: 8pt;
  }

  .card-header h3 {
    font-size: 14pt;
    font-weight: bold;
    color: #000;
    margin: 0;
  }

  .card-body {
    padding: 12pt;
  }

  /* Tables for print */
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
    margin-bottom: 15pt;
  }

  .data-table th {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 6pt 8pt;
    font-weight: bold;
    text-align: left;
  }

  .data-table td {
    border: 1px solid #ccc;
    padding: 6pt 8pt;
    vertical-align: top;
  }

  .data-table tbody tr:nth-child(odd) {
    background: #fafafa;
  }

  /* Numeric alignment */
  .data-table .numeric {
    text-align: right;
    font-family: monospace;
  }

  /* P&L Statement specific */
  .pl-statement {
    font-family: monospace;
  }

  .pl-section {
    margin-bottom: 15pt;
    page-break-inside: avoid;
  }

  .pl-section-title {
    font-size: 12pt;
    font-weight: bold;
    border-bottom: 2px solid #000;
    padding-bottom: 2pt;
    margin-bottom: 8pt;
  }

  .pl-line {
    display: flex;
    justify-content: space-between;
    padding: 2pt 0;
    border-bottom: 1px dotted #ccc;
  }

  .pl-line.total {
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 2px solid #000;
    margin-top: 5pt;
  }

  .pl-line.subtotal {
    font-weight: bold;
    border-top: 1px solid #666;
  }

  /* Metrics for print */
  .metric-card {
    border: 1px solid #ccc;
    padding: 10pt;
    margin-bottom: 10pt;
    background: #fff;
    text-align: left;
  }

  .metric-value {
    font-size: 16pt;
    font-weight: bold;
    color: #000;
  }

  .metric-label {
    font-size: 9pt;
    color: #666;
    text-transform: uppercase;
  }

  /* Charts - hide or replace with data */
  .chart-container {
    border: 1px solid #ccc;
    padding: 10pt;
    margin-bottom: 15pt;
  }

  .chart-canvas {
    display: none;
  }

  .chart-data-print {
    display: block !important;
    font-size: 10pt;
  }

  /* Footer for financial statements */
  .financial-footer {
    position: fixed;
    bottom: 20pt;
    left: 0;
    right: 0;
    font-size: 8pt;
    text-align: center;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 5pt;
  }

  /* Print header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20pt;
    padding-bottom: 10pt;
    border-bottom: 2px solid #000;
  }

  .print-header .company-name {
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 5pt;
  }

  .print-header .report-title {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 5pt;
  }

  .print-header .report-period {
    font-size: 10pt;
    color: #666;
  }

  /* Print date/time */
  .print-timestamp {
    position: fixed;
    top: 10pt;
    right: 20pt;
    font-size: 8pt;
    color: #666;
  }

  /* Page numbers */
  .print-page-numbers {
    position: fixed;
    bottom: 10pt;
    right: 20pt;
    font-size: 8pt;
    color: #666;
  }

  /* Confidentiality notice */
  .print-confidential {
    position: fixed;
    bottom: 10pt;
    left: 20pt;
    font-size: 8pt;
    color: #666;
    font-style: italic;
  }

  /* Adjustments for different report types */
  .balance-sheet .account-group {
    margin-bottom: 15pt;
    page-break-inside: avoid;
  }

  .balance-sheet .account-group-title {
    font-weight: bold;
    font-size: 11pt;
    border-bottom: 1px solid #666;
    margin-bottom: 5pt;
    padding-bottom: 2pt;
  }

  .trial-balance .account-line {
    display: grid;
    grid-template-columns: 60pt 2fr 80pt 80pt 80pt;
    gap: 10pt;
    padding: 2pt 0;
    font-family: monospace;
    font-size: 9pt;
  }

  .trial-balance .total-line {
    border-top: 2px solid #000;
    font-weight: bold;
  }

  /* Landscape orientation helper */
  @page landscape {
    size: landscape;
    margin: 15mm 10mm;
  }

  .print-landscape {
    page: landscape;
  }

  /* Portrait orientation (default) */
  @page {
    size: portrait;
    margin: 20mm 15mm;
  }
}