/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Fix browser autofill white background on dark theme inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Print styles — hide nav, footer, and UI chrome; clean background */
@media print {
  nav, footer, .no-print,
  [data-controller="flash"],
  [data-controller="text-to-speech"] > div:first-child,
  a[href="/cheat_sheets"],
  button[onclick="window.print()"] {
    display: none !important;
  }

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

  main {
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Reset dark theme for print readability */
  .bg-slate-800, .bg-slate-900, .bg-slate-700 {
    background: white !important;
  }
  .border-slate-700, .border-slate-800 {
    border-color: #e5e7eb !important;
  }
  .text-slate-100, .text-slate-200, .text-slate-300 {
    color: #111 !important;
  }
  .text-slate-400, .text-slate-500 {
    color: #555 !important;
  }
  .text-emerald-400, .text-emerald-300 {
    color: #059669 !important;
  }

  /* Prose content — ensure readable print */
  .prose code, .prose pre {
    background: #f3f4f6 !important;
    color: #111 !important;
    border-color: #d1d5db !important;
  }

  /* Avoid page breaks inside code blocks and tables */
  pre, table, blockquote {
    break-inside: avoid;
  }
}
