/* SnapStats Status Page */

:root {
  --navy: #0F1B2D;
  --lime: #BFFF00;
  --bg: #F7F7F8;
  --card: #FFFFFF;
  --text: #0F1B2D;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --border: #e4e4e7;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --green-text: #166534;
  --yellow: #eab308;
  --yellow-bg: #fefce8;
  --yellow-text: #854d0e;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --red-text: #991b1b;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */

.header {
  background: var(--navy);
  padding: 0 24px;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-text {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-badge {
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(191,255,0,0.3);
  border-radius: 4px;
  padding: 2px 6px;
}

.header-link {
  color: #d4d4d8;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}

.header-link:hover {
  color: #fff;
}

/* Container */

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid var(--border);
}

/* Status Banner */

.status-card {
  padding: 32px 24px;
  text-align: center;
  transition: background 0.3s, border-color 0.3s;
}

.status-card.status-operational {
  background: var(--green-bg);
  border-color: #bbf7d0;
}

.status-card.status-degraded {
  background: var(--yellow-bg);
  border-color: #fde68a;
}

.status-card.status-outage {
  background: var(--red-bg);
  border-color: #fecaca;
}

.status-card.status-loading {
  background: var(--card);
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.status-operational .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulse-green 2s ease-in-out infinite;
}

.status-degraded .status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(234,179,8,0.2);
  animation: pulse-yellow 2s ease-in-out infinite;
}

.status-outage .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
  animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0.1); }
}

@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(234,179,8,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(234,179,8,0.1); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0.1); }
}

.status-label {
  font-size: 20px;
  font-weight: 600;
}

.status-operational .status-label { color: var(--green-text); }
.status-degraded .status-label { color: var(--yellow-text); }
.status-outage .status-label { color: var(--red-text); }

/* Section titles */

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

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

/* Uptime */

.uptime-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.uptime-pct {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -1px;
}

.uptime-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 16px;
}

.uptime-bar {
  display: flex;
  gap: 2px;
  height: 32px;
  align-items: stretch;
}

.uptime-cell {
  flex: 1;
  border-radius: 3px;
  min-width: 0;
  position: relative;
  cursor: default;
  transition: opacity 0.15s;
}

.uptime-cell:hover {
  opacity: 0.8;
}

.uptime-cell.up { background: var(--green); }
.uptime-cell.degraded { background: var(--yellow); }
.uptime-cell.down { background: var(--red); }
.uptime-cell.no_data { background: #e4e4e7; }

.uptime-cell .tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.uptime-cell:hover .tooltip {
  display: block;
}

.uptime-range {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Active Incidents */

.incident-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  border-left: 4px solid var(--border);
}

.incident-card.severity-critical { border-left-color: var(--red); }
.incident-card.severity-major { border-left-color: var(--yellow); }
.incident-card.severity-minor { border-left-color: var(--blue); }

.incident-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.incident-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.badge-investigating { background: var(--red-bg); color: var(--red-text); }
.badge-identified { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-monitoring { background: var(--blue-bg); color: #1e40af; }
.badge-resolved { background: var(--green-bg); color: var(--green-text); }
.badge-critical { background: var(--red-bg); color: var(--red-text); }
.badge-major { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-minor { background: var(--blue-bg); color: #1e40af; }

.incident-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.incident-meta {
  font-size: 12px;
  color: var(--text-muted);
}

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

.timeline-toggle {
  font-size: 12px;
  color: var(--blue);
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 500;
  padding: 0;
}

.timeline-toggle:hover {
  text-decoration: underline;
}

.timeline-entries {
  display: none;
  margin-top: 10px;
}

.timeline-entries.open {
  display: block;
}

.timeline-entry {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}

.timeline-entry + .timeline-entry {
  border-top: 1px solid #f4f4f5;
}

.timeline-time {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 130px;
  font-size: 12px;
}

.timeline-msg {
  color: var(--text-secondary);
}

/* Incident History */

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
}

.history-item + .history-item {
  border-top: 1px solid #f4f4f5;
}

.history-date {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  white-space: nowrap;
  padding-top: 2px;
}

.history-content {
  flex: 1;
}

.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.history-details {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-duration {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.empty-state {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* Header button */

.header-btn {
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: none;
  border: 1px solid #52525b;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.header-btn:hover {
  color: #fff;
  border-color: #a1a1aa;
  background: rgba(255,255,255,0.06);
}

/* Contact Form */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.form-optional {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input,
.form-textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,27,45,0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  cursor: pointer;
  transition: opacity 0.15s;
  align-self: flex-start;
}

.form-btn:hover {
  opacity: 0.9;
}

.form-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-btn-secondary {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  margin-top: 8px;
}

.form-btn-secondary:hover {
  background: #f4f4f5;
}

.form-error {
  font-size: 13px;
  color: var(--red-text);
  background: var(--red-bg);
  padding: 10px 14px;
  border-radius: 8px;
}

.contact-success {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  font-size: 24px;
  line-height: 48px;
  margin: 0 auto 12px;
}

.success-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.success-detail {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Auth Modal */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  padding: 24px;
  width: 100%;
  max-width: 400px;
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

/* User menu */

.header-user {
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 500;
}

/* Form row pair (side by side) */

.form-row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Ticket History */

.ticket-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}

.ticket-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.ticket-table td {
  padding: 10px;
  border-bottom: 1px solid #f4f4f5;
  vertical-align: top;
}

.ticket-table tr:last-child td {
  border-bottom: none;
}

.ticket-table .ticket-subject {
  font-weight: 500;
  color: var(--text);
}

.ticket-table .ticket-date {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.ticket-expand {
  cursor: pointer;
}

.ticket-expand:hover td {
  background: #fafafa;
}

.ticket-detail-row td {
  padding: 0 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Working On */

.working-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  align-items: flex-start;
}

.working-item + .working-item {
  border-top: 1px solid #f4f4f5;
}

.working-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.working-icon.fix { background: var(--yellow-bg); }
.working-icon.feature { background: #f0f9ff; }
.working-icon.improvement { background: var(--green-bg); }

.working-content {
  flex: 1;
}

.working-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.working-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.working-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Footer */

.footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 48px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-brand {
  margin-top: 4px;
}

/* Utility */

.hidden {
  display: none !important;
}

/* Mobile */

@media (max-width: 480px) {
  .container { padding: 16px 16px 40px; }
  .card { padding: 18px 16px; }
  .status-card { padding: 24px 16px; }
  .status-label { font-size: 17px; }
  .uptime-pct { font-size: 24px; }
  .uptime-bar { height: 26px; }
  .incident-header { flex-wrap: wrap; }
  .history-item { flex-direction: column; gap: 4px; }
  .history-date { min-width: auto; }
}
