/* ============================================================
   ShopCommand AI — Global Print Stylesheet
   ElevatEd Automotive Solutions LLC
   Applied via index.html <link> — covers all current & future tools
   ============================================================ */

@media print {

  /* ---- PAGE SETUP ---- */
  @page {
    size: letter portrait;
    margin: 0.75in;
  }

  /* ---- HIDE ALL APP CHROME ---- */

  /* Sidebar navigation */
  aside,
  [data-sidebar] {
    display: none !important;
  }

  /* Back button */
  [data-back-button] {
    display: none !important;
  }

  /* Mobile hamburger menu */
  [data-mobile-menu-btn] {
    display: none !important;
  }

  /* Mobile sidebar overlay */
  [data-sidebar-overlay] {
    display: none !important;
  }

  /* Tab navigation within tools */
  [data-tab-bar] {
    display: none !important;
  }

  /* Action buttons (Print, Save to Vault, Generate New, etc.) */
  [data-action-buttons] {
    display: none !important;
  }

  /* RACE AI chat widget and toggle button */
  [data-race-mentor] {
    display: none !important;
  }

  /* Toast notifications */
  [data-toast] {
    display: none !important;
  }

  /* Any fixed/modal overlays */
  [data-modal] {
    display: none !important;
  }

  /* "Generate New" / back links at bottom of outputs */
  [data-generate-new] {
    display: none !important;
  }

  /* ---- LAYOUT RESET ---- */

  html, body {
    background: white !important;
    color: black !important;
    font-size: 11pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Remove sidebar padding from main content area */
  [data-main-wrapper] {
    padding-left: 0 !important;
    margin: 0 !important;
  }

  main,
  [data-main-content] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  /* ---- RUBRIC TABLE ---- */

  [data-rubric-output] {
    background: white !important;
    border: none !important;
    padding: 0 !important;
  }

  [data-rubric-table] {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 9pt !important;
  }

  [data-rubric-table] th,
  [data-rubric-table] td {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    padding: 4pt 6pt !important;
    border: 1pt solid #999 !important;
    vertical-align: top !important;
    background: white !important;
    color: black !important;
  }

  [data-rubric-table] thead th {
    background: #f3f4f6 !important;
    color: black !important;
    font-weight: bold !important;
  }

  /* Criteria column wider, performance columns equal */
  [data-rubric-table] td:first-child,
  [data-rubric-table] th:first-child {
    width: 22% !important;
  }

  /* Rubric title — reduce from screen size */
  [data-rubric-title] {
    font-size: 16pt !important;
    line-height: 1.2 !important;
    margin-bottom: 4pt !important;
    color: black !important;
  }

  [data-rubric-subtitle] {
    font-size: 10pt !important;
    color: #333 !important;
  }

  /* Student name/date print header block */
  [data-print-header] {
    display: block !important;
    border-bottom: 1pt solid #ccc !important;
    padding-bottom: 8pt !important;
    margin-bottom: 12pt !important;
    color: black !important;
  }

  /* ---- SKILLS CHECKLIST ---- */

  [data-checklist-output] {
    background: white !important;
    border: none !important;
    padding: 0 !important;
  }

  [data-checklist-item] {
    page-break-inside: avoid !important;
    border: 1pt solid #ccc !important;
    margin-bottom: 6pt !important;
    padding: 6pt !important;
    background: white !important;
    color: black !important;
    border-radius: 0 !important;
  }

  /* Safety items — retain amber left border */
  [data-checklist-item="safety"] {
    border-left: 4pt solid #f59e0b !important;
  }

  /* Pass/Fail/NA checkboxes — keep visible in print */
  [data-checklist-item] label {
    color: black !important;
  }

  [data-checklist-item] input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
  }

  /* Signature header block */
  [data-signature-header] {
    border: 1pt solid #ccc !important;
    padding: 8pt !important;
    margin-bottom: 12pt !important;
    background: white !important;
    color: black !important;
  }

  /* ---- QUICK QUIZ ---- */

  [data-quiz-output] {
    background: white !important;
    border: none !important;
    padding: 0 !important;
  }

  /* Hide the Student View / Answer Key toggle */
  [data-view-toggle] {
    display: none !important;
  }

  [data-quiz-question] {
    page-break-inside: avoid !important;
    margin-bottom: 12pt !important;
    background: white !important;
    color: black !important;
    border: 1pt solid #ccc !important;
    padding: 6pt !important;
    border-radius: 0 !important;
  }

  [data-quiz-question="safety"] {
    border-left: 4pt solid #f59e0b !important;
  }

  /* Answer key explanations */
  [data-answer-explanation] {
    font-size: 9pt !important;
    color: #333 !important;
    font-style: italic !important;
  }

  /* ---- LESSON PREP SUITE ---- */

  [data-prep-output] {
    background: white !important;
    border: none !important;
    padding: 0 !important;
  }

  [data-prep-output] * {
    color: black !important;
    border-color: #ccc !important;
  }

  /* ---- GENERAL PRINT POLISH ---- */

  /* Prevent orphaned headings */
  h1, h2, h3 {
    page-break-after: avoid !important;
  }

  /* Force all dark backgrounds to white in print */
  .bg-gray-800, .bg-gray-900, .bg-gray-950 {
    background: white !important;
  }

  /* Force light-on-dark text to black */
  .text-gray-100, .text-gray-200, .text-gray-300 {
    color: black !important;
  }
  .text-gray-400, .text-gray-500 {
    color: #555 !important;
  }

  /* Badges — outlined instead of colored background */
  [data-badge] {
    background: white !important;
    color: black !important;
    border: 1pt solid #999 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ASE task badge at bottom */
  [data-ase-task] {
    color: #555 !important;
    font-size: 9pt !important;
  }

  /* Instructor notes in print — subtle box */
  [data-instructor-notes] {
    border: 1pt solid #ccc !important;
    background: #f9f9f9 !important;
    color: #333 !important;
    padding: 6pt !important;
  }

  /* Remove rounded corners in print for cleaner look */
  [data-rubric-table],
  [data-checklist-item],
  [data-quiz-question] {
    border-radius: 0 !important;
  }

  /* Ensure overflow content is visible */
  .overflow-x-auto,
  .overflow-hidden {
    overflow: visible !important;
  }
}
