/* Dashboard styles — scoped to .cloud-root to avoid leaking into Tailwind marketing pages */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens (scoped so they override Tailwind vars only inside .cloud-root) ── */
.cloud-root {
  --bg: #000000;
  --bg-secondary: #111111;
  --panel: rgba(255,255,255,0.04);
  --panel-hover: rgba(255,255,255,0.07);
  --border: #333333;
  --border-hover: #444444;
  --text: #ededed;
  --text-2: #888888;
  --text-3: #444444;
  --accent: #0070f3;
  --accent-hover: #0060d3;
  --success: #00c805;
  --warning: #f5a623;
  --danger: #e00000;
  --danger-hover: #c00000;
  --creating: #0070f3;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.8);

  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Layout ── */
.cloud-root .container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ── Glass panels ── */
.cloud-root .glass {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Clerk widget isolation — prevent global input/label rules from leaking in ── */
.cloud-root .cl-rootBox input,
.cloud-root .cl-rootBox select,
.cloud-root .cl-rootBox textarea,
.cloud-root .cl-rootBox label {
  all: revert;
}

.cloud-root .glass-hover { transition: border-color 0.15s; }
.cloud-root .glass-hover:hover { border-color: var(--border-hover); }

/* ── Inputs ── */
.cloud-root input,
.cloud-root select,
.cloud-root textarea {
  background: #111;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cloud-root input:focus,
.cloud-root select:focus,
.cloud-root textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,112,243,0.15);
}
.cloud-root input::placeholder,
.cloud-root textarea::placeholder { color: var(--text-3); }
.cloud-root label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }

/* ── Buttons ── */
.cloud-root .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.cloud-root .btn:hover { background: #1a1a1a; border-color: var(--border-hover); }
.cloud-root .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.cloud-root .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cloud-root .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.cloud-root .btn-danger { color: var(--danger); border-color: #2a0000; }
.cloud-root .btn-danger:hover { background: #1a0000; border-color: var(--danger); }

.cloud-root .btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.cloud-root .btn-ghost:hover { background: var(--panel); border-color: var(--border); color: var(--text); }

.cloud-root .btn-sm { padding: 5px 10px; font-size: 12px; }
.cloud-root .btn-lg { padding: 11px 20px; font-size: 14px; font-weight: 600; }
.cloud-root .btn-icon { padding: 7px; }

/* ── Status badges ── */
.cloud-root .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.cloud-root .badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.cloud-root .badge-running { color: var(--success); background: rgba(0,200,5,0.08); border: 1px solid rgba(0,200,5,0.2); }
.cloud-root .badge-running::before { box-shadow: 0 0 5px var(--success); animation: pulse-dot 2s ease-in-out infinite; }
.cloud-root .badge-stopped { color: var(--text-3); background: rgba(68,68,68,0.15); border: 1px solid #2a2a2a; }
.cloud-root .badge-creating,
.cloud-root .badge-starting { color: var(--accent); background: rgba(0,112,243,0.08); border: 1px solid rgba(0,112,243,0.2); }
.cloud-root .badge-creating::before,
.cloud-root .badge-starting::before { animation: pulse-dot 1s ease-in-out infinite; }
.cloud-root .badge-error { color: var(--danger); background: rgba(220,0,0,0.08); border: 1px solid rgba(220,0,0,0.2); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Modal ── */
.cloud-root .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.cloud-root .modal { width: 100%; max-width: 440px; padding: 24px; }

/* ── Code/mono ── */
.cloud-root .mono {
  font-family: 'SF Mono', 'Fira Code', Menlo, monospace;
  font-size: 12px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  word-break: break-all;
  color: var(--text-2);
}

/* ── Copy button wrapper ── */
.cloud-root .copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cloud-root .copy-row .mono { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Stats cards ── */
.cloud-root .stat-card {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cloud-root .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 1px solid var(--border);
}
.cloud-root .stat-value { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); }
.cloud-root .stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; font-weight: 500; }

/* ── Section headings ── */
.cloud-root .section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }

/* ── Divider ── */
.cloud-root .divider { height: 1px; background: var(--border); }

/* ── QR Code container ── */
.cloud-root .qr-container {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  display: inline-block;
}

/* ── Spinner ── */
.cloud-root .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cloud-spin 0.7s linear infinite;
}
@keyframes cloud-spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.cloud-root .empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-2);
}
.cloud-root .empty-state svg { opacity: 0.2; margin-bottom: 16px; }
.cloud-root .empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.cloud-root .empty-state p { font-size: 14px; }

/* ── Tier pill ── */
.cloud-root .tier-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cloud-root .tier-starter { background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid var(--border); }
.cloud-root .tier-pro { background: rgba(0,112,243,0.08); color: var(--accent); border: 1px solid rgba(0,112,243,0.2); }
.cloud-root .tier-team { background: rgba(0,200,5,0.08); color: var(--success); border: 1px solid rgba(0,200,5,0.2); }

/* ── Guest notice banner ── */
.cloud-root .guest-notice {
  background: #111;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
}
.cloud-root .guest-notice strong { color: var(--text); }
