/* =========================================================
   AyooCloud — página de status
   Usa as variáveis e componentes de style.css
   ========================================================= */

:root {
  --st-ok: #1fae5b;
  --st-ok-ink: #0d7a3e;
  --st-ok-wash: #e7f7ee;
  --st-warn: #e5a50a;
  --st-warn-ink: #8a5a00;
  --st-warn-wash: #fdf4dc;
  --st-down: #d92d20;
  --st-down-ink: #a8180f;
  --st-down-wash: #fdecea;
  --st-maint: var(--blue-strong);
  --st-maint-wash: var(--blue-wash);
  --st-none: #dbe2ea;
}

/* ---------- Cartão "Situação agora" ---------- */
.st-now {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--st-c, var(--line-strong));
  transition: border-color .4s;
}
.st-now::before {
  content: ""; position: absolute; z-index: -1; inset: 14px -14px -14px 14px;
  background: repeating-linear-gradient(135deg, var(--st-w, var(--blue-wash)) 0 2px, transparent 2px 9px);
  border: 1px solid var(--line);
  transition: background .4s;
}
.st-now.is-ok    { --st-c: var(--st-ok);   --st-w: var(--st-ok-wash); }
.st-now.is-warn  { --st-c: var(--st-warn); --st-w: var(--st-warn-wash); }
.st-now.is-down  { --st-c: var(--st-down); --st-w: var(--st-down-wash); }
.st-now.is-error { --st-c: var(--muted);   --st-w: var(--paper); }

.st-now__top { padding: 24px 24px 22px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: start; }
.st-now__beacon {
  grid-row: 1 / span 3; margin-top: 4px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--st-w, var(--paper));
  color: var(--st-c, var(--muted));
  transition: background-color .4s, color .4s;
}
.st-now__beacon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.st-now.is-ok .st-now__beacon { animation: stPulse 2.4s ease-out infinite; }
.st-now.is-loading .st-now__beacon svg { animation: stSpin 1s linear infinite; }
@keyframes stPulse { 0% { box-shadow: 0 0 0 0 rgba(31,174,91,.35); } 70% { box-shadow: 0 0 0 14px rgba(31,174,91,0); } 100% { box-shadow: 0 0 0 0 rgba(31,174,91,0); } }
@keyframes stSpin { to { transform: rotate(360deg); } }

.st-now__k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.st-now__title { display: block; font-family: var(--f-display); font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); }
.st-now__sub { font-size: 14px; color: var(--muted); margin-top: 4px; }

.st-now__count { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed var(--line-strong); }
.st-now__count div { padding: 16px 12px 16px 24px; }
.st-now__count div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.st-now__count b { display: block; font-family: var(--f-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.st-now__count span { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.st-now__count span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); flex: 0 0 8px; }
.st-now__count .c-ok   { --dot: var(--st-ok); }
.st-now__count .c-warn { --dot: var(--st-warn); }
.st-now__count .c-down { --dot: var(--st-down); }


/* Legenda no hero */
.st-legend { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.st-legend li { display: inline-flex; align-items: center; gap: 8px; }
.st-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ---------- Seções ---------- */
.st-section { padding: clamp(56px, 8vw, 96px) 0; }

/* ---------- Avisos ---------- */
.st-notices { display: grid; gap: 12px; }
.st-notice {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 20px 22px; background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--line-strong));
}
.st-notice__body { flex: 1; min-width: 0; }
.st-notice__body > * + * { margin-top: 4px; }
.st-notice__tag { display: block; }
.st-notice--incidente  { --c: var(--st-down); }
.st-notice--manutencao { --c: var(--st-maint); }
.st-notice--resolvido  { --c: var(--st-ok); }
.st-notice__ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); }
.st-notice__ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-notice__tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--c); font-weight: 500; }
.st-notice h3 { font-size: 1.2rem; font-weight: 650; }
.st-notice p { color: var(--muted); font-size: 15px; max-width: 760px; }
.st-notice__when { margin-top: 4px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.st-empty {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 15px; background: var(--white);
}
.st-empty svg { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: var(--st-ok); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-empty strong { color: var(--ink); font-weight: 600; }

/* ---------- Filtros ---------- */
.st-filters { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.st-filters::-webkit-scrollbar { display: none; }
.st-filters button { position: relative; padding: 12px 16px; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.st-filters button small { font-family: var(--f-mono); font-size: 11px; margin-left: 4px; color: var(--muted); }
.st-filters button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue-strong); transform: scaleX(0); transition: transform .25s; }
.st-filters button[aria-pressed="true"] { color: var(--ink); }
.st-filters button[aria-pressed="true"]::after { transform: scaleX(1); }
.st-filters button:hover { color: var(--ink); }

/* ---------- Grupos (Dedicados / Jogos) ---------- */
.st-group + .st-group { margin-top: clamp(40px, 6vw, 64px); }
.st-group__head { display: flex; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--ink); }
.st-group__head h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 800; letter-spacing: -0.02em; }
.st-group__head p { font-size: 14px; color: var(--muted); }

/* ---------- Cartões dos servidores ---------- */
.st-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.st-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  animation: stCardIn .4s ease both;
}
.st-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 36px -24px rgba(6,33,63,.28); }
.st-card.is-down { border-color: color-mix(in srgb, var(--st-down) 45%, white); }
.st-card.is-warn { border-color: color-mix(in srgb, var(--st-warn) 55%, white); }
@keyframes stCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.st-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; }
.st-card__name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-card__loc { flex: 0 0 auto; font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--blue-strong); border: 1px solid currentColor; padding: 3px 7px; border-radius: var(--radius); }
.st-card h4 { font-family: var(--f-display); font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.08; overflow-wrap: anywhere; }
.st-card__where { font-size: 13px; color: var(--muted); margin-top: 2px; }

.st-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--w); color: var(--k); }
.st-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.st-pill--ok   { --c: var(--st-ok);   --w: var(--st-ok-wash);   --k: var(--st-ok-ink); }
.st-pill--warn { --c: var(--st-warn); --w: var(--st-warn-wash); --k: var(--st-warn-ink); }
.st-pill--down { --c: var(--st-down); --w: var(--st-down-wash); --k: var(--st-down-ink); }
.st-pill--ok i { animation: stBlink 2s ease-in-out infinite; }
.st-pill--down i { animation: stBlink 1s ease-in-out infinite; }
@keyframes stBlink { 50% { opacity: .35; } }

.st-alert { margin: 0 22px 18px; padding: 12px 14px; font-size: 14px; background: var(--st-down-wash); color: var(--st-down-ink); border-left: 3px solid var(--st-down); }
.st-alert--warn { background: var(--st-warn-wash); color: var(--st-warn-ink); border-left-color: var(--st-warn); }

.st-hist { padding: 16px 22px 20px; margin-top: auto; border-top: 1px solid var(--line); }
.st-hist__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.st-hist__top b { color: var(--ink); font-weight: 600; font-size: 14px; }
.st-bars { display: flex; gap: 1px; height: 30px; align-items: stretch; cursor: crosshair; touch-action: pan-y; }
.st-bars i { flex: 1 1 0; min-width: 0; border-radius: 1px; background: var(--st-none); cursor: pointer; transition: transform .15s, opacity .15s; transform-origin: bottom; }
.st-bars i.g { background: var(--st-ok); }
.st-bars i.y { background: var(--st-warn); }
.st-bars i.r { background: var(--st-down); }
.st-bars i.is-on { transform: scaleY(1.18); }
.st-bars:hover i:not(.is-on) { opacity: .55; }
.st-hist__axis { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.st-hist__axis .d45 { display: none; }

/* Esqueleto enquanto carrega */
.st-skel { height: 236px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--white) 0%, var(--paper) 40%, var(--white) 80%) 0 0 / 300% 100%; animation: stShimmer 1.4s linear infinite; }
@keyframes stShimmer { to { background-position: -150% 0; } }

.st-fail { grid-column: 1 / -1; padding: 28px; background: var(--white); border: 1px dashed var(--line-strong); color: var(--muted); }
.st-fail strong { display: block; color: var(--ink); font-family: var(--f-display); font-size: 1.2rem; margin-bottom: 6px; }
.st-fail .btn { margin-top: 16px; }

.st-scope { margin-top: 20px; font-size: 14px; color: var(--muted); max-width: 820px; }

/* Dica das barrinhas */
.st-tip {
  position: absolute; z-index: 70; pointer-events: none;
  min-width: 190px; max-width: 250px; padding: 10px 12px;
  background: var(--navy); color: #dbe7f3; font-size: 13px; line-height: 1.4;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.45);
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .12s, transform .12s;
}
.st-tip.is-on { opacity: 1; transform: translate(-50%, 0); }
.st-tip strong { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.st-tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: var(--navy); transform: rotate(45deg); }

/* Mini amostras na seção "Entenda" */
.st-sample { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.st-sample .st-pill { font-size: 12px; }
.st-sample-bars { display: flex; gap: 2px; height: 24px; margin-top: 14px; max-width: 260px; }
.st-sample-bars i { flex: 1; border-radius: 1px; background: var(--st-ok); }
.st-sample-bars i.y { background: var(--st-warn); }
.st-sample-bars i.r { background: var(--st-down); }
.st-sample-bars i.n { background: var(--st-none); }

@media (prefers-reduced-motion: reduce) {
  .st-now.is-ok .st-now__beacon, .st-pill i, .st-card, .st-skel { animation: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .st-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .st-now__top { padding: 20px 18px 18px; gap: 4px 14px; }
  .st-now__beacon { width: 38px; height: 38px; }
  .st-now__count div { padding: 14px 8px 14px 18px; }
  .st-now__count div + div { padding-left: 12px; }
  .st-now__count b { font-size: 1.6rem; }
  .st-now::before { inset: 10px -10px -10px 10px; }

  .st-card__head { padding: 18px 18px 14px; flex-direction: column; gap: 12px; }
  .st-alert { margin: 0 18px 16px; }
  .st-hist { padding: 14px 18px 18px; }
  /* No celular, mostra só os últimos 45 dias para as barrinhas não ficarem finas demais */
  .st-bars i:nth-child(-n+45) { display: none; }
  .st-hist__axis .d90 { display: none; }
  .st-hist__axis .d45 { display: inline; }
  .st-notice { padding: 18px; gap: 14px; }
}
