/* Manaia Status Page — Standalone Styles */
/* Brand: primary #2563EB, accent #9333EA */

:root {
  --primary: #2563EB;
  --accent: #9333EA;
  --success: #10B981;
  --warning: #F59E0B;
  --warning-dark: #D97706;
  --error: #E11D48;
  --orange: #F97316;
  --info: #3B82F6;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --bg-page: #0F172A;
    --bg-card: #1E293B;
    --border: #334155;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(to right, var(--primary), var(--accent));
  padding: 24px 0;
  color: #fff;
}

.header-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  border-radius: 12px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
  width: 100%;
}

/* Overall Status Banner */
.banner {
  padding: 20px 24px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 32px;
}

.banner--operational {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.banner--degraded {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.banner--partial_outage {
  background: #FFF7ED;
  color: #9A3412;
  border: 1px solid #FED7AA;
}

.banner--major_outage {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.banner--maintenance {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.banner--loading {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .banner--operational { background: #064E3B; color: #A7F3D0; border-color: #065F46; }
  .banner--degraded { background: #78350F; color: #FDE68A; border-color: #92400E; }
  .banner--partial_outage { background: #7C2D12; color: #FED7AA; border-color: #9A3412; }
  .banner--major_outage { background: #7F1D1D; color: #FECACA; border-color: #991B1B; }
  .banner--maintenance { background: #1E3A5F; color: #BFDBFE; border-color: #1E40AF; }
}

.banner-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sections */
.section {
  margin-bottom: 32px;
}

.section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* Component List */
.components-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

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

.component-info {
  flex: 1;
}

.component-name {
  font-weight: 500;
  font-size: 15px;
}

.component-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.component-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

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

.status-dot--operational { background: var(--success); }
.status-dot--degraded { background: var(--warning); }
.status-dot--partial_outage { background: var(--orange); }
.status-dot--major_outage { background: var(--error); }
.status-dot--maintenance { background: var(--info); }

.status-label--operational { color: var(--success); }
.status-label--degraded { color: var(--warning-dark); }
.status-label--partial_outage { color: var(--orange); }
.status-label--major_outage { color: var(--error); }
.status-label--maintenance { color: var(--info); }

/* Incidents */
.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.incident-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.incident-title {
  font-weight: 600;
  font-size: 16px;
}

.incident-impact {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  white-space: nowrap;
}

.impact--none { background: #F1F5F9; color: var(--text-secondary); }
.impact--minor { background: #FEF3C7; color: #92400E; }
.impact--major { background: #FFEDD5; color: #9A3412; }
.impact--critical { background: #FEE2E2; color: #991B1B; }

.incident-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.incident-updates {
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

.incident-update {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.incident-update:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.update-status {
  font-weight: 600;
  font-size: 13px;
  text-transform: capitalize;
  margin-bottom: 4px;
}

.update-body {
  font-size: 14px;
  color: var(--text-secondary);
}

.update-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.no-incidents {
  color: var(--text-muted);
  font-style: italic;
  padding: 16px 0;
}

/* Resolved incident card */
.incident-card--resolved {
  opacity: 0.75;
}

.incident-card--resolved .incident-title {
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
}

/* Subscribe */
.subscribe-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.subscribe-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
}

.subscribe-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-page);
  color: var(--text-primary);
  outline: none;
}

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

.subscribe-btn {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.subscribe-btn:hover {
  background: #1D4ED8;
}

.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.subscribe-message {
  margin-top: 12px;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 6px;
}

.subscribe-message--success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.subscribe-message--error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Error State */
.error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.retry-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.retry-btn:hover {
  background: #1D4ED8;
}

/* Loading */
.loading-placeholder {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
  .subscribe-form {
    flex-direction: column;
  }

  .incident-header {
    flex-direction: column;
  }

  .component-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
