/*
 * Copyright (c) 2026 William Chesher
 * SPDX-License-Identifier: MIT
 *
 * topology -- Live platform topology canvas page styles
 *               (audit 2026-04-27 S12a v0.1)
 */

.topology-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topology-stage {
    margin-top: 0.25rem;
}

.topology-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted, #888);
}
.topology-legend .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.topology-legend .legend-dot.healthy   { background: #4ade80; }
.topology-legend .legend-dot.degraded  { background: #fbbf24; }
.topology-legend .legend-dot.unhealthy { background: #f87171; }
.topology-legend .legend-dot.unknown   { background: #9ca3af; }

.topology-canvas-wrap {
    position: relative;
    width: 100%;
    height: 640px;
    max-height: 75vh;
    background: var(--bg-deep, var(--bg-secondary, #f8f8f8));
    border-radius: 8px;
    overflow: hidden;
}
html.dark-theme .topology-canvas-wrap {
    background: rgba(0, 0, 0, 0.25);
}

#topology-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.topology-tooltip {
    position: absolute;
    pointer-events: none;
    min-width: 200px;
    max-width: 280px;
    padding: 0.55rem 0.7rem;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border, var(--border-light, #eee));
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    font-size: 0.78rem;
    color: var(--text-primary, #333);
    z-index: 10;
}
html.dark-theme .topology-tooltip {
    background: #1f2940;
    border-color: #3a4a65;
    color: #e0e0e0;
}
.topology-tooltip .tt-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.topology-tooltip .tt-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.topology-tooltip .tt-kind {
    margin-left: auto;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #888);
}
.topology-tooltip .tt-status {
    color: var(--text-muted, #888);
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
}
.topology-tooltip .tt-detail {
    border-top: 1px solid var(--border, var(--border-light, #eee));
    padding-top: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.4;
}
html.dark-theme .topology-tooltip .tt-detail {
    border-top-color: #3a4a65;
}
.topology-tooltip .ttk {
    display: inline-block;
    min-width: 70px;
    color: var(--text-muted, #888);
    font-family: var(--font-mono, 'Roboto Mono', monospace);
}

.topology-empty {
    text-align: center;
    color: var(--text-muted, #888);
    padding: 4rem 1rem;
    font-size: 0.9rem;
}

.topology-hint {
    text-align: center;
    color: var(--text-muted, #888);
    font-size: 0.78rem;
    margin: 0.5rem 0 0;
}
.topology-hint kbd {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    background: var(--bg-secondary, #f5f5f5);
    border: 1px solid var(--border, var(--border-light, #eee));
    border-radius: 3px;
    font-family: var(--font-mono, 'Roboto Mono', monospace);
    font-size: 0.7rem;
}
html.dark-theme .topology-hint kbd {
    background: #2a3a55;
    border-color: #4a5a75;
    color: #e0e0e0;
}

@media (max-width: 768px) {
    .topology-canvas-wrap { height: 480px; }
    .topology-legend { display: none; }
}

/* ----- Embedded variant (home page hero, audit S12a v1.0 step) ----- */
/* Compact height + smaller summary cells so the canvas plays nicely
   above the existing dashboard-grid without dominating the viewport. */

.topology-embedded {
    margin-bottom: 1.25rem;
}

.topology-canvas-wrap.topology-canvas-embedded {
    height: 420px;
    max-height: 50vh;
}

.topology-embedded .aggregate-status-bar {
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.topology-embedded .aggregate-status-cell .value {
    font-size: 1.1rem;
}

.topology-embedded .aggregate-status-cell .label {
    font-size: 0.7rem;
}

.topology-embedded .aggregate-status-cell .icon {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.85rem;
}

.topology-open-full {
    margin-left: auto;
    color: var(--accent, #00d4ff);
    text-decoration: none;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.topology-open-full:hover {
    background: var(--accent-bg, rgba(0, 212, 255, 0.1));
    text-decoration: none;
}
