/* =========================================================================
   Shared premium theme for the connectivity tool family:
     /traceroute  /port-checker  /server-latency-checker
   All three share this one stylesheet and the ".nettool-page" root class so
   the three tools read as one consistent product instead of three
   independently-designed pages. Structure mirrors dns-tools-shared.css
   (hero / search-row / summary-grid / main-grid / panel / data-table), with
   a fresh sky/cyan palette so this family is visually distinct from the
   indigo DNS tools, the teal IP tools and the blue security tools.
   ========================================================================= */

.nettool-page {
    --net-primary: #0369a1;
    --net-primary-dark: #0c4a6e;
    --net-primary-soft: #e0f2fe;
    --net-accent: #0891b2;
    --net-accent-soft: #ecfeff;
    --net-text: #0f2436;
    --net-muted: #64748b;
    --net-border: #dbe7f0;
    --net-panel: #ffffff;
    --net-page: #f5f9fc;

    --success: #109447;
    --success-soft: #effbf4;
    --warning: #d97706;
    --warning-soft: #fff7ed;
    --danger: #d92d20;
    --danger-soft: #fff1f0;
    --info: #2563eb;
    --info-soft: #eff6ff;

    --shadow: 0 14px 38px rgba(3, 105, 161, 0.09);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

.nettool-page * { box-sizing: border-box; }

.nettool-page {
    color: var(--net-text);
    background:
        radial-gradient(circle at 12% 0%, rgba(3, 105, 161, 0.10), transparent 29%),
        radial-gradient(circle at 90% 9%, rgba(8, 145, 178, 0.08), transparent 22%),
        linear-gradient(180deg, #ffffff 0, var(--net-page) 430px);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.nettool-page button, .nettool-page input, .nettool-page select { font: inherit; }
.nettool-page button { cursor: pointer; }
.nettool-page code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.nettool-page a { color: inherit; }

/* --------------------------------------------------------------- shell -- */
.nettool-page .page-shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }

.nettool-page .hero {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border: 1px solid #d3e3ee;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 88% 20%, rgba(8, 145, 178, 0.14), transparent 24%),
        linear-gradient(135deg, #f9fdff 0%, #e9f3f9 100%);
    box-shadow: var(--shadow);
}
.nettool-page .hero::after {
    content: "";
    position: absolute; right: -72px; top: -92px;
    width: 295px; height: 295px;
    border: 34px solid rgba(255,255,255,0.55);
    border-radius: 50%;
}
.nettool-page .hero-heading { position: relative; z-index: 2; display: flex; align-items: center; gap: 20px; max-width: 1080px; }
.nettool-page .hero-icon {
    width: 82px; height: 82px; flex: 0 0 82px;
    display: grid; place-items: center;
    border-radius: 50%; color: #fff;
    background: linear-gradient(145deg, #38bdf8, var(--net-primary-dark));
    border: 8px solid rgba(255,255,255,0.86);
    box-shadow: 0 14px 30px rgba(3,105,161,0.26);
}
.nettool-page .hero-icon svg { width: 42px; height: 42px; }
.nettool-page h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.45rem); letter-spacing: -0.045em; line-height: 1.05; }
.nettool-page .hero-copy p { margin: 10px 0 0; color: #475467; font-size: 1.05rem; line-height: 1.6; }

.nettool-page .search-row {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px; margin-top: 28px;
}
.nettool-page .search-row.no-secondary { grid-template-columns: minmax(0, 1fr) auto; }
.nettool-page .input-wrap { position: relative; }
.nettool-page .input-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.nettool-page .domain-input {
    width: 100%; height: 58px; padding: 0 18px 0 49px;
    border: 1px solid #c9dce9; border-radius: 14px;
    outline: none; color: #16283a; background: #fff;
    box-shadow: 0 4px 14px rgba(16,24,40,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nettool-page .domain-input:focus { border-color: var(--net-primary); box-shadow: 0 0 0 4px rgba(3,105,161,0.13); }

.nettool-page .type-select {
    height: 58px; padding: 0 40px 0 16px;
    border: 1px solid #c9dce9; border-radius: 14px;
    color: #16283a; background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23276487'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
    cursor: pointer;
}
.nettool-page .type-select:focus { border-color: var(--net-primary); box-shadow: 0 0 0 4px rgba(3,105,161,0.13); outline: none; }

.nettool-page .primary-btn, .nettool-page .secondary-btn { min-height: 58px; padding: 0 22px; border-radius: 14px; font-weight: 850; }
.nettool-page .primary-btn {
    border: 0; color: #fff;
    background: linear-gradient(135deg, var(--net-primary), var(--net-primary-dark));
    box-shadow: 0 11px 22px rgba(3,105,161,0.24);
}
.nettool-page .secondary-btn { border: 1px solid #c2d6e4; color: var(--net-primary-dark); background: #fff; }
.nettool-page .primary-btn:disabled, .nettool-page .secondary-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.nettool-page .helper-row {
    position: relative; z-index: 2;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px;
    margin-top: 13px; color: var(--net-muted); font-size: 0.84rem;
}
.nettool-page .message { display: none; position: relative; z-index: 2; margin-top: 13px; padding: 11px 13px; border-radius: 10px; font-size: 0.9rem; }
.nettool-page .message.show { display: block; }
.nettool-page .message.success { color: var(--success); background: var(--success-soft); border: 1px solid #b9e3c8; }
.nettool-page .message.error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f4c6c1; }
.nettool-page .message.warning { color: var(--warning); background: var(--warning-soft); border: 1px solid #f6dcb3; }

.nettool-page .loading-line { display: none; position: relative; z-index: 2; height: 4px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: rgba(3,105,161,0.12); }
.nettool-page .loading-line.show { display: block; }
.nettool-page .loading-line::after { content: ""; display: block; width: 34%; height: 100%; border-radius: inherit; background: var(--net-primary); animation: nettool-loading 1.1s ease-in-out infinite; }
@keyframes nettool-loading { from { transform: translateX(-110%); } to { transform: translateX(310%); } }

.nettool-page .empty-state { margin-top: 18px; padding: 36px 22px; border: 1px dashed #cadced; border-radius: var(--radius-lg); color: var(--net-muted); background: rgba(255,255,255,0.72); text-align: center; }

.nettool-page .results { display: none; margin-top: 18px; }
.nettool-page .results.show { display: block; }

/* ------------------------------------------------------- port presets --- */
.nettool-page .chip-row { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.nettool-page .port-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 999px; border: 1px solid #c9dce9;
    background: #fff; color: #275874; font-size: 0.8rem; font-weight: 800;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nettool-page .port-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #b7cddb; }
.nettool-page .port-chip.is-on { background: var(--net-primary); border-color: var(--net-primary); color: #fff; }
.nettool-page .port-chip.is-on .dot { background: #bfe6ff; }

/* --------------------------------------------------------------- probe locations chip (Traceroute) -- */
.nettool-page .location-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; border-radius: 999px; border: 1px solid #c9dce9;
    background: #fff; color: #275874; font-size: 0.82rem; font-weight: 800;
}
.nettool-page .location-chip.is-active { background: var(--net-primary); border-color: var(--net-primary); color: #fff; }

/* ------------------------------------------------------------ summary --- */
.nettool-page .summary-grid { display: grid; grid-template-columns: 1.18fr repeat(4, 1fr); gap: 14px; }
.nettool-page .card { border: 1px solid var(--net-border); border-radius: var(--radius-lg); background: rgba(255,255,255,0.97); box-shadow: 0 8px 26px rgba(16,24,40,0.045); }

.nettool-page .score-card {
    grid-row: span 2; min-height: 220px; padding: 25px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(circle at 85% 15%, rgba(8,145,178,0.11), transparent 25%), linear-gradient(145deg, #fff, var(--net-primary-soft));
}
.nettool-page .score-ring {
    --score: 0;
    width: 112px; height: 112px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at center, #fff 62%, transparent 63%), conic-gradient(var(--ring-color, var(--success)) calc(var(--score) * 1%), #e4eef5 0);
    box-shadow: inset 0 0 0 1px #d7e6ef;
}
.nettool-page .score-number { font-size: 1.8rem; font-weight: 900; }
.nettool-page .score-label { margin: 16px 0 5px; font-size: 1.17rem; font-weight: 900; }
.nettool-page .score-copy { margin: 0; color: var(--net-muted); font-size: 0.88rem; line-height: 1.5; }

/* A status-card is the non-numeric equivalent of the score-card - a big status badge instead of a
   percentage ring, for results that are categorical (Open/Closed/Reachable) rather than a 0-100
   score. */
.nettool-page .status-card {
    grid-row: span 2; min-height: 220px; padding: 25px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: radial-gradient(circle at 85% 15%, rgba(8,145,178,0.11), transparent 25%), linear-gradient(145deg, #fff, var(--net-primary-soft));
}
.nettool-page .status-icon {
    width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%;
    font-size: 2rem; font-weight: 900; color: #fff;
    background: var(--ring-color, var(--success));
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.nettool-page .metric-card { min-height: 103px; padding: 18px; display: flex; align-items: center; gap: 14px; }
.nettool-page .metric-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 50%; color: var(--net-primary); background: var(--net-primary-soft); }
.nettool-page .metric-icon.cyan { color: var(--net-accent); background: var(--net-accent-soft); }
.nettool-page .metric-icon.green { color: var(--success); background: var(--success-soft); }
.nettool-page .metric-icon.orange { color: var(--warning); background: var(--warning-soft); }
.nettool-page .metric-icon.red { color: var(--danger); background: var(--danger-soft); }
.nettool-page .metric-label { display: block; color: #475467; font-size: 0.76rem; font-weight: 850; }
.nettool-page .metric-value { display: block; margin-top: 4px; font-size: 1.06rem; font-weight: 900; overflow-wrap: anywhere; }
.nettool-page .metric-sub { display: block; margin-top: 3px; color: var(--net-muted); font-size: 0.78rem; }

/* -------------------------------------------------------------- panels -- */
.nettool-page .main-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; margin-top: 16px; }
.nettool-page .main-grid.single { grid-template-columns: 1fr; }
.nettool-page .panel { padding: 20px; }
.nettool-page .panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1rem; }
.nettool-page .panel-title span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--net-primary); background: var(--net-primary-soft); }
.nettool-page .panel-sub { margin: -10px 0 16px; color: var(--net-muted); font-size: 0.82rem; }

/* ---- generic data table: column layout is set per-instance via the --cols custom property,
   e.g. style="--cols: 1.3fr 90px 1.4fr 90px" - one ruleset serves every table shape across all
   three tools instead of a bespoke grid-template-columns per table. ---- */
.nettool-page .data-table { overflow: hidden; border: 1px solid var(--net-border); border-radius: 13px; }
.nettool-page .data-head, .nettool-page .data-row { display: grid; grid-template-columns: var(--cols, 1fr); gap: 12px; align-items: center; }
.nettool-page .data-head { padding: 11px 14px; color: #375c76; background: #eef6fb; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.nettool-page .data-row { padding: 13px 14px; border-top: 1px solid #e7f0f6; background: #fff; }
.nettool-page .data-row:nth-child(even) { background: #f8fbfd; }
.nettool-page .cell-primary { font-weight: 900; font-size: 0.83rem; overflow-wrap: anywhere; }
.nettool-page .cell-meta { margin-top: 3px; color: var(--net-muted); font-size: 0.72rem; overflow-wrap: anywhere; }
.nettool-page .cell-muted { color: #475467; font-size: 0.79rem; overflow-wrap: anywhere; }
.nettool-page .cell-right { text-align: right; }
.nettool-page .cell-mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.76rem; overflow-wrap: anywhere; }

.nettool-page .status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; padding: 5px 8px; border-radius: 999px; font-size: 0.69rem; font-weight: 900; white-space: nowrap; }
.nettool-page .status-badge.good { color: var(--success); background: var(--success-soft); }
.nettool-page .status-badge.bad { color: var(--danger); background: var(--danger-soft); }
.nettool-page .status-badge.warn { color: var(--warning); background: var(--warning-soft); }
.nettool-page .status-badge.info { color: var(--info); background: var(--info-soft); }
.nettool-page .status-badge.neutral { color: var(--net-muted); background: #eef3f7; }

.nettool-page .finding-list { display: grid; gap: 10px; }
.nettool-page .finding { display: grid; grid-template-columns: 32px 1fr; gap: 11px; padding: 13px; border: 1px solid var(--net-border); border-radius: 13px; background: #fff; }
.nettool-page .finding-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.nettool-page .finding.good .finding-icon { color: var(--success); background: var(--success-soft); }
.nettool-page .finding.warning .finding-icon { color: var(--warning); background: var(--warning-soft); }
.nettool-page .finding.bad .finding-icon { color: var(--danger); background: var(--danger-soft); }
.nettool-page .finding.info .finding-icon { color: var(--info); background: var(--info-soft); }
.nettool-page .finding-copy { margin: 0; font-size: 0.84rem; line-height: 1.5; }

.nettool-page .detail-table { overflow: hidden; border: 1px solid var(--net-border); border-radius: 13px; }
.nettool-page .detail-row { display: grid; grid-template-columns: minmax(145px, 0.8fr) minmax(0, 1.2fr); gap: 16px; padding: 12px 14px; border-bottom: 1px solid #e7f0f6; }
.nettool-page .detail-row:last-child { border-bottom: 0; }
.nettool-page .detail-key { color: #344054; font-size: 0.79rem; font-weight: 850; }
.nettool-page .detail-value { min-width: 0; color: #475467; font-size: 0.79rem; overflow-wrap: anywhere; }

.nettool-page .raw-box { min-height: 175px; padding: 15px; border: 1px solid #d7e6ef; border-radius: 13px; color: #374151; background: #fafcfe; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.8rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

.nettool-page .note-card { margin-top: 16px; padding: 17px 18px; border-left: 4px solid var(--net-primary); border-radius: 11px; color: #123249; background: var(--net-primary-soft); font-size: 0.88rem; line-height: 1.6; }

.nettool-page .hidden { display: none !important; }
.nettool-page .empty-row { padding: 16px; color: var(--net-muted); font-size: 0.85rem; text-align: center; }

@media (max-width: 1150px) {
    .nettool-page .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .nettool-page .score-card, .nettool-page .status-card { grid-column: span 2; grid-row: auto; }
    .nettool-page .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .nettool-page .page-shell { width: min(100% - 20px, 1440px); padding-top: 10px; }
    .nettool-page .hero { padding: 24px 18px; }
    .nettool-page .hero-heading { align-items: flex-start; }
    .nettool-page .hero-icon { width: 60px; height: 60px; flex-basis: 60px; border-width: 6px; }
    .nettool-page .hero-icon svg { width: 30px; height: 30px; }
    .nettool-page .search-row, .nettool-page .search-row.no-secondary, .nettool-page .summary-grid { grid-template-columns: 1fr; }
    .nettool-page .score-card, .nettool-page .status-card { grid-column: auto; }
    .nettool-page .data-head { display: none; }
    .nettool-page .data-row { grid-template-columns: 1fr !important; gap: 4px; }
    .nettool-page .cell-right { text-align: left; }
    .nettool-page .detail-row { grid-template-columns: 1fr; gap: 5px; }
    .nettool-page .primary-btn, .nettool-page .secondary-btn { width: 100%; }
}
