/* ==========================================================================
   GetBookIn Status Page - Design System & Modern UI Styles
   Inspired by status.openai.com & incident.io with sleek aesthetics
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-card: #e5e7eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Status Colors */
  --color-green: #10b981;
  --color-green-light: #ecfdf5;
  --color-green-border: #a7f3d0;

  --color-yellow: #f59e0b;
  --color-yellow-light: #fffbeb;
  --color-yellow-border: #fde68a;

  --color-red: #ef4444;
  --color-red-light: #fef2f2;
  --color-red-border: #fecaca;

  /* Accent */
  --color-primary: #0f172a;
  --color-primary-hover: #1e293b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.font-mono {
  font-family: var(--font-mono);
}

/* ================= Header ================= */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

.btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-card);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  color: inherit;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-block {
  width: 100%;
}

.btn-history {
  width: 100%;
  padding: 0.85rem;
  background: #fafafa;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-history:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

/* ================= Main Content ================= */
.main-content {
  padding: 2.25rem 0 4rem;
}

/* ================= Hero Status Banner ================= */
.status-banner {
  display: flex;
  align-items: center;
  padding: 1.35rem 1.6rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  gap: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.status-banner.operational {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid var(--color-green-border);
  color: #065f46;
}

.status-banner.degraded {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid var(--color-yellow-border);
  color: #92400e;
}

.status-banner.outage {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid var(--color-red-border);
  color: #991b1b;
}

.banner-icon-col {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.operational .icon-circle {
  background: #10b981;
  color: white;
}

.degraded .icon-circle {
  background: #f59e0b;
  color: white;
}

.outage .icon-circle {
  background: #ef4444;
  color: white;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  animation: pulse-ring-anim 2.5s infinite;
  z-index: 1;
}

.operational .pulse-ring {
  background: rgba(16, 185, 129, 0.4);
}

.degraded .pulse-ring {
  background: rgba(245, 158, 11, 0.4);
}

@keyframes pulse-ring-anim {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.banner-text-col {
  flex: 1;
}

.banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.banner-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
}

.banner-action-col {
  flex-shrink: 0;
}

.refresh-spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ================= Active Incident Box ================= */
.active-incident-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.6rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.incident-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.incident-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.incident-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.incident-badge.warning {
  background: #f59e0b;
  color: #ffffff;
}

.affected-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.incident-time {
  font-size: 0.8rem;
  color: #78350f;
  font-weight: 500;
}

.incident-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 0.35rem;
}

.incident-description {
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

.incident-timeline {
  border-top: 1px solid #fde68a;
  padding-top: 1rem;
}

.timeline-step {
  display: flex;
  gap: 0.85rem;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  background: #f59e0b;
  border-radius: var(--radius-full);
  margin-top: 6px;
  flex-shrink: 0;
}

.step-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.step-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #92400e;
}

.step-time {
  font-size: 0.82rem;
  color: #b45309;
}

.step-note {
  font-size: 0.86rem;
  color: #78350f;
}

/* ================= Metrics Grid ================= */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* ================= Deployment Card ================= */
.deployment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.deployment-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.vercel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #000000;
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.deployment-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.deployment-title {
  color: var(--text-muted);
}

.deployment-timestamp {
  color: var(--text-primary);
  font-weight: 600;
}

.deployment-relative {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

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

.commit-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.commit-sha {
  font-weight: 700;
  color: #2563eb;
}

.commit-msg {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.region-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.dot-online {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-value.text-sm {
  font-size: 1.1rem;
  padding-top: 0.3rem;
}

.metric-trend {
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-trend.positive {
  color: var(--color-green);
}

.metric-trend.neutral {
  color: var(--text-muted);
}

/* ================= Components List Card ================= */
.status-card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.card-header {
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.date-range-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-dot.green { background: #10b981; }
.legend-dot.yellow { background: #f59e0b; }
.legend-dot.red { background: #ef4444; }

.components-list {
  divide-y: 1px solid var(--border-subtle);
}

/* ================= Component Item ================= */
.component-row {
  padding: 1.25rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

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

.component-row:hover {
  background: #fafbfc;
}

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

.component-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.status-icon-indicator {
  display: flex;
  align-items: center;
}

.component-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

.component-meta {
  font-size: 0.78rem;
  color: var(--text-subtle);
}

.component-uptime-badge {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================= 90-Day Bars ================= */
.uptime-bars-wrapper {
  display: flex;
  gap: 2.5px;
  align-items: center;
  height: 34px;
}

.uptime-bar {
  flex: 1;
  height: 28px;
  border-radius: 2px;
  transition: transform 0.1s ease, height 0.15s ease;
  cursor: pointer;
  position: relative;
}

.uptime-bar:hover {
  transform: scaleY(1.22);
}

.uptime-bar.bar-green {
  background-color: #10b981;
}

.uptime-bar.bar-green:hover {
  background-color: #059669;
}

.uptime-bar.bar-yellow {
  background-color: #f59e0b;
}

.uptime-bar.bar-red {
  background-color: #ef4444;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.card-footer {
  padding: 1rem 1.6rem;
  background: #fbfcfd;
  border-top: 1px solid var(--border-subtle);
}

/* ================= History Section ================= */
.history-section {
  margin-bottom: 2.5rem;
}

.section-title-wrap {
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.month-group {
  margin-bottom: 1.5rem;
}

.month-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 0.75rem;
}

.history-card.clean {
  background: #ffffff;
}

.history-clean-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.history-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.history-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.history-badge.resolved {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.history-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.history-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ================= Footer ================= */
.status-footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.disclaimer {
  font-size: 0.82rem;
  color: var(--text-subtle);
  max-width: 650px;
  margin: 0 auto 1rem;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.powered-by {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* ================= Modal ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1.25rem;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  position: relative;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-subtle);
  line-height: 1;
}

.modal-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
}

.form-group input:focus {
  border-color: #0f172a;
}

.subscribe-success {
  margin-top: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  color: #065f46;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Tooltip on Bar */
.bar-tooltip {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.uptime-bar:hover .bar-tooltip {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .banner-action-col {
    width: 100%;
  }

  .btn-icon {
    width: 100%;
  }

  .header-actions .btn-secondary {
    display: none;
  }

  .legend-group {
    display: none;
  }
}
