/* =================================================
   MegaLinter Static Dashboard — Styles (Upgraded)
   =================================================
   Design goals:
   - Audit-first readability
   - Calm, professional tone
   - Clear semantic meaning
   - Zero visual noise
*/

/* -------------------------------------------------
   Reset / Base
------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  color: #1f2937;
  background-color: #f8fafc;
}

/* -------------------------------------------------
   Layout
------------------------------------------------- */

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header {
  margin-bottom: 2.5rem;
}

section {
  margin-bottom: 3rem;
}

/* -------------------------------------------------
   Typography
------------------------------------------------- */

h1 {
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e5e7eb;
}

.subtitle {
  font-size: 0.95rem;
  color: #475569;
  margin: 0;
}

code {
  background: #f1f5f9;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* -------------------------------------------------
   Run Overview
------------------------------------------------- */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.overview-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.overview-card.wide {
  grid-column: span 2;
}

.overview-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.overview-card .icon svg {
  width: 20px;
  height: 20px;
  fill: #475569;
}

.overview-card .content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.overview-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.overview-card .value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.overview-card .value.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  word-break: break-all;
}

/* -------------------------------------------------
   Overview Variants
------------------------------------------------- */

.overview-card.status {
  border-left: 4px solid #dc2626;
}

.overview-card.status .icon {
  background: #fee2e2;
}

.overview-card.status .icon svg {
  fill: #dc2626;
}

.overview-card.neutral {
  border-left: 4px solid #2563eb;
}

.overview-card.neutral .icon {
  background: #dbeafe;
}

.overview-card.neutral .icon svg {
  fill: #2563eb;
}

.overview-card.code {
  border-left: 4px solid #7c3aed;
}

.overview-card.code .icon {
  background: #ede9fe;
}

.overview-card.code .icon svg {
  fill: #7c3aed;
}

/* -------------------------------------------------
   Summary Cards
------------------------------------------------- */

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.summary-list li {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
}

/* -------------------------------------------------
   Filters
------------------------------------------------- */

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

#filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: #334155;
}

#filters select {
  margin-top: 0.4rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
}

#filters select:focus {
  outline: none;
  border-color: #2563eb;
}

/* -------------------------------------------------
   Issues Table
------------------------------------------------- */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

thead {
  background-color: #f1f5f9;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  font-size: 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid #e5e7eb;
}

th {
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: #f8fafc;
}

/* -------------------------------------------------
   Severity Column
------------------------------------------------- */

td[data-severity] {
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

td[data-severity]::before {
  content: "●";
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.7rem;
  vertical-align: middle;
}

td[data-severity="error"] {
  color: #991b1b;
}

td[data-severity="error"]::before {
  color: #dc2626;
}

td[data-severity="warning"] {
  color: #92400e;
}

td[data-severity="warning"]::before {
  color: #f59e0b;
}

td[data-severity="info"] {
  color: #1e3a8a;
}

td[data-severity="info"]::before {
  color: #2563eb;
}

/* -------------------------------------------------
   Message & File Columns
------------------------------------------------- */

td:nth-child(4) {
  max-width: 600px;
  line-height: 1.45;
  word-break: break-word;
}

td:last-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  color: #374151;
  word-break: break-all;
}

/* -------------------------------------------------
   Empty State
------------------------------------------------- */

td[colspan] {
  padding: 1.25rem;
  font-style: italic;
  color: #64748b;
}

/* -------------------------------------------------
   Accessibility
------------------------------------------------- */

:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
  }
}

/* -------------------------------------------------
   Responsive
------------------------------------------------- */

@media (max-width: 900px) {
  main {
    padding: 1.5rem 1rem 3rem;
  }

  .overview-card.wide {
    grid-column: span 1;
  }

  th,
  td {
    font-size: 0.8rem;
  }

  td:nth-child(4) {
    max-width: none;
  }
}
