:root {
  --primary: #1e6cff;
  --primary-dark: #0f4fcf;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #313131;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --green: #2ea86e;
  --green-bg: #eaf5ef;
  --yellow: #f59e0b;
  --yellow-bg: #fef3c7;
  --red: #ef4444;
  --red-bg: #fee2e2;
  --gray: #9ca3af;
  --gray-bg: #f3f4f6;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand-group { display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.brand-name { font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.top-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.whatsapp-nav-link { display: inline-flex; align-items: center; text-decoration: none; transition: transform 0.2s; }
.whatsapp-nav-link:hover { transform: scale(1.1); text-decoration: none; }
.btn-contact {
  background: var(--gray-bg);
  color: var(--text) !important;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-contact:hover { background: #e5e7eb; text-decoration: none; }

/* Hero Banner (Ziwo Style) */
.hero-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #e9f7ef; /* light green background */
  border-radius: 24px;
  padding: 48px 24px;
  margin: 20px 0 40px;
}
.hero-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 650px;
}
.hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-size: 28px;
  margin-bottom: 24px;
}
.hero-title { 
  margin: 0 0 12px; 
  font-size: 36px; 
  font-weight: 600; 
  letter-spacing: -0.02em; 
  color: var(--green);
}
.hero-subtitle { 
  margin: 0 0 20px; 
  font-size: 15px; 
  color: var(--green);
  line-height: 1.5;
}
.hero-link {
  color: var(--green);
  font-weight: 500;
  text-decoration: none;
  font-size: 15px;
}
.hero-link:hover { text-decoration: underline; }

.hero-banner.degraded .hero-icon { background: var(--yellow); }
.hero-banner.degraded .hero-title, .hero-banner.degraded .hero-subtitle, .hero-banner.degraded .hero-link { color: #d97706; }
.hero-banner.degraded { background: var(--yellow-bg); }

.hero-banner.outage .hero-icon { background: var(--red); }
.hero-banner.outage .hero-title, .hero-banner.outage .hero-subtitle, .hero-banner.outage .hero-link { color: var(--red); }
.hero-banner.outage { background: var(--red-bg); }

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sections */
.section-title { font-size: 18px; font-weight: 600; margin: 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
  padding-bottom: 12px;
}

/* Services Section (Ziwo Single White Card Container) */
.services-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 40px;
}

/* System Status Header (Ziwo Style) */
.system-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
}
.system-status-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.system-status-date {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Legend */
.legend {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-flex; place-items: center; justify-content: center; color: white; font-size: 10px; font-style: normal; font-weight: bold; }
.dot.operational { background: var(--green); }
.dot.degraded { background: var(--yellow); }
.dot.maintenance { background: #d97706; }
.dot.outage { background: var(--red); }
.dot.unknown { background: var(--gray); }
.dot.operational::after { content: "✓"; }
.dot.degraded::after { content: "!"; }
.dot.maintenance::after { content: "🔧"; font-size: 8px; }

/* Accordion Layout */
.accordion-list {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
}
.accordion-group {
  border-bottom: 1px solid #f1f5f9;
}
.accordion-group:last-child {
  border-bottom: none;
}
.accordion-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.accordion-header:hover {
  background: #fafafa;
}
.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.accordion-title {
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
}
.accordion-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  transform: rotate(0deg); /* Points right (>) when collapsed */
}
.accordion-group.open .accordion-icon {
  transform: rotate(90deg); /* Points down (v) when expanded */
}
.accordion-content {
  display: none !important;
  padding: 8px 16px 20px;
  background: transparent;
}
.accordion-group.open .accordion-content {
  display: block !important;
}

.inner-cards-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Functionality Cards Container (Ziwo Style) */
.services-list {
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
}

/* Functionality Card */
.func-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0;
}
.func-card:last-child { border-bottom: none; }

/* Dashed active outline when bar hovered (Ziwo feature) */
.func-card.active-hover {
  outline: 2px dashed #a3a3a3;
  outline-offset: -2px;
  background: #fafafa;
}

.func-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.func-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-icon-svg { flex-shrink: 0; }
.func-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.func-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.status-badge {
  font-size: 14px;
  font-weight: 500;
}
.status-badge.operational { color: var(--green); }
.status-badge.degraded { color: var(--yellow); }
.status-badge.outage { color: var(--red); }
.status-badge.unknown { color: var(--text-muted); }

/* Uptime bars row */
.uptime-bars-wrapper {
  margin-bottom: 8px;
  position: relative;
}
.uptime-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 26px;
}
.uptime-bar {
  flex: 1;
  min-width: 3px;
  height: 100%;
  border-radius: 3px;
  background: var(--green);
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.uptime-bar:hover {
  opacity: 0.85;
  transform: scaleY(1.08);
}
.uptime-bar.degraded { background: var(--yellow); }
.uptime-bar.outage { background: var(--red); }
.uptime-bar.unknown { background: var(--border); }

/* Card footer labels (30 days ago | 100.00% | Today) */
.func-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.func-card-footer .uptime-pct { font-weight: 500; }

/* Ziwo-style Floating Tooltip Popup */
.ziwo-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  padding: 14px 16px;
  width: 280px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(-5px); } to { opacity: 1; transform: translateX(-50%) translateY(-10px); } }

.ziwo-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.tooltip-date {
  font-weight: 600;
  color: #4b5563;
  font-size: 13px;
}
.tooltip-progress-track {
  height: 8px;
  width: 100%;
  background: #fee2e2;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.tooltip-progress-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.2s ease;
}
.tooltip-incident {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
  margin-top: 2px;
}
.tooltip-incident.outage { color: #dc2626; font-weight: 500; }

/* Cloud providers */
.cloud-providers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.cloud-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cloud-card .provider-name { font-weight: 600; font-size: 14px; }

/* Latency chart */
.chart-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 280px;
  box-shadow: var(--shadow);
}
.service-select {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

/* Incidents */
.incidents-list { display: flex; flex-direction: column; gap: 10px; }
.incident-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.incident-item.outage { border-left-color: var(--red); }
.incident-date { font-weight: 600; font-size: 14px; }
.incident-service { font-size: 12px; color: var(--text-muted); }
.muted { color: var(--text-muted); font-size: 14px; }

/* Backend warning */
.backend-warning {
  background: var(--red-bg);
  color: #c0392b;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Skeletons */
.skeleton .skeleton-line,
.skeleton .skeleton-bars {
  background: linear-gradient(90deg, var(--gray-bg) 25%, var(--border) 37%, var(--gray-bg) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-line { height: 14px; margin: 8px 0; }
.skeleton-bars { height: 36px; margin-top: 14px; }
.w-40 { width: 40%; }
.w-60 { width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 640px) {
  .func-card { padding: 16px; }
  .footer-inner { flex-direction: column; gap: 6px; justify-content: center; height: auto; padding: 12px 0; }
  .uptime-bars { gap: 2px; height: 28px; }
  .ziwo-tooltip { width: 220px; font-size: 12px; }
}

/* ---- v2 additions ---- */
.hero-banner.unknown .hero-icon { background: var(--gray); }
.hero-banner.unknown .hero-title, .hero-banner.unknown .hero-subtitle, .hero-banner.unknown .hero-link { color: var(--text-muted); }
.hero-banner.unknown { background: var(--gray-bg); }

.func-card-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--text-muted); }
.tooltip-detail { font-size: 12px; color: var(--text-muted); margin: 2px 0; }
.tooltip-detail b { color: var(--text); }

.cloud-event { flex-basis: 100%; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.cloud-card { flex-wrap: wrap; }

.methodology { margin: 28px 0 8px; }
.methodology details {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow);
}
.methodology summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.methodology-body { margin-top: 10px; font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.methodology-body ul { padding-left: 20px; margin: 8px 0 0; }
.methodology-body li { margin: 4px 0; }


/* ---- v2: day details ---- */
.uptime-bar { cursor: pointer; }
.uptime-bar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.uptime-bar.selected { outline: 2px solid var(--primary); outline-offset: 1px; }
.tooltip-hint { color: var(--primary); font-weight: 500; }

.incident-item.clickable { cursor: pointer; }
.incident-item.clickable:hover { background: #fafafa; }

.day-detail {
  margin: 12px 0 4px;
  padding: 14px 16px;
  background: #fbfbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dd-title { font-weight: 600; font-size: 15px; }
.dd-summary { margin: 6px 0 0; padding-left: 18px; }
.dd-summary li { margin: 4px 0; }
.dd-sub { margin: 12px 0 4px; font-weight: 600; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.dd-list { margin: 0; padding-left: 18px; }
.dd-list li { margin: 6px 0; }
.dd-muted { color: var(--text-muted); font-size: 13px; }
.dd-note { margin-top: 10px; color: var(--text-muted); font-size: 12px; }
.dd-manual { margin: 8px 0; padding: 10px 12px; background: #fff; border-left: 3px solid var(--primary); border-radius: 4px; }
.dd-manual-title { font-weight: 600; }
.dd-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; }
.dd-table th, .dd-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.dd-table th { font-weight: 600; color: var(--text-muted); }
.dd-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .dd-table { display: block; overflow-x: auto; } }
