/*
 * Custom styles for the Snotra Report Viewer, layered on top of m.css (dark).
 */

.brand-accent { color: var(--primary-color); }
.brand-link { display: inline-flex; align-items: center; }
.brand-logo { height: 1.6rem; width: auto; margin-right: 0.5rem; vertical-align: middle; }

main { min-height: 70vh; }
footer { margin: 2rem 0 1rem; }

/* ---- Footer credit ------------------------------------------------------- */
.site-credit { margin: 1.5rem 0 0.5rem; }
.site-credit-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color, inherit);
}
.site-credit-link:hover strong { color: var(--primary-color); }
.credit-logo { height: 2.2rem; width: auto; margin-right: 0.6rem; }

/* ---- Upload view --------------------------------------------------------- */
#upload-view { max-width: 38rem; margin: 0 auto; }
#upload-view h1 { margin-bottom: 0.5rem; }

/* ---- Dropzone ------------------------------------------------------------ */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line-color, #405363);
  border-radius: 0.6rem;
  padding: 2.75rem 1.5rem;
  text-align: center;
  margin: 1.75rem auto;
  cursor: pointer;
  background-color: rgba(127, 127, 127, 0.04);
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}
.dropzone:hover {
  border-color: var(--primary-color);
  background-color: rgba(127, 127, 127, 0.07);
}
.dropzone.dragover {
  border-color: var(--primary-color);
  background-color: var(--code-background-color, rgba(127, 127, 127, 0.1));
  transform: scale(1.01);
}

.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 0 1rem;
  border-radius: 50%;
  color: var(--primary-color);
  background-color: rgba(127, 127, 127, 0.12);
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.dropzone-icon svg { display: block; }
.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  background-color: var(--primary-color);
  color: var(--background-color, #fff);
  transform: translateY(-2px);
}

.dropzone-text { margin: 0 0 0.6rem; }
#browse-btn { padding: 0.6rem 1.4rem; font-size: 1rem; }

/* ---- Summary header ------------------------------------------------------ */
.summary-head { margin-top: 1rem; }
#reset-btn { margin-bottom: 1rem; }
.summary-meta { width: 100%; }
.summary-meta th { width: 9rem; white-space: nowrap; }
.summary-meta td { word-break: break-all; }

.count-strip {
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.count-chip {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 0.2rem;
  font-size: 0.85rem;
  border: 1px solid transparent;
  background: var(--code-background-color, rgba(127,127,127,0.1));
}
.count-chip strong { font-variant-numeric: tabular-nums; }

/* ---- Filter bar ---------------------------------------------------------- */
.filter-bar { margin: 1rem 0 0.25rem; }
.filter-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}
.filter-input {
  width: 100%;
  box-sizing: border-box;
  height: 2.6rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.8rem;
  font-size: 1rem;
  color: #dcdcdc;
  background-color: #272c34;
  border: 1px solid #405363;
  border-radius: 0.3rem;
}
/* native option popup follows the dark theme instead of browser white */
.filter-input option { color: #dcdcdc; background-color: #2f363f; }
.filter-input:focus { outline: none; border-color: var(--primary-color); }
.result-count { margin: 0.25rem 0 0.75rem; }

/* ---- Findings table ------------------------------------------------------ */
.findings-table { font-size: 0.9rem; table-layout: auto; }
.findings-table th, .findings-table td { padding: 0.4rem 0.6rem; vertical-align: top; }
.findings-table .col-expand { width: 1.4rem; padding-right: 0; text-align: center; }
.findings-table th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.findings-table th.sortable:hover { color: var(--primary-color); }
.findings-table th.sorted { color: var(--primary-color); }
.sort-arrow { font-size: 0.7rem; }

.finding-row { cursor: pointer; }
.finding-row:hover { background: var(--code-background-color, rgba(127,127,127,0.06)); }
.finding-row.expanded { background: var(--code-background-color, rgba(127,127,127,0.1)); }
.caret { display: inline-block; opacity: 0.6; transition: transform 80ms ease; }

.nowrap { white-space: nowrap; }
.mono { font-family: var(--code-font, monospace); font-size: 0.85em; }

/* ---- Badges -------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* status colors */
.status-fail    { background: #e63946; color: #fff; }
.status-pass    { background: #2a9d4a; color: #fff; }
.status-manual  { background: #e0982a; color: #1b1b1b; }
.status-info    { background: #3b7dd8; color: #fff; }
.status-unknown { background: #7a7a7a; color: #fff; }

/* count chips reuse status colors as a left accent */
.count-chip.status-fail    { border-color: #e63946; }
.count-chip.status-pass    { border-color: #2a9d4a; }
.count-chip.status-manual  { border-color: #e0982a; }
.count-chip.status-info    { border-color: #3b7dd8; }
.count-chip.status-unknown { border-color: #7a7a7a; }

/* impact / probability level colors (shared scale) */
.lvl-high    { background: #e63946; color: #fff; }
.lvl-medium  { background: #e0982a; color: #1b1b1b; }
.lvl-low     { background: #3b7dd8; color: #fff; }
.lvl-info    { background: #5a6a78; color: #fff; }
.lvl-unknown { background: #7a7a7a; color: #fff; }

/* ---- Detail row ---------------------------------------------------------- */
.detail-row td { background: var(--code-background-color, rgba(127,127,127,0.06)); }
.detail-box { padding: 0.5rem 0.5rem 1rem; max-width: 70rem; }
.detail-box h4 { margin: 0.3rem 0 0.6rem; }
.detail-box h5 {
  margin: 0.9rem 0 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}
.detail-text { margin: 0 0 0.4rem; white-space: pre-wrap; word-break: break-word; }
.detail-code {
  max-height: 22rem;
  overflow: auto;
  margin: 0.2rem 0 0.6rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  white-space: pre;
  tab-size: 2;
}
.detail-list { margin: 0.2rem 0 0.6rem 1.2rem; }
.detail-list li { margin: 0.1rem 0; }
.detail-tags { margin: 0.3rem 0 0.6rem; }
.detail-tags .badge { margin-right: 0.35rem; }
.meta-tag {
  display: inline-block;
  margin: 0 0.35rem 0.3rem 0;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  border-radius: 0.2rem;
  background: var(--background-color, rgba(127,127,127,0.12));
  border: 1px solid var(--line-color, #405363);
}
.detail-tags-bottom { margin-top: 0.2rem; }
.tag-chip {
  display: inline-block;
  margin: 0 0.35rem 0.3rem 0;
  padding: 0.12rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 1rem;
  background: rgba(127, 127, 127, 0.16);
  border: 1px solid #405363;
}
.affected-list {
  max-height: 18rem;
  overflow: auto;
  margin: 0.2rem 0 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  white-space: pre;
}

/* ---- Misc ---------------------------------------------------------------- */
.m-center { text-align: center; }
.m-small { font-size: 0.85rem; }
.m-fullwidth { width: 100%; }
@media screen and (max-width: 575px) {
  .findings-table .col-expand { display: none; }
}
