/* m.js v3 docs — dark neon theme */

:root {
  --neon-cyan: #22d3ee;
  --neon-pink: #f472b6;
  --neon-purple: #c084fc;
  --void: #050510;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 211, 238, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(244, 114, 182, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(192, 132, 252, 0.08), transparent),
    var(--void);
  min-height: 100%;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.45); }

/* Code blocks */
pre, code, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

pre.code-block {
  background: rgba(10, 10, 26, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #a5f3fc;
}

pre.code-block .kw { color: #f472b6; }
pre.code-block .str { color: #86efac; }
pre.code-block .cm { color: #64748b; font-style: italic; }
pre.code-block .fn { color: #c084fc; }

/* Neon link underline */
a.neon-link {
  color: var(--neon-cyan);
  text-decoration: none;
  background-image: linear-gradient(var(--neon-cyan), var(--neon-cyan));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.2s, color 0.2s;
}
a.neon-link:hover {
  color: var(--neon-pink);
  background-image: linear-gradient(var(--neon-pink), var(--neon-pink));
  background-size: 100% 1px;
}

/* Nav active glow */
.nav-item.active {
  color: var(--neon-cyan);
  box-shadow: inset 3px 0 0 var(--neon-cyan);
  background: rgba(34, 211, 238, 0.08);
}

/* Cards */
.neon-card {
  background: rgba(18, 18, 42, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.neon-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

/* Storybook component frame */
.story-frame {
  background: rgba(5, 5, 16, 0.6);
  border: 1px dashed rgba(192, 132, 252, 0.25);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

/* Buttons (framework UI) */
.m-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.25;
}
.m-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.m-btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}
.m-btn-secondary:hover:not(:disabled) {
  border-color: rgba(34, 211, 238, 0.5);
  color: #22d3ee;
}
.m-btn-primary {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(192, 132, 252, 0.2));
  border-color: rgba(34, 211, 238, 0.45);
  color: #22d3ee;
}
.m-btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.3);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.3), rgba(192, 132, 252, 0.3));
}
.m-btn-danger {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.4);
  color: #f472b6;
}
.m-btn-danger:hover:not(:disabled) {
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.25);
}
.m-btn-success {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #4ade80;
}
.m-btn-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.m-btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }

/* Form controls */
.m-input {
  width: 100%;
  background: rgba(5, 5, 16, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #f1f5f9;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.m-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.m-input::placeholder { color: #64748b; }
.m-input.is-invalid {
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}
.m-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}
.m-label.is-invalid { color: #f472b6; }
.m-form-group { margin-bottom: 1rem; }
.m-help { font-size: 0.75rem; color: #64748b; margin-top: 0.35rem; }
.m-error { font-size: 0.75rem; color: #f472b6; margin-top: 0.35rem; }

/* Badge / counter */
.m-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.m-badge-secondary { background: rgba(100, 116, 139, 0.35); color: #cbd5e1; }
.m-badge-primary { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }
.m-badge-danger { background: rgba(244, 114, 182, 0.2); color: #f472b6; }
.m-badge-success { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.m-badge-warning { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

/* Dropdown */
.m-dropdown {
  position: relative;
  display: inline-block;
}
.m-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 12rem;
  margin-top: 0.25rem;
  background: #12122a;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 0.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 211, 238, 0.08);
  padding: 0.4rem;
  z-index: 50;
  display: none;
}
.m-dropdown.open .m-dropdown-menu { display: block; }
.m-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.35rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  background: transparent;
  border: none;
  cursor: pointer;
}
.m-dropdown-item:hover:not(:disabled) {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
}
.m-dropdown-item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.m-dropdown-item.danger:hover:not(:disabled) {
  background: rgba(244, 114, 182, 0.12);
  color: #f472b6;
}

/* Tooltip */
.m-tooltip-wrap {
  position: relative;
  display: inline-flex;
}
.m-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a3e;
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 60;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.m-tooltip-wrap:hover .m-tooltip { opacity: 1; }

/* Table */
.m-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 0.75rem;
}
.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.m-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(34, 211, 238, 0.06);
  color: #22d3ee;
  font-weight: 600;
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
  white-space: nowrap;
}
.m-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
}
.m-table tr:hover td {
  background: rgba(34, 211, 238, 0.04);
}
.m-table tr:last-child td { border-bottom: none; }

/* HMR indicator */
.hmr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  display: inline-block;
}
html[data-hmr="connected"] .hmr-dot {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}
html[data-hmr="updating"] .hmr-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pulse 0.5s infinite;
}
html[data-hmr="disconnected"] .hmr-dot {
  background: #f472b6;
  box-shadow: 0 0 8px #f472b6;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

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

/* Phosphor icon baseline */
.ph, [class^="ph-"] {
  vertical-align: -0.125em;
}

/* m-cloak hide until processed */
[m-cloak] { display: none !important; }

