/* xbom.wiki - Swiss Typography Clean */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: #FFFFFF;
    color: #111111;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.55;
}

/* Section Labels - Swiss uppercase mono */
.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #BDBDBD;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* Mono utility */
.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-feature-settings: 'tnum';
}

/* ========================================
   HERO ZONE
   ======================================== */
.hero {
    padding: 40px 32px;
    border-bottom: 1px solid #BDBDBD;
    background: #FFFFFF;
}

.hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.hero-left {
    flex: 1;
}

.hero-title {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #111111;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 4px;
}

.hero-sub {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #555555;
    margin-bottom: 16px;
}

/* Search */
.search-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-wrapper {
    position: relative;
    max-width: 440px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    border: 1px solid #BDBDBD;
    background: #FFFFFF;
    color: #111111;
    outline: none;
    transition: border-color 0.15s ease;
}

.search-input:focus {
    border-color: #111111;
}

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #BDBDBD;
    border-top: none;
    display: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.search-autocomplete.active {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'IBM Plex Mono', monospace;
    color: #111111;
    cursor: pointer;
    border-bottom: 1px solid #F7F7F7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-item:hover {
    background: #F7F7F7;
}

.autocomplete-item .ac-type {
    font-size: 11px;
    color: #555555;
}

/* Filter toggles */
.filter-toggles {
    display: flex;
    gap: 6px;
}

.toggle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    padding: 3px 10px;
    border: 1px solid #BDBDBD;
    color: #555555;
    cursor: pointer;
    background: #FFFFFF;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.toggle:hover {
    border-color: #111111;
    color: #111111;
}

.toggle.active {
    background: #111111;
    color: #FFFFFF;
    border-color: #111111;
}

/* Stats cluster */
.stats-cluster {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}

.stat {
    text-align: center;
}

.stat-val {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 20px;
    color: #111111;
    display: block;
    font-feature-settings: 'tnum';
    line-height: 1.2;
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #555555;
    letter-spacing: 0.02em;
}

/* ========================================
   COMPONENT REGISTRY
   ======================================== */
.registry {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px;
}

.bom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bom-table th {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #111111;
    color: #111111;
    white-space: nowrap;
    user-select: none;
}

.bom-table th.sortable {
    cursor: pointer;
    position: relative;
}

.bom-table th.sortable:hover {
    color: #555555;
}

.sort-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #BDBDBD;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.sort-arrow.asc {
    transform: rotate(180deg);
    border-top-color: #111111;
}

.sort-arrow.desc {
    border-top-color: #111111;
}

.bom-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #BDBDBD;
    vertical-align: middle;
}

.bom-table tbody tr:not(.expandable-row):nth-child(4n+1) {
    background: #F7F7F7;
}

.bom-table tbody tr:not(.expandable-row) {
    cursor: pointer;
    transition: background 0.15s ease;
}

.bom-table tbody tr:not(.expandable-row):hover {
    background: #EEEEEE;
}

/* Column rules */
.bom-table td:not(:last-child),
.bom-table th:not(:last-child) {
    border-right: 1px solid #EEEEEE;
}

/* Critical marker */
.critical-marker {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #E53935;
    margin-right: 6px;
    vertical-align: middle;
}

/* Version pill */
.version-pill {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    border: 1px solid #BDBDBD;
    border-radius: 999px;
    padding: 1px 8px;
    color: #555555;
    margin-left: 4px;
    white-space: nowrap;
}

/* Risk badges */
.risk-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.risk-red {
    background: #E53935;
    color: #FFFFFF;
}

.risk-orange {
    background: #FB8C00;
    color: #FFFFFF;
}

.risk-green {
    background: #43A047;
    color: #FFFFFF;
}

/* Expandable rows */
.expandable-row {
    display: none;
}

.expandable-row.open {
    display: table-row;
}

.expandable-row td {
    padding: 0;
    border-bottom: 1px solid #BDBDBD;
    background: #F7F7F7;
}

/* Dependency tree */
.dep-tree {
    padding: 12px 16px;
}

.dep-tree > details > summary {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #111111;
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
}

.dep-tree > details > summary::-webkit-details-marker {
    display: none;
}

.dep-tree > details > summary::before {
    content: "\25B6";
    display: inline-block;
    margin-right: 8px;
    font-size: 10px;
    color: #555555;
    transition: transform 0.2s ease;
}

.dep-tree > details[open] > summary::before {
    transform: rotate(90deg);
}

.tree-content {
    padding: 8px 0 4px 0;
}

.tree-node {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #555555;
    padding: 3px 0;
    position: relative;
}

.tree-node.depth-0 {
    padding-left: 0;
    color: #111111;
    font-weight: 400;
}

.tree-node.depth-1 {
    padding-left: 24px;
    border-left: 1px solid #BDBDBD;
    margin-left: 6px;
}

.tree-node.depth-2 {
    padding-left: 48px;
    border-left: 1px solid #BDBDBD;
    margin-left: 6px;
}

.tree-node details summary {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #555555;
    cursor: pointer;
    list-style: none;
}

.tree-node details summary::-webkit-details-marker {
    display: none;
}

.tree-node details summary::before {
    content: "\25B6";
    display: inline-block;
    margin-right: 6px;
    font-size: 9px;
    color: #BDBDBD;
    transition: transform 0.2s ease;
}

.tree-node details[open] summary::before {
    transform: rotate(90deg);
}

.tree-label {
    color: #111111;
}

/* ========================================
   RISK ASSESSMENT MATRIX
   ======================================== */
.analysis {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

.risk-matrix {
    max-width: 420px;
}

.matrix-header {
    display: grid;
    grid-template-columns: 80px repeat(3, 80px);
    gap: 2px;
    margin-bottom: 2px;
}

.matrix-col-head {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #555555;
    text-align: center;
    padding: 4px 0;
}

.matrix-row {
    display: grid;
    grid-template-columns: 80px repeat(3, 80px);
    gap: 2px;
    margin-bottom: 2px;
}

.matrix-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #555555;
    display: flex;
    align-items: center;
}

.matrix-cell {
    width: 80px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    font-feature-settings: 'tnum';
    transition: opacity 0.15s ease;
}

.matrix-cell:hover {
    opacity: 0.85;
}

.matrix-cell.high {
    background: #E53935;
    color: #FFFFFF;
}

.matrix-cell.med {
    background: #FB8C00;
    color: #FFFFFF;
}

.matrix-cell.low {
    background: #43A047;
    color: #FFFFFF;
}

/* ========================================
   DEPENDENCY GRAPH
   ======================================== */
.graph {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

.graph-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.graph-legend-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-critical {
    background: #E53935;
}

.legend-medium {
    background: #FB8C00;
}

.legend-low {
    background: #43A047;
}

.graph-panel {
    background: #F7F7F7;
    padding: 16px;
    border: 1px solid #BDBDBD;
}

.dep-graph {
    width: 100%;
    height: auto;
    display: block;
}

.graph-node {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.graph-node:hover circle {
    stroke-width: 3;
}

.graph-node:hover text {
    fill: #111111;
}

.graph-node.highlighted circle {
    stroke-width: 3.5;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.15));
}

.graph-edge {
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.graph-edge.highlighted {
    stroke-width: 2.5;
}

/* Node tooltip */
.node-tooltip {
    position: absolute;
    background: #FFFFFF;
    border: 1px solid #BDBDBD;
    padding: 8px 12px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #111111;
    pointer-events: none;
    z-index: 50;
    white-space: nowrap;
}

.node-tooltip .tt-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.node-tooltip .tt-detail {
    color: #555555;
    font-size: 11px;
}

/* ========================================
   VERSION COMPARISON
   ======================================== */
.version-compare {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

.compare-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.compare-select-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compare-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.compare-select {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    padding: 6px 10px;
    border: 1px solid #BDBDBD;
    background: #FFFFFF;
    color: #111111;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.compare-select:focus {
    border-color: #111111;
}

.compare-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 20px;
    background: #111111;
    color: #FFFFFF;
    border: 1px solid #111111;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.compare-btn:hover {
    background: #FFFFFF;
    color: #111111;
}

.compare-output {
    background: #F7F7F7;
    border: 1px solid #BDBDBD;
}

.diff-block {
    padding: 0;
}

.diff-header {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #111111;
    padding: 10px 16px;
    border-bottom: 1px solid #BDBDBD;
    background: #EEEEEE;
}

.diff-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    padding: 4px 16px;
    border-bottom: 1px solid #EEEEEE;
}

.diff-line.diff-add {
    background: rgba(67, 160, 71, 0.1);
    color: #43A047;
}

.diff-line.diff-remove {
    background: rgba(229, 57, 53, 0.1);
    color: #E53935;
}

.diff-line.diff-context {
    color: #555555;
}

.diff-summary {
    padding: 10px 16px;
    display: flex;
    gap: 16px;
    border-top: 1px solid #BDBDBD;
}

.diff-stat {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 700;
}

.diff-stat-add {
    color: #43A047;
}

.diff-stat-remove {
    color: #E53935;
}

.diff-stat-changed {
    color: #FB8C00;
}

/* ========================================
   API REFERENCE
   ======================================== */
.reference {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px 32px;
}

.api-docs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #EEEEEE;
    transition: background 0.15s ease;
}

.api-endpoint:hover {
    background: #F7F7F7;
}

.api-method {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    min-width: 44px;
    text-align: center;
}

.api-method.get {
    background: #43A047;
    color: #FFFFFF;
}

.api-method.post {
    background: #FB8C00;
    color: #FFFFFF;
}

.api-path {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #111111;
    white-space: nowrap;
}

.api-desc {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #555555;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    border-top: 1px solid #BDBDBD;
    padding: 32px;
    margin-top: 16px;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
}

.footer-cols {
    display: flex;
    gap: 48px;
    margin-bottom: 16px;
}

.footer-col-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #111111;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.flink {
    display: block;
    font-size: 13px;
    color: #555555;
    text-decoration: none;
    margin-bottom: 4px;
    font-family: 'Inter', sans-serif;
    transition: color 0.15s ease;
}

.flink:hover {
    color: #111111;
}

.footer-copy {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #555555;
    padding-top: 16px;
    border-top: 1px solid #EEEEEE;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .hero {
        padding: 24px 16px;
    }

    .hero-inner {
        flex-direction: column;
        gap: 16px;
    }

    .stats-cluster {
        justify-content: flex-start;
        gap: 16px;
    }

    .registry,
    .analysis,
    .graph,
    .version-compare,
    .reference {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bom-table {
        font-size: 12px;
    }

    .bom-table th,
    .bom-table td {
        padding: 6px 8px;
    }

    .footer {
        padding: 24px 16px;
    }

    .footer-cols {
        flex-direction: column;
        gap: 16px;
    }

    .compare-controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .api-endpoint {
        flex-wrap: wrap;
        gap: 6px;
    }

    .api-desc {
        flex-basis: 100%;
        padding-left: 56px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 24px;
    }

    .filter-toggles {
        flex-wrap: wrap;
    }

    .bom-table th:nth-child(3),
    .bom-table td:nth-child(3) {
        display: none;
    }

    .matrix-header,
    .matrix-row {
        grid-template-columns: 60px repeat(3, 60px);
    }

    .matrix-cell {
        width: 60px;
        height: 36px;
        font-size: 12px;
    }
}
