/* File: Web/docs/styles.css
   Purpose: Shared stylesheet for Medulus web (header, cards, tables, footer).
   Author: Elytra Security (Medulus)
   Created: 2025-11-13
   Updated: 2025-11-13
   Change notes:
     - Consolidates base layout, header, card and table styles for all pages.
     - Introduces a shared black footer bar (.footer) used by index, cves, cve, about.
     - Does not alter header HTML structure; only styles existing classes.
*/

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

:root {
  --color-header-bg: #000000;
  --color-body-bg: #f7f6f3;
  --color-card-bg: #ffffff;
  --color-text-main: #111111;
  --color-text-muted: #555555;
  --color-accent: #2c7be5;
  --color-border-subtle: #e0ded8;
  --color-table-header: #efede8;
  --color-ok: #27ae60;
  --color-badge-bg: #f1fff4;
  --shadow-card: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.06);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-main);
  background: var(--color-body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.header {
  background: var(--color-header-bg);
  color: #ffffff;
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0.9rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.brand__logo {
  display: block;
  max-width: 300px;
  height: auto;
}

.nav {
  margin-left: 2rem;
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav__item {
  margin: 0;
}

.nav__link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.nav__link:hover,
.nav__link:focus {
  text-decoration: underline;
}

.nav__link--active {
  font-weight: 600;
  border-bottom: 2px solid #ffffff;
  padding-bottom: 0.1rem;
}

/* Layout */

.container {
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem 2rem;
}

.card {
  background: var(--color-card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}

.card--page {
  margin-top: 0.5rem;
}

.h1 {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
}

.h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.lead {
  margin: 0 0 1.5rem;
  font-size: 0.98rem;
}

.muted {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Home badges */

.badges {
  margin-top: 1rem;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.badge-label {
  min-width: 135px;
  font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #f2f2f2;
  color: #444;
}

.badge--ok {
  background: var(--color-badge-bg);
  color: var(--color-ok);
}

.badge--error {
  background: #fff4f4;
  color: #e74c3c;
}

.badge--pending {
  background: #f4f4f4;
  color: #777777;
}

/* CVE filters and status */

.filters {
  margin-bottom: 1rem;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

.filters__group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
  font-size: 0.9rem;
}

.filters__group label {
  font-weight: 500;
}

.filters__group select,
.filters__group input[type="search"] {
  border-radius: 4px;
  border: 1px solid var(--color-border-subtle);
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.filters__group--search {
  flex: 1 1 280px;
}

.filters__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.status-row {
  margin: 0.25rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.status {
  font-size: 0.86rem;
}

.status--info {
  color: var(--color-text-muted);
}

.status--error {
  color: #e74c3c;
}

/* Tables */

.table-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead {
  background: var(--color-table-header);
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.table th {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.table-link {
  color: var(--color-accent);
  text-decoration: none;
}

.table-link:hover,
.table-link:focus {
  text-decoration: underline;
}

.empty-state {
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

.pagination__label {
  color: var(--color-text-muted);
}

.btn {
  border-radius: 4px;
  border: 1px solid var(--color-border-subtle);
  padding: 0.35rem 0.8rem;
  font-size: 0.86rem;
  background: #f7f7f7;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Key/value detail list (cve.html) */

.kv-list {
  margin: 1rem 0 1.5rem;
}

.kv-row {
  display: flex;
  gap: 1rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed var(--color-border-subtle);
}

.kv-row:last-child {
  border-bottom: none;
}

.kv-row dt {
  width: 140px;
  font-weight: 600;
  font-size: 0.9rem;
}

.kv-row dd {
  margin: 0;
  font-size: 0.9rem;
}

/* Footer (shared black bar) */

.footer {
  background: #000000;
  color: #f5f5f5;
  margin-top: auto;
  padding: 1.25rem 0;
  font-size: 0.85rem;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2.5rem;
  justify-content: space-between;
}

.footer__block {
  max-width: 520px;
}

.footer__meta {
  color: #bbbbbb;
}

.footer__disclaimer {
  color: #d0d0d0;
}

/* Links */

a {
  color: var(--color-accent);
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .nav {
    margin-left: 0;
  }

  .filters__row {
    flex-direction: column;
    align-items: stretch;
  }

  .kv-row {
    flex-direction: column;
  }

  .kv-row dt {
    width: auto;
  }
}

