/* SPDX-License-Identifier: Apache-2.0 */
/* SPDX-FileCopyrightText: 2026 ndaal Gesellschaft für Sicherheit in der Informationstechnik mbH & Co KG, Cologne */
/* App styles for the ndaal SBOM Auditor. Externalised from
   base.html so the Content-Security-Policy can drop style-src 'unsafe-inline'
   (audit 2.10). Carried over from the ndaal vulnerability-lookup-rs design. */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto/roboto-regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/roboto/roboto-bold.ttf') format('truetype');
}
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto-mono/roboto-mono-regular.ttf') format('truetype');
}
@font-face {
    font-family: 'Roboto Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/roboto-mono/roboto-mono-bold.ttf') format('truetype');
}
:root {
    --vl-accent: #0d6efd;
    --vl-critical: #dc3545;
    --vl-high: #fd7e14;
    --vl-medium: #ffc107;
    --vl-low: #198754;
    --vl-info: #0dcaf0;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
main {
    flex: 1;
}
.vuln-id {
    font-family: 'Roboto Mono', 'Courier New', Courier, monospace;
    font-weight: 600;
}
pre.json-block {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    padding: 1rem;
    overflow-x: auto;
    max-height: 60vh;
    font-size: 0.85rem;
}
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}
.brand-icon {
    color: var(--vl-accent);
}
/* Requirement-level badges on the palette of the reference
   design. House convention: MUSS is green (baseline you fulfil),
   KANN is red (optional, deviation risk), SOLLTE stays yellow. */
.severity-muss {
    background-color: var(--vl-low) !important;
    color: #fff !important;
}
.severity-sollte {
    background-color: var(--vl-medium) !important;
    color: #000 !important;
}
.severity-kann {
    background-color: var(--vl-critical) !important;
    color: #fff !important;
}
.level-erhoeht {
    background-color: var(--vl-high) !important;
    color: #000 !important;
}
.level-normal {
    background-color: var(--bs-secondary) !important;
    color: #fff !important;
}
.stat-card {
    border: none;
    border-radius: 0.75rem;
    transition: transform 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.6;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    border-bottom-width: 2px;
}
.search-hero {
    padding: 2rem 0;
}
.search-hero .form-control {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}
.navbar-blur {
    background-color: rgba(var(--bs-body-bg-rgb), 0.95);
    backdrop-filter: blur(10px);
}
.search-form-container { max-width: 600px; }
.pre-wrap { white-space: pre-wrap; }
.changelog-scroll { max-height: 70vh; overflow-y: auto; }
.description-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
footer {
    font-size: 0.8rem;
}
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: transparent;
}
#page-loader.loading {
    background: linear-gradient(90deg, var(--vl-accent), #6610f2, var(--vl-accent));
    background-size: 200% 100%;
    animation: loading-bar 1.5s ease infinite;
}
@keyframes loading-bar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Practices dropdown — 20 entries in a responsive multi-column
   mega-panel; pattern carried over from the reference design's
   dashboards dropdown (viewport-pinned, clamp width, Popper
   disabled via data-bs-display="static"). */
nav.navbar {
    position: relative;
    z-index: 10050;
}
.dropdown-menu.practices-dropdown {
    position: fixed !important;
    top: 3.5rem !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: clamp(13rem, calc(100vw - 2rem), 90rem) !important;
    min-width: 13rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 4.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    column-width: 16rem;
    column-gap: 0.75rem;
    column-fill: balance;
    z-index: 10060 !important;
}
.practices-dropdown .dropdown-item {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
.practices-dropdown > li {
    break-inside: avoid;
}
/* Settings dropdown: a viewport-pinned wide mega-panel that lays
   ALL framework toggles out as a grid (7 columns on a wide
   screen → ~25 rows for the full set), so every framework is
   visible at once. A sticky head carries the search box and the
   All / None / Reset actions. Same viewport-pinning pattern as
   the practices mega-dropdown. */
.settings-dropdown {
    position: fixed !important;
    top: 3.5rem !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: clamp(20rem, calc(100vw - 2rem), 96rem) !important;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    padding-top: 0;
    z-index: 10060 !important;
}
.settings-dropdown-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
    padding-top: 0.5rem;
}
/* 7 columns on wide screens; degrade gracefully on narrower ones. */
.settings-toggle-list {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.1rem 0.75rem;
    padding: 0 0.75rem 0.5rem;
}
@media (max-width: 1500px) {
    .settings-toggle-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .settings-toggle-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .settings-toggle-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.settings-toggle-item.filtered-out {
    display: none;
}
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    cursor: pointer;
    margin-bottom: 0;
    padding: 0.1rem 0.25rem;
    font-size: 0.8rem;
}
.settings-toggle:hover {
    background-color: var(--bs-tertiary-bg);
    border-radius: 0.25rem;
}
.settings-toggle-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.15;
}
.settings-toggle .form-check {
    flex: 0 0 auto;
    min-height: auto;
    padding-left: 0;
}
.settings-toggle .form-check-input {
    float: none;
    cursor: pointer;
}
/* Annotation rendered output — lay it out as a DIN A4 page so an
   uploaded graphic scales to the printable area instead of
   overflowing the editor pane or running off the printout. */
.annotation-rendered {
    max-width: 210mm;          /* A4 portrait content width */
    margin-inline: auto;
}
.annotation-rendered img,
.annotation-rendered svg {
    display: block;
    max-width: 100%;           /* never wider than the A4 content area */
    max-height: 297mm;         /* never taller than one A4 page */
    height: auto;
    margin: 0.75rem auto;
}
@media print {
    @page { size: A4 portrait; margin: 18mm; }
    .annotation-rendered { max-width: none; }
    .annotation-rendered img,
    .annotation-rendered svg {
        max-width: 100%;
        max-height: 261mm;     /* A4 height − 2×18mm margins */
    }
}
