/* ==========================================================================
   benim.cloud Statuspage & Subdomain Nodes Infrastructure Telemetry
   Directly matching Atlassian / Solana status page design specifications
   ========================================================================== */

:root {
  --status-primary: #2563eb;
  --status-primary-hover: #1d4ed8;
  --status-green: #24c666;
  --status-green-hover: #1ba854;
  --status-green-light: #ecfdf5;
  --status-yellow: #f59e0b;
  --status-red: #ef4444;
  --status-bg: #ffffff;
  --status-card-bg: #ffffff;
  --status-border: #e2e8f0;
  --status-border-light: #f1f5f9;
  --status-text-main: #0f172a;
  --status-text-muted: #64748b;
  --status-text-light: #94a3b8;
  --status-line: #cbd5e1;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Lexend', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.statuspage-body {
  font-family: var(--font-sans);
  background-color: var(--status-bg);
  color: var(--status-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subdomain Notification Banner */
.subdomain-notice-bar {
  background: #f8fafc;
  border-bottom: 1px solid var(--status-border);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--status-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subdomain-notice-bar .subdomain-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: #e2e8f0;
  color: #334155;
  padding: 2px 8px;
  border-radius: 4px;
}

.subdomain-notice-bar a {
  color: var(--status-primary);
  text-decoration: none;
  font-weight: 500;
}

.subdomain-notice-bar a:hover {
  text-decoration: underline;
}

/* Statuspage Layout Container */
.statuspage-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 60px 24px;
  flex: 1;
}

/* Top Header */
.statuspage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.status-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--status-text-main);
}

.status-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--status-primary);
}

.status-brand-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.status-brand-title span.brand-dot {
  color: var(--status-primary);
}

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--status-primary);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-subscribe:hover {
  background-color: var(--status-primary-hover);
}

.btn-subscribe:active {
  transform: translateY(1px);
}

/* Operational Banner */
.status-banner {
  background-color: var(--status-green);
  color: #ffffff;
  border-radius: 4px;
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: 0 2px 4px rgba(36, 198, 102, 0.15);
}

.status-banner-text {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Subhead Caption */
.status-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 13px;
  color: var(--status-text-muted);
  margin-bottom: 10px;
}

.status-meta-row a {
  color: var(--status-primary);
  text-decoration: none;
  margin-left: 4px;
}

.status-meta-row a:hover {
  text-decoration: underline;
}

/* Main Components Card */
.status-components-card {
  background: var(--status-card-bg);
  border: 1px solid var(--status-border);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 32px;
}

/* Component Row */
.component-row {
  padding: 20px 24px;
  border-bottom: 1px solid var(--status-border);
  transition: background-color 0.15s ease;
}

.component-row:last-child {
  border-bottom: none;
}

.component-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.component-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.expand-toggle-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.expand-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.component-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--status-text-main);
  letter-spacing: -0.2px;
}

.component-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  color: #94a3b8;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: help;
  position: relative;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.component-help-icon:hover {
  color: var(--status-primary);
  border-color: var(--status-primary);
}

.component-status-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--status-green);
}

/* 90-Day Uptime Bars Container */
.uptime-bars-container {
  display: flex;
  gap: 2px;
  height: 34px;
  align-items: stretch;
  width: 100%;
}

.uptime-bar {
  flex: 1;
  min-width: 0;
  background-color: var(--status-green);
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
  position: relative;
}

.uptime-bar:hover {
  transform: scaleY(1.15);
  background-color: var(--status-green-hover);
  z-index: 5;
}

.uptime-bar.maintenance {
  background-color: var(--status-yellow);
}

.uptime-bar.maintenance:hover {
  background-color: #d97706;
}

/* Uptime Legend Baseline */
.uptime-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--status-text-light);
}

.legend-line {
  flex: 1;
  height: 1px;
  background-color: var(--status-line);
}

.legend-center {
  font-weight: 500;
  color: var(--status-text-muted);
}

.legend-label {
  white-space: nowrap;
}

/* Expandable Child Components */
.component-children {
  display: none;
  background: #f8fafc;
  border-top: 1px solid var(--status-border);
  margin: 16px -24px -20px -24px;
  padding: 8px 24px 16px 24px;
}

.component-children.open {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.child-component-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--status-border-light);
}

.child-component-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.child-component-row .component-name {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.child-component-row .uptime-bars-container {
  height: 24px;
}

/* Footer Section */
.statuspage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--status-text-muted);
  padding: 8px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.incident-history-link {
  color: var(--status-primary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.incident-history-link:hover {
  text-decoration: underline;
  color: var(--status-primary-hover);
}

.powered-by-text {
  color: var(--status-text-muted);
}

.powered-by-text a {
  color: var(--status-text-muted);
  text-decoration: none;
}

.powered-by-text a:hover {
  text-decoration: underline;
  color: var(--status-text-main);
}

/* Incident History Section */
.incident-history-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--status-border);
}

.incident-history-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--status-text-main);
}

.incident-month-group {
  margin-bottom: 28px;
}

.incident-month-name {
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--status-border-light);
}

.incident-card {
  background: #ffffff;
  border: 1px solid var(--status-border);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.incident-card.operational {
  color: var(--status-text-muted);
  font-size: 13px;
}

.incident-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.incident-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--status-text-main);
}

.incident-badge-resolved {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--status-green);
  background: var(--status-green-light);
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 4px;
}

.incident-timestamp {
  font-size: 12px;
  color: var(--status-text-light);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.incident-desc {
  font-size: 13px;
  color: var(--status-text-muted);
  line-height: 1.5;
}

/* Floating Tooltip */
.status-tooltip {
  position: absolute;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.status-tooltip.visible {
  opacity: 1;
}

.status-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

/* Help Modal / Tooltip Popover */
.help-popover {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--status-border);
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  color: #334155;
  width: 260px;
  z-index: 50;
  display: none;
  line-height: 1.4;
}

/* Subscribe Modal */
.subscribe-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.subscribe-modal-backdrop.open {
  display: flex;
}

.subscribe-modal {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid var(--status-border);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.subscribe-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--status-border);
}

.subscribe-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--status-text-main);
}

.subscribe-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--status-text-muted);
  cursor: pointer;
  padding: 4px;
}

.subscribe-tabs {
  display: flex;
  border-bottom: 1px solid var(--status-border);
  background: #f8fafc;
}

.subscribe-tab-btn {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--status-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subscribe-tab-btn.active {
  color: var(--status-primary);
  border-bottom-color: var(--status-primary);
  background: #ffffff;
}

.subscribe-modal-body {
  padding: 24px;
}

.subscribe-tab-pane {
  display: none;
}

.subscribe-tab-pane.active {
  display: block;
}

.subscribe-form-group {
  margin-bottom: 16px;
}

.subscribe-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.subscribe-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--status-border);
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.subscribe-input:focus {
  border-color: var(--status-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.subscribe-btn-submit {
  width: 100%;
  background-color: var(--status-primary);
  color: #ffffff;
  border: none;
  padding: 11px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.subscribe-btn-submit:hover {
  background-color: var(--status-primary-hover);
}

.feed-url-copy {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.feed-url-copy input {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #f8fafc;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .statuspage-container {
    padding: 20px 16px;
  }
  
  .statuspage-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .btn-subscribe {
    width: 100%;
  }

  .status-meta-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .component-row {
    padding: 16px 16px;
  }
  
  .component-children {
    margin: 14px -16px -16px -16px;
    padding: 8px 16px 14px 16px;
  }
  
  .statuspage-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
