/* ============================================================
   PLAS STATUS PAGE — Design System
   Orchid palette · System UI · Dark/Light · Mobile-first
   Coordinato con plas.life/style.css
   ============================================================ */

/* ── 1. Custom Properties ── */
:root {
  --primary:    #A259FF;
  --primary-10: rgba(162, 89, 255, 0.10);
  --primary-20: rgba(162, 89, 255, 0.20);

  --bg:        #ffffff;
  --card:      #fafafa;
  --fg:        #0a0a0a;
  --fg-muted:  #71717a;
  --border:    rgba(0, 0, 0, 0.10);
  --border-md: rgba(0, 0, 0, 0.16);
  --glass-bg:  rgba(255, 255, 255, 0.72);
  --shadow:    0 1px 3px rgba(0,0,0,0.08), 0 4px 24px rgba(0,0,0,0.06);

  --success:   #22c55e;
  --success-bg: rgba(34, 197, 94, 0.08);
  --error:     #ef4444;
  --error-bg:  rgba(239, 68, 68, 0.08);
  --warn:      #f59e0b;
  --warn-bg:   rgba(245, 158, 11, 0.08);

  --r:  0.5rem;
  --rl: 1rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 64px;
}

.dark {
  --bg:        #000000;
  --card:      #0f0f0f;
  --fg:        #ededed;
  --fg-muted:  #71717a;
  --border:    rgba(255, 255, 255, 0.08);
  --border-md: rgba(255, 255, 255, 0.14);
  --glass-bg:  rgba(0, 0, 0, 0.72);
  --shadow:    0 1px 3px rgba(0,0,0,0.4), 0 4px 24px rgba(0,0,0,0.3);
}

/* ── 2. Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background 0.25s, color 0.25s;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }

/* ── 3. Layout ── */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) { .container { padding-inline: 2rem; } }

main { flex: 1; padding-top: calc(var(--header-h) + 3rem); padding-bottom: 4rem; }

/* ── 4. Header ── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s, border-color 0.25s;
}

.header-inner {
  height: 100%;
  max-width: 100%;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
@media (min-width: 640px) { .header-inner { padding-inline: 2rem; } }

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.logo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.01em;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--fg-muted);
  transition: color 0.2s, background 0.2s;
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle:hover { color: var(--fg); background: var(--border); }

/* ── 5. Status Dots ── */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-checking { background: var(--fg-muted); opacity: 0.4; }
.dot-up       { background: var(--success); }
.dot-warn     { background: var(--warn); }
.dot-down     { background: var(--error); }

/* ── 6. Overall Status Card ── */
.overall-section { margin-bottom: 2.5rem; }

.overall-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--rl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

.overall-card.card-ok {
  background: var(--success-bg);
  border-color: rgba(34, 197, 94, 0.24);
}
.overall-card.card-issue {
  background: var(--error-bg);
  border-color: rgba(239, 68, 68, 0.24);
}

.overall-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.overall-indicator .status-dot {
  width: 13px;
  height: 13px;
  position: relative;
  z-index: 1;
}

/* Pulse ring animation */
.pulse-ring {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  opacity: 0;
}
.pulse-ok {
  background: var(--success);
  animation: pulse 2.2s ease-out infinite;
}
.pulse-issue {
  background: var(--error);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2);   opacity: 0;   }
}

.overall-text { display: flex; flex-direction: column; gap: 0.2rem; }

.overall-status {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.overall-updated {
  font-size: 0.8rem;
  color: var(--fg-muted);
  min-height: 1.1em;
}

/* ── 7. Component List ── */
.components-section { margin-bottom: 2rem; }

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.component-list {
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
  background: var(--card);
}

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.component-row:last-child { border-bottom: none; }
.component-row:hover { background: var(--border); }

.component-name {
  font-size: 0.95rem;
  font-weight: 450;
  color: var(--fg);
}

.component-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.component-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* ── 8. Legend ── */
.legend-section { margin-bottom: 2.5rem; }

.legend-list {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.legend-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ── 9. Contact ── */
.contact-section {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.contact-text {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

.contact-link {
  color: var(--primary);
  font-weight: 500;
  transition: opacity 0.15s;
}
.contact-link:hover { opacity: 0.75; }

/* ── 10. Footer ── */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: 100%;
  padding-inline: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
}

.footer-link {
  font-size: 0.8rem;
  color: var(--fg-muted);
  transition: color 0.15s;
}
.footer-link:hover { color: var(--primary); }

/* ── Utility ── */
.text-muted { color: var(--fg-muted); }
