/**
 * ATS Match — Premium Print / PDF Export
 * Full-bleed A4 dark theme · Chrome print optimized
 */

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  html {
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm;
    background: #050816 !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    min-height: auto !important;
    background: #050816 !important;
    color: #f3f0ff !important;
    overflow: visible !important;
  }

  body::before {
    display: none !important;
  }

  .app-container {
    max-width: none !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide app chrome */
  .app-header,
  .hero,
  .demo-banner,
  .upload-form-wrapper,
  .btn-analyze,
  .section-divider,
  .features-section,
  .how-section,
  .loading-overlay,
  .app-footer,
  .report-actions,
  .section-toggle,
  .no-print {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    animation: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  .report-print-root {
    width: 210mm;
    margin: 0;
    padding: 0;
    background: #050816;
  }

  /* ── Full-bleed pages ── */
  .report-page {
    display: flex;
    flex-direction: column;
    width: 210mm;
    min-height: auto;
    margin: 0;
    padding: 14mm 16mm 16mm;
    box-sizing: border-box;
    border-radius: 0 !important;
    overflow: visible;
    page-break-after: auto;
    break-after: auto;
    background:
      radial-gradient(ellipse 120% 80% at 10% -10%, rgba(109, 40, 217, 0.35), transparent 55%),
      radial-gradient(ellipse 90% 60% at 100% 0%, rgba(217, 70, 239, 0.12), transparent 50%),
      radial-gradient(circle at 80% 100%, rgba(34, 211, 238, 0.06), transparent 40%),
      linear-gradient(180deg, #0b1023 0%, #050816 45%, #050816 100%);
    border: none !important;
    box-shadow: none !important;
  }

  /* Cover = one A4 sheet, no spillover blank page */
  .report-page--cover {
    min-height: 297mm;
    padding-top: 12mm;
    page-break-after: always;
    break-after: page;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Each section starts on a new page; height follows content (no blank filler pages) */
  .report-page--section {
    page-break-before: always;
    break-before: page;
    page-break-after: auto;
    break-after: auto;
    page-break-inside: auto;
    break-inside: auto;
  }

  .report-page--section:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  /* ── Cover layout ── */
  .report-header {
    background: rgba(17, 24, 39, 0.55) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
    border-radius: 12px !important;
    padding: 20px 24px !important;
    margin-bottom: 16px !important;
    box-shadow: none !important;
  }

  .report-logo-wrap {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .report-logo,
  .brand-logo {
    height: 56px !important;
    width: auto !important;
    max-width: 160px !important;
    background: transparent !important;
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.55)) !important;
  }

  .report-title-area h2 {
    color: #c084fc !important;
  }

  .report-job-title {
    color: #f3f0ff !important;
    font-size: 1.35rem !important;
  }

  .report-meta-item {
    color: #a8a4c4 !important;
  }

  .score-dashboard {
    background: rgba(17, 24, 39, 0.5) !important;
    border: 1px solid rgba(139, 92, 246, 0.22) !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    grid-template-columns: 1fr !important;
  }

  .gauge-panel {
    border-right: none !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15) !important;
    background: transparent !important;
  }

  .score-cards-grid {
    padding: 16px !important;
  }

  .score-card {
    background: rgba(11, 16, 35, 0.85) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .animate-in {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }

  /* ── Cyber gauge print ── */
  .cyber-gauge__halo,
  .cyber-gauge__particles {
    display: none !important;
  }

  .cyber-gauge__svg {
    filter: none !important;
  }

  .cyber-gauge__value {
    background: none !important;
    -webkit-text-fill-color: #f3f0ff !important;
    color: #f3f0ff !important;
  }

  .cyber-gauge__ring {
    animation: none !important;
  }

  .gauge-number,
  .cyber-gauge__value {
    color: #f3f0ff !important;
  }

  /* ── Section pages ── */
  .report-page--section .report-section {
    background: rgba(17, 24, 39, 0.55) !important;
    border: 1px solid rgba(139, 92, 246, 0.22) !important;
    border-radius: 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  .report-page--section .section-header {
    border-bottom-color: rgba(139, 92, 246, 0.2) !important;
    background: rgba(139, 92, 246, 0.08) !important;
  }

  .report-page--section .section-body {
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
  }

  .report-page--section .section-body.collapsed {
    max-height: none !important;
  }

  .ats-table {
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
  }

  .ats-table th {
    background: rgba(109, 40, 217, 0.25) !important;
    color: #e9d5ff !important;
  }

  .ats-table td {
    border-color: rgba(139, 92, 246, 0.12) !important;
    color: #e2e8f0 !important;
  }

  .badge-matched { background: rgba(16, 185, 129, 0.2) !important; color: #34d399 !important; }
  .badge-missing { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }

  .proj-value.expected {
    background: none !important;
    -webkit-text-fill-color: #c084fc !important;
    color: #c084fc !important;
  }

  .score-bar-fill {
    transition: none !important;
  }

  .report-header,
  .score-dashboard,
  .report-page--section .report-section {
    border-radius: 0 !important;
  }

  .report-page-footer {
    display: block !important;
    margin-top: auto;
    padding-top: 12px;
    font-size: 0.65rem;
    color: #6b6f8a;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}
