/*
 * 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.
 */
@import "tailwindcss";

/* Confirm modal animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Markdown rendered content */
.markdown-body h1 { font-size: 1.5rem; font-weight: 700; color: #1c1917; margin: 1.5rem 0 0.75rem; }
.markdown-body h2 { font-size: 1.15rem; font-weight: 700; color: #1c1917; margin: 1.25rem 0 0.5rem; }
.markdown-body h3 { font-size: 1rem; font-weight: 600; color: #292524; margin: 1rem 0 0.5rem; }
.markdown-body p { color: #57534e; line-height: 1.7; margin: 0.5rem 0; }
.markdown-body ul { list-style-type: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.markdown-body ol { list-style-type: decimal; padding-left: 1.5rem; margin: 0.5rem 0; }
.markdown-body li { color: #57534e; line-height: 1.6; margin: 0.25rem 0; }
.markdown-body strong { color: #1c1917; font-weight: 600; }
.markdown-body a { color: #0f766e; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body hr { border-color: #e7e5e4; margin: 1rem 0; }
.markdown-body code { background: #f5f5f4; padding: 0.15rem 0.4rem; border-radius: 0.25rem; font-size: 0.875rem; }
.markdown-body pre { background: #f5f5f4; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.75rem 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.markdown-body th, .markdown-body td { border: 1px solid #e7e5e4; padding: 0.5rem 0.75rem; text-align: left; font-size: 0.875rem; }
.markdown-body th { background: #fafaf9; font-weight: 600; }

/* ── Mobile sidebar ────────────────────────────────────────── */
/* Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
}
.mobile-overlay.is-open {
  opacity: 1;
}

/* Mobile-only rules: hide sidebar, show hamburger */
@media (max-width: 767px) {
  .mobile-sidebar {
    position: fixed !important;
    top: 57px;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
  }
  .mobile-sidebar.is-open {
    transform: translateX(0);
  }
  .mobile-hamburger { display: flex !important; }
}

/* Desktop: hamburger is always hidden */
@media (min-width: 768px) {
  .mobile-hamburger { display: none !important; }
  .mobile-overlay { display: none !important; }
}

/* ── Impressão ─────────────────────────────────────────────────────────── */
@media print {
  /* Sempre oculta elementos de navegação/UI */
  .no-print,
  header,
  nav,
  aside,
  .sidebar,
  [data-controller="notification"],
  [data-controller="print-menu"],
  footer { display: none !important; }

  /* Remove fundos para economia de tinta */
  body { background: white !important; }
  .bg-slate-50, .bg-slate-100, .bg-amber-50, .bg-indigo-50 {
    background: transparent !important;
  }

  /* Evita corte de blocos no meio */
  .bg-white, [id^="ai_report_"] { break-inside: avoid; page-break-inside: avoid; }
}

/* Modo: só análise IA — oculta tudo exceto o bloco de ai_report_ */
@media print {
  body.print-mode-analysis main > *:not([id^="ai_report_"]),
  body.print-mode-analysis .space-y-6 > *:not([id^="ai_report_"]):not(:first-child),
  body.print-mode-analysis .tool-content,
  body.print-mode-analysis .tool-items,
  body.print-mode-analysis form {
    display: none !important;
  }
}

/* Modo: só conteúdo — oculta o ai_report_ */
@media print {
  body.print-mode-content [id^="ai_report_"] { display: none !important; }
}

/* Modo: completa — mostra tudo (sem regras extras) */
