/*
    Own status page components. Chrome (nav, header, bg) comes from
    uptime.css; this file only styles what the new page adds. Tokens
    follow the site: #0a0a0f ground, violet #8b5cf6 accent, Inter.

    Status colors (reserved, always paired with an icon or label):
      up #3bf75b · down #ed4245 · degraded/partial #faa61a
    Categorical series (locations, fixed order, validated for CVD on
    this surface): #8b5cf6 #0891b2 #d97706 #db2777
*/

.own-status #app {
    width: min(1060px, 92%);
    margin: 0 auto;
    padding: 28px 0 40px;
    flex: 1;
}

/* author display rules (e.g. .monitors{display:flex}) silently beat
   the UA's [hidden]{display:none} - the router relies on hidden to
   swap list/detail views, so make it always win */
.own-status [hidden] {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Announcement banner (posted in the Hetrix dashboard)                */
/* ------------------------------------------------------------------ */

.announce {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 14px 17px;
    border-radius: 11px;
    border: 1px solid;
    margin-bottom: 18px;
    font-size: 0.9rem;
}
.announce .an-ico { font-weight: 700; line-height: 1.45; }
.announce .an-text b { display: block; color: #fff; font-weight: 650; }
.announce .an-text p { margin: 3px 0 0; color: #c8c8d0; line-height: 1.55; }
.announce .an-text small { display: block; margin-top: 7px; color: #71717a; font-size: 0.76rem; }
.announce.positive { border-color: rgba(59, 247, 91, 0.25); background: rgba(59, 247, 91, 0.06); }
.announce.positive .an-ico { color: #3bf75b; }
.announce.info { border-color: rgba(139, 92, 246, 0.3); background: rgba(139, 92, 246, 0.07); }
.announce.info .an-ico { color: #a78bfa; }
.announce.warning { border-color: rgba(250, 166, 26, 0.3); background: rgba(250, 166, 26, 0.06); }
.announce.warning .an-ico { color: #faa61a; }
.announce.critical { border-color: rgba(237, 66, 69, 0.3); background: rgba(237, 66, 69, 0.07); }
.announce.critical .an-ico { color: #ed4245; }

/* ------------------------------------------------------------------ */
/* Global card: aggregated status + stats + the world map              */
/* ------------------------------------------------------------------ */

.global-card {
    margin-bottom: 22px;
    padding: 20px 22px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.global-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.global-stats { display: flex; flex-wrap: wrap; }
.gstat { padding: 0 22px; border-left: 1px solid rgba(255, 255, 255, 0.07); }
.gstat:first-child { border-left: none; padding-left: 0; }
.gstat .g-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #71717a;
}
.gstat .g-value {
    display: block;
    margin-top: 3px;
    font-size: 1.3rem;
    font-weight: 650;
    letter-spacing: -0.4px;
    color: #e4e4e7;
    font-variant-numeric: tabular-nums;
}
.gstat .g-value i { font-style: normal; font-size: 0.9rem; color: #71717a; font-weight: 500; }
.gstat .g-ok { color: #3bf75b; }
.gstat .g-bad { color: #ed4245; }
.gstat .g-warn { color: #faa61a; }

.overview-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #e4e4e7;
}

.overview-banner .ov-text b { display: block; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.3px; color: #fff; }
.overview-banner .ov-text small { display: block; margin-top: 3px; color: #71717a; font-size: 0.78rem; font-weight: 400; }

.ov-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #52525b;
    flex-shrink: 0;
}

.overview-banner.ok .ov-dot { background: #3bf75b; box-shadow: 0 0 12px rgba(59, 247, 91, 0.5); }
.overview-banner.bad .ov-dot { background: #ed4245; box-shadow: 0 0 12px rgba(237, 66, 69, 0.55); }
.overview-banner.warn .ov-dot { background: #faa61a; box-shadow: 0 0 12px rgba(250, 166, 26, 0.5); }

/* source badge reuses .status-badge from uptime.css; recolor by mode */
.status-badge.src-scrape { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }
.status-badge.src-probe { background: rgba(250, 166, 26, 0.12); color: #faa61a; }
.status-badge.src-stale { background: rgba(237, 66, 69, 0.12); color: #ed4245; }

/* ------------------------------------------------------------------ */
/* Monitor cards                                                       */
/* ------------------------------------------------------------------ */

.monitors {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* waffle-style card: header row, full-width tick bar, caption,
   expandable location grid */
.mon-card2 {
    padding: 16px 20px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    transition: border-color 0.15s ease;
}
.mon-card2:hover { border-color: rgba(139, 92, 246, 0.35); }
.mon-card2.open { border-color: rgba(139, 92, 246, 0.45); }

.mon-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mon-headlink { display: flex; align-items: center; gap: 11px; min-width: 0; text-decoration: none; color: inherit; }
.mon-headlink:hover .mon-name { color: #a78bfa; }
.mon-headlink:focus-visible { outline: 2px solid rgba(139, 92, 246, 0.6); outline-offset: 3px; border-radius: 6px; }

.mon-chip {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a1a1aa;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.mon-since { color: #71717a; font-size: 0.76rem; white-space: nowrap; }

.mon-headright { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mon-word { font-size: 0.82rem; font-weight: 650; }
.mon-word.up { color: #3bf75b; }
.mon-word.down { color: #ed4245; }
.mon-word.degraded { color: #faa61a; }
.mon-word.other { color: #a1a1aa; }

/* right-chevron link into the monitor's full report */
.chev {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #a1a1aa;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.chev:hover { color: #a78bfa; border-color: rgba(139, 92, 246, 0.5); }
.chev:focus-visible { outline: 2px solid rgba(139, 92, 246, 0.6); }

/* the tick bar */
.tick-bar { display: flex; gap: 3px; height: 30px; align-items: stretch; }
.tick {
    flex: 1;
    min-width: 3px;
    border-radius: 3px;
    background: #26262e;
}
.tick.up { background: #1f9e42; }
.tick.partial { background: #faa61a; }
.tick.down { background: #ed4245; }
.tick:hover, .tick:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.4); outline-offset: 1px; }

.tick-caption {
    display: flex;
    justify-content: space-between;
    color: #71717a;
    font-size: 0.72rem;
    margin-top: 8px;
}

/* per-location cards (report view, under the map) */
.detail-locs { margin-top: 16px; }
.loc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.loc-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 11px;
    padding: 13px 15px;
}
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lc-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; color: #e4e4e7; }
.lc-ico { font-size: 0.8rem; font-weight: 700; }
.lc-ico.up { color: #3bf75b; }
.lc-ico.down { color: #ed4245; }
.lc-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.lc-badge.up { background: rgba(59, 247, 91, 0.1); color: #3bf75b; }
.lc-badge.down { background: rgba(237, 66, 69, 0.14); color: #ed4245; }
.lc-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: #71717a; padding: 3px 0; }
.lc-row b { color: #d4d4d8; font-weight: 600; font-variant-numeric: tabular-nums; }
.lc-row b.fast { color: #3bf75b; }
.lc-row b.mid { color: #faa61a; }
.lc-row b.slow { color: #ed4245; }

.mon-id { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mon-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mon-dot.up { background: #3bf75b; box-shadow: 0 0 10px rgba(59, 247, 91, 0.45); }
.mon-dot.down { background: #ed4245; box-shadow: 0 0 10px rgba(237, 66, 69, 0.5); }
.mon-dot.degraded { background: #faa61a; box-shadow: 0 0 10px rgba(250, 166, 26, 0.5); }
.mon-dot.other { background: #71717a; }

@media (prefers-reduced-motion: no-preference) {
    .mon-dot.down { animation: pulse 1.6s ease-in-out infinite; }
    @keyframes pulse {
        50% { box-shadow: 0 0 2px rgba(237, 66, 69, 0.2); }
    }
}

.mon-name { font-weight: 600; font-size: 1rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s ease; }

/* ------------------------------------------------------------------ */
/* Backbone cloud providers (public Statuspage APIs, browser-fetched)  */
/* ------------------------------------------------------------------ */

.providers { margin-top: 26px; }

.providers-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
    margin-bottom: 12px;
}

.provider-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.prov-card {
    padding: 16px 20px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.prov-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.prov-name { font-weight: 600; font-size: 1rem; color: #fff; }
.prov-link {
    margin-left: auto;
    color: #71717a;
    font-size: 0.76rem;
    text-decoration: none;
    white-space: nowrap;
}
.prov-link:hover { color: #a78bfa; }

.prov-comps { display: flex; flex-direction: column; gap: 7px; }
.prov-comp { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.84rem; }
.prov-comp .pc-name { display: flex; align-items: center; gap: 9px; color: #a1a1aa; }
.prov-comp .pc-name .mon-dot { width: 8px; height: 8px; }
.prov-comp .mon-word { font-size: 0.78rem; }

.prov-incident {
    margin-top: 10px;
    padding: 8px 11px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.78rem;
    line-height: 1.45;
}
.prov-incident.warn { border-color: rgba(250, 166, 26, 0.3); background: rgba(250, 166, 26, 0.06); color: #faa61a; }
.prov-incident.bad { border-color: rgba(237, 66, 69, 0.3); background: rgba(237, 66, 69, 0.07); color: #ed4245; }
.prov-incident a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.prov-note { margin-top: 10px; color: #52525b; font-size: 0.72rem; }

/* ------------------------------------------------------------------ */
/* Detail view                                                         */
/* ------------------------------------------------------------------ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a1a1aa;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 7px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 18px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.back-link:hover {
    color: #fff;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.08);
}
.back-link:focus-visible { outline: 2px solid rgba(139, 92, 246, 0.6); outline-offset: 2px; }

.detail-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-head h2 { font-size: 1.5rem; font-weight: 650; color: #fff; letter-spacing: -0.3px; }

.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}
.status-pill.up { background: rgba(59, 247, 91, 0.1); color: #3bf75b; }
.status-pill.down { background: rgba(237, 66, 69, 0.12); color: #ed4245; }
.status-pill.degraded { background: rgba(250, 166, 26, 0.12); color: #faa61a; }
.status-pill.other { background: rgba(255, 255, 255, 0.06); color: #a1a1aa; }

.detail-sub { color: #71717a; font-size: 0.84rem; margin-bottom: 22px; }
.detail-sub a { color: #a78bfa; text-decoration: none; }
.detail-sub a:hover { text-decoration: underline; }

.panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.panel h3 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
    margin-bottom: 14px;
}

/* uptime stat tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.tile {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}
.tile .t-label { font-size: 0.72rem; color: #71717a; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.tile .t-value { font-size: 1.45rem; font-weight: 650; color: #e4e4e7; margin-top: 4px; letter-spacing: -0.5px; }
.tile .t-note { font-size: 0.72rem; color: #71717a; margin-top: 2px; }

/* world map — lives inside the global card, shared by the list
   (all systems) and detail (rescoped to that monitor) views */
.map-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.map-head h3 {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
    margin-bottom: 14px;
}
.map-scope { color: #71717a; font-size: 0.76rem; }
.map-scope b { color: #a78bfa; font-weight: 600; }
.map-scope a { color: #a78bfa; text-decoration: none; }
.map-scope a:hover { text-decoration: underline; }

.map-wrap { position: relative; }
.map-wrap svg { display: block; width: 100%; height: auto; border-radius: 8px; background: #0d0d14; }
.map-land { fill: #1d1d28; stroke: #2a2a38; stroke-width: 0.5; }
.map-grid { stroke: rgba(255, 255, 255, 0.03); }
.map-marker-dot { stroke: #0d0d14; stroke-width: 1.5; }
.map-marker-dot.up { fill: #3bf75b; }
.map-marker-dot.down { fill: #ed4245; }
.map-marker-dot.partial { fill: #faa61a; }

@media (prefers-reduced-motion: no-preference) {
    .map-marker-dot.down { animation: map-pulse 1.6s ease-in-out infinite; }
    @keyframes map-pulse {
        50% { opacity: 0.4; }
    }
}
.map-label { fill: #a1a1aa; font-family: 'Inter', sans-serif; }
.map-ping { font-weight: 600; fill: #e4e4e7; font-family: 'Inter', sans-serif; }

/* color swatch shared by tooltips and chart legends */
.loc-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; }

/* charts */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-axis { stroke: rgba(255, 255, 255, 0.08); }
.chart-gridline { stroke: rgba(255, 255, 255, 0.045); }
.chart-tick { font-size: 10.5px; fill: #71717a; font-family: 'Inter', sans-serif; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-hover-dot { stroke: #0d0d14; stroke-width: 1.5; }
.chart-crosshair { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 3 3; }
.chart-empty { color: #71717a; font-size: 0.84rem; padding: 18px 0; }

.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: #a1a1aa; }

.chart-tooltip {
    position: fixed;
    z-index: 300;
    background: rgba(16, 16, 24, 0.97);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.76rem;
    color: #d4d4d8;
    pointer-events: none;
    max-width: 260px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.chart-tooltip b { color: #fff; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }

/* monthly history rows */
.month-rows { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: rgba(139, 92, 246, 0.35) transparent; }
.month-rows::-webkit-scrollbar { width: 6px; }
.month-rows::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 3px; }
.month-rows::-webkit-scrollbar-track { background: transparent; }
.month-row { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 12px; font-size: 0.82rem; }
.month-row .m-label { color: #a1a1aa; }
.month-row .m-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); position: relative; overflow: hidden; }
.month-row .m-bar i {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    border-radius: 4px;
    background: #ed4245;
}
.month-row .m-pct { color: #e4e4e7; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.month-note { color: #71717a; font-size: 0.74rem; margin-top: 10px; }

/* footer */
.status-footer {
    margin-top: 26px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: #52525b;
    font-size: 0.76rem;
}
.status-footer a { color: #71717a; }

/* responsive */
@media (max-width: 760px) {
    .mon-chip, .mon-since { display: none; }
    .tick-bar .tick:nth-child(-n+45) { display: none; }  /* 45 days on small screens */
    .tick-caption span:first-child { visibility: hidden; }
    .month-row { grid-template-columns: 74px 1fr 74px; }
}
