/* Status Page — Stripe-grade Modern System Health Dashboard */

.statusPageContainer {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-4) var(--space-8);
}

/* ==========================================================================
   Hero Banner & Operational Status Indicator
   ========================================================================== */

.statusHero {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.statusHero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981 0%, #3ecf7a 50%, #059669 100%);
}

.statusHeroHeader {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .statusHeroHeader {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.statusHeroLeft {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.statusHeroBadge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  width: fit-content;
}

.statusHeroBadge.status--operational {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.statusHeroBadge.status--degraded {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.statusHeroBadge.status--outage {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.statusPulseDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  background-color: currentColor;
}

.statusPulseDot::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.4;
  animation: statusPulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulseRing {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.statusHeroHeading {
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.375rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0;
  line-height: 1.2;
}

.statusHeroSub {
  font-size: var(--text-base);
  color: var(--muted-foreground);
  max-width: 620px;
  margin: 0;
  line-height: 1.5;
}

.statusHeroActions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

/* ==========================================================================
   Stat Counters Bar
   ========================================================================== */

.statusStatsGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .statusStatsGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.statusStatCard {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.statusStatValue {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--foreground);
}

.statusStatLabel {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.statusStatMeta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-xs);
  color: #10b981;
}

/* ==========================================================================
   90-Day System Uptime Sparkline
   ========================================================================== */

.uptimeSection {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.uptimeHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.uptimeTitle {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.uptimeScore {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.uptimeBarGrid {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 38px;
  width: 100%;
  padding: 4px 0;
}

.uptimeBar {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  position: relative;
  transition: transform var(--motion-fast) var(--ease-standard), opacity var(--motion-fast);
  cursor: pointer;
}

.uptimeBar:hover {
  transform: scaleY(1.15);
  z-index: 5;
}

.uptimeBar.status--operational {
  background-color: #10b981;
}

.uptimeBar.status--degraded {
  background-color: #f59e0b;
}

.uptimeBar.status--outage {
  background-color: #ef4444;
}

.uptimeBar.status--maintenance {
  background-color: #3b82f6;
}

/* Tooltip on hover */
.uptimeBar[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #18181b;
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease, transform 150ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.uptimeBar[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.uptimeFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ==========================================================================
   Services & Components Matrix
   ========================================================================== */

.servicesSection {
  margin-bottom: var(--space-8);
}

.sectionHeaderRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.sectionTitle {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.015em;
  margin: 0;
}

.serviceCategoryCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  overflow: hidden;
  transition: border-color var(--motion-fast);
}

.serviceCategoryCard:hover {
  border-color: var(--primary-soft-border);
}

.serviceCategoryHeader {
  padding: var(--space-4) var(--space-5);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.serviceCategoryTitleGroup {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.serviceCategoryName {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.serviceCategoryDesc {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  margin: 0;
}

.serviceCategoryBadge {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.serviceItemsList {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid var(--border);
}

.serviceItemRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.serviceItemRow:last-child {
  border-bottom: none;
}

.serviceItemLeft {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

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

.serviceStatusIcon.status--operational {
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.serviceStatusIcon.status--degraded {
  background-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.serviceStatusIcon.status--outage {
  background-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.serviceItemName {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--foreground);

}

.serviceItemEndpoint {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.serviceItemRight {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.serviceItemMetric {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  display: none;
}

@media (min-width: 576px) {
  .serviceItemMetric {
    display: inline-block;
  }
}

.serviceStatusPill {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.serviceStatusPill.status--operational {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.serviceStatusPill.status--degraded {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.serviceStatusPill.status--outage {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   Global Edge Latency Grid
   ========================================================================== */

.regionsGrid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (min-width: 576px) {
  .regionsGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .regionsGrid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.regionCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.regionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.regionName {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--foreground);
}

.regionDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
}

.regionLocation {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.regionPing {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--foreground);
}

/* ==========================================================================
   Past Incident History & Timeline
   ========================================================================== */

.incidentsSection {
  margin-bottom: var(--space-8);
}

.incidentMonthGroup {
  margin-bottom: var(--space-6);
}

.incidentMonthHeader {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.noIncidentNotice {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  font-style: italic;
  padding: var(--space-3) 0;
}

.incidentCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.incidentTitleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.incidentMainTitle {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.incidentDateBadge {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.incidentBadge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.incidentBadge.status--resolved {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.incidentBadge.status--maintenance {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.incidentTimeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  padding-left: var(--space-4);
  margin-top: var(--space-4);
  border-left: 2px solid var(--border);
}

.incidentStep {
  position: relative;
}

.incidentStep::before {
  content: "";
  position: absolute;
  left: calc(var(--space-4) * -1 - 5px);
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-foreground);
  border: 2px solid var(--card);
}

.incidentStep:first-child::before {
  background: #10b981;
}

.incidentStepTime {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}

.incidentStepText {
  font-size: var(--text-sm);
  color: var(--foreground);
  line-height: 1.45;
}

/* ==========================================================================
   Subscribe Drawer / Modal & Banner
   ========================================================================== */

.subscribeBand {
  background: linear-gradient(135deg, var(--card) 0%, var(--muted) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .subscribeBand {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.subscribeLeft {
  max-width: 540px;
}

.subscribeTitle {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 var(--space-2) 0;
}

.subscribeDesc {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

.subscribeFormRow {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  max-width: 420px;
}

.subscribeInput {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: var(--text-sm);
}

.subscribeInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

/* Modal overlays */
.statusModalBackdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.statusModalBackdrop.isOpen {
  opacity: 1;
  visibility: visible;
}

.statusModal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 100%;
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 200ms ease;
}

.statusModalBackdrop.isOpen .statusModal {
  transform: translateY(0);
}

.statusModalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.statusModalTitle {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.statusModalClose {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.statusModalClose:hover {
  color: var(--foreground);
}

/* Modal Tabs */
.modalTabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.modalTabBtn {
  background: transparent;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 150ms, border-color 150ms;
}

.modalTabBtn.isActive {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ==========================================================================
   SLA Commitment & Support Section
   ========================================================================== */

.slaSection {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .slaSection {
    grid-template-columns: 2fr 1fr;
    align-items: center;
  }
}

.slaTitle {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 var(--space-2) 0;
}

.slaText {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

.slaRight {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

@media (min-width: 768px) {
  .slaRight {
    border-top: none;
    border-left: 1px solid var(--border);
    padding-top: 0;
    padding-left: var(--space-6);
  }
}

.slaStatItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slaStatKey {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.slaStatVal {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--foreground);
}
