/* Print-specific styles for PDF export */

@media print {
  /* Hide all non-essential elements */
  body > *:not(#pdf-export-container) {
    display: none !important;
  }

  /* Reset body styles for print */
  body {
    margin: 0;
    padding: 0;
    background: white !important;
    color: black !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }

  /* Show only the PDF export container */
  #pdf-export-container {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* PDF Report Container */
  .pdf-report {
    width: 100%;
    max-width: 210mm; /* A4 width */
    margin: 0 auto;
    padding: 15mm;
    background: white;
    color: #000;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* Header */
  .pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #a855f7;
  }

  .pdf-logo h1 {
    font-size: 24pt;
    font-weight: 900;
    margin: 0;
    color: #000;
    letter-spacing: 2px;
  }

  .pdf-logo .highlight {
    color: #a855f7;
  }

  .pdf-meta {
    text-align: right;
    font-size: 9pt;
    color: #555;
  }

  .pdf-meta p {
    margin: 2px 0;
  }

  /* Title */
  .pdf-title {
    font-size: 18pt;
    font-weight: 700;
    text-align: center;
    margin: 20px 0;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  /* Summary Box */
  .pdf-summary-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .pdf-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
  }

  .pdf-summary-item .label {
    font-weight: 600;
    color: #555;
  }

  .pdf-summary-item .value {
    font-weight: 700;
    color: #000;
  }

  .sentiment-bullish {
    color: #22c55e !important;
  }

  .sentiment-bearish {
    color: #ef4444 !important;
  }

  .sentiment-neutral {
    color: #64748b !important;
  }

  /* Sections */
  .pdf-section {
    margin: 25px 0;
    page-break-inside: avoid;
  }

  .pdf-section-title {
    font-size: 14pt;
    font-weight: 700;
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
    color: #000;
  }

  /* Analysis Content */
  .pdf-analysis {
    margin: 15px 0;
    line-height: 1.7;
  }

  .pdf-analysis h4.analysis-header {
    font-size: 12pt;
    font-weight: 700;
    margin: 15px 0 8px 0;
    color: #a855f7;
  }

  .pdf-analysis p {
    margin: 8px 0;
    text-align: justify;
  }

  .pdf-analysis li {
    margin: 5px 0 5px 20px;
  }

  .pdf-analysis strong {
    font-weight: 700;
    color: #000;
  }

  /* Tables */
  .pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 10pt;
  }

  .pdf-table th,
  .pdf-table td {
    padding: 8px 10px;
    border: 1px solid #ddd;
    text-align: left;
  }

  .pdf-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #000;
  }

  .pdf-table .table-label {
    font-weight: 600;
    background: #f8f9fa;
    width: 30%;
  }

  .pdf-table .table-value {
    font-weight: 700;
  }

  .action-buy {
    color: #22c55e !important;
  }

  .action-sell {
    color: #ef4444 !important;
  }

  .action-hold {
    color: #64748b !important;
  }

  .strategy-reasoning {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #a855f7;
    font-size: 10pt;
    line-height: 1.6;
  }

  /* News List */
  .pdf-news-list {
    margin: 15px 0;
  }

  .pdf-news-item {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #eab308;
    page-break-inside: avoid;
  }

  .news-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eab308;
    color: white;
    font-weight: 700;
    border-radius: 50%;
    font-size: 10pt;
  }

  .news-content {
    flex: 1;
  }

  .news-title {
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #000;
    font-size: 10pt;
  }

  .news-source {
    font-size: 9pt;
    color: #666;
    margin: 0;
  }

  /* Disclaimer */
  .pdf-disclaimer {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    page-break-inside: avoid;
  }

  .pdf-disclaimer h4 {
    font-size: 11pt;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #000;
  }

  .pdf-disclaimer p {
    font-size: 9pt;
    line-height: 1.5;
    margin: 5px 0;
    color: #555;
  }

  .powered-by {
    text-align: center;
    margin-top: 10px !important;
    font-weight: 600;
    color: #a855f7 !important;
  }

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

  .page-break-after {
    page-break-after: always;
  }

  /* Prevent orphans and widows */
  p, li {
    orphans: 3;
    widows: 3;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }
}

/* Hide PDF container by default (only show when printing) */
.pdf-export-print-only {
  display: none;
}
