/* Joyzyl Media Asset Cache Edge Node Stylesheet */

:root {
  --bg-primary: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-code: #0b1120;
  --border-color: #1f293d;
  --border-hover: #374151;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --container-max: 1140px;
}

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

body {
  font-family: var(--font-system);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: block;
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: color 0.15s ease;
  padding: 0.25rem 0;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.active {
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
}

.header-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

.status-dot.degraded {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

/* Hero Section */
.hero-section {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-emerald);
  background: var(--accent-emerald-dim);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 720px;
  line-height: 1.65;
}

/* Grid & Cards */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

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

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.metric-detail {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* Section styling */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-emerald {
  background: var(--accent-emerald-dim);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: var(--accent-amber-dim);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-cyan {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Code Blocks */
.code-container {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.25rem 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  color: #e2e8f0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

p code, li code {
  background: var(--bg-surface-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

/* Syntax highlighters */
.token-cmd { color: #f43f5e; }
.token-flag { color: #38bdf8; }
.token-url { color: #10b981; }
.token-header { color: #fbbf24; }
.token-prop { color: #93c5fd; }
.token-string { color: #86efac; }
.token-num { color: #f472b6; }
.token-bool { color: #c084fc; }

/* Status visualization */
.uptime-chart-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.uptime-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.uptime-bar-grid {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  gap: 4px;
  height: 48px;
  align-items: end;
}

.uptime-bar {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background-color: var(--accent-emerald);
  cursor: pointer;
  position: relative;
  transition: opacity 0.15s ease;
}

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

.uptime-bar.degraded {
  background-color: var(--accent-amber);
}

.uptime-chart-legend {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

/* Incident Cards */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.incident-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 1.25rem;
}

.incident-card.resolved {
  border-left-color: var(--accent-emerald);
}

.incident-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.incident-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.incident-body {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Docs specific styles */
.doc-section {
  margin-bottom: 2.5rem;
}

.doc-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.doc-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.endpoint-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.endpoint-get {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.endpoint-head {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Callouts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 4px solid;
  margin: 1.25rem 0;
  background: var(--bg-surface);
  font-size: 0.9rem;
}

.callout-info {
  border-left-color: var(--accent-cyan);
  color: var(--text-muted);
}

.callout-warning {
  border-left-color: var(--accent-amber);
  color: var(--text-muted);
}

/* Architecture visual container */
.architecture-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.architecture-box img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* Error 404 */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--accent-cyan);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.error-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #0b1120;
}

.btn-primary:hover {
  background: #7dd3fc;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--text-muted);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.785rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 0;
    gap: 0.75rem;
  }
  .nav-links {
    gap: 1rem;
    order: 3;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
  }
  .header-status-badge {
    order: 2;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .uptime-bar-grid {
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(2, 22px);
    gap: 3px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
