/* ============================================================
   NETWORK PAGE — Node list, status dots, panels
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
/* Mirrors the .mn-hero/.rm-hero aurora-hero pattern used on mining/roadmap
   for a consistent header treatment across pages. */
.network-hero {
    min-height: 20rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.5rem 4rem;
    text-align: center;
    margin-bottom: 2.5rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.network-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.network-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    color: var(--text-1);
    margin-bottom: 0.75rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.network-title .accent {
    color: var(--brand);
}

.network-subtitle {
    color: var(--text-2);
    font-size: 1rem;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.75;
}

/* ── Cards layout ─────────────────────────────────────────── */
.network-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
}

.network-card-wrap {
    flex: 1 1 340px;
    max-width: 520px;
    min-width: 0;
}

/* ── Panel ────────────────────────────────────────────────── */
/* Base surface/border/hover-lift comes from the shared card rule in
   design-system.css; this only overrides the accent + shape deltas. */
.network-panel {
    border-color: var(--brand-a20);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 100%;
}

.network-panel:hover {
    border-color: color-mix(in srgb, var(--brand) 50%, transparent);
}

/* ── Panel header ─────────────────────────────────────────── */
.network-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: color-mix(in srgb, var(--brand) 7%, transparent);
    border-bottom: 1px solid var(--brand-a20);
}

.network-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--brand);
    font-size: 0.95rem;
}

.network-panel-title-wrap {
    flex: 1;
    min-width: 0;
}

.network-panel-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
}

.network-panel-sub {
    font-size: 0.77rem;
    color: var(--text-3);
    margin-top: 0.15rem;
}

/* ── Count badge ──────────────────────────────────────────── */
.network-badge {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid var(--brand-glow);
    border-radius: var(--radius-full);
    padding: 0.2rem 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Panel body ───────────────────────────────────────────── */
.network-panel-body {
    padding: 0.5rem 0;
    min-height: 120px;
}

/* ── Node row ─────────────────────────────────────────────── */
.network-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

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

.network-row:hover {
    background: var(--surface-2);
}

/* ── Status dot ───────────────────────────────────────────── */
.net-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.net-dot.online  {
    background: var(--success);
    box-shadow: 0 0 6px var(--success-glow);
}
.net-dot.offline { background: var(--error); }
.net-dot.unknown { background: var(--text-3); }

/* ── Address ──────────────────────────────────────────────── */
.net-addr {
    font-family: 'Courier New', monospace;
    font-size: 0.83rem;
    color: var(--text-2);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Direction badge ──────────────────────────────────────── */
.net-dir {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.net-dir.out {
    background: var(--brand-dim);
    color: var(--brand);
    border: 1px solid var(--brand-glow);
}

.net-dir.in {
    background: var(--surface-2);
    color: var(--text-3);
    border: 1px solid var(--border);
}

/* ── Port badges ──────────────────────────────────────────── */
.net-ports {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.net-port {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
}

.net-port.tcp {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
}

.net-port.ssl {
    background: var(--brand-a06);
    color: var(--brand);
    border: 1px solid var(--brand-a20);
}

.net-port.unreachable {
    background: var(--surface-2);
    color: var(--text-3);
    border: 1px solid var(--border);
    text-decoration: line-through;
}

/* ── Skeleton loading ─────────────────────────────────────── */
.network-skeleton {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin: 0.75rem 1.5rem;
    animation: net-pulse 1.4s ease-in-out infinite;
}

.network-skeleton:nth-child(2) { width: 75%; animation-delay: 0.2s; }
.network-skeleton:nth-child(3) { width: 55%; animation-delay: 0.4s; }

@keyframes net-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ── Empty / error state ──────────────────────────────────── */
.network-empty {
    text-align: center;
    color: var(--text-3);
    font-size: 0.88rem;
    padding: 2rem 1.5rem;
}

/* ── Footer note ──────────────────────────────────────────── */
.network-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    color: var(--text-3);
    font-size: 0.85rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ── Refresh button ───────────────────────────────────────── */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
    background: transparent;
    color: var(--brand);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.refresh-btn:hover {
    background: var(--brand-a06);
    border-color: var(--brand);
}

.refresh-btn.spinning .fas {
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .network-hero {
        min-height: auto;
        padding: 4rem 1.25rem 3rem;
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 600px) {
    .network-title {
        font-size: 1.9rem;
    }

    .network-card-wrap {
        max-width: 100%;
    }

    .network-row {
        padding: 0.6rem 1rem;
    }

    .network-skeleton {
        margin: 0.75rem 1rem;
    }
}
