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

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #0f0c29);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: #fff;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  opacity: 0.35; pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: #7c3aed; top: -100px; left: -100px; }
.orb-2 { width: 350px; height: 350px; background: #2563eb; bottom: -80px; right: -80px; animation-delay: -3s; }
.orb-3 { width: 300px; height: 300px; background: #06b6d4; top: 50%; left: 60%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-20px) scale(1.05); }
  66% { transform: translate(-20px,20px) scale(0.95); }
}

/* ── Layout ── */
.app {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  padding: 32px 20px 60px;
}

.page-header {
  text-align: center; margin-bottom: 32px;
}
.page-header h1 {
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, #c084fc, #60a5fa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: 2px;
}
.page-header p {
  font-size: 13px; color: rgba(255,255,255,0.35); margin-top: 6px;
}

/* ── Search bar ── */
.search-bar {
  position: relative; margin-bottom: 24px;
}
.search-bar input {
  width: 100%; padding: 14px 20px 14px 48px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); backdrop-filter: blur(16px);
  color: #fff; font-size: 15px; font-family: inherit; outline: none;
  transition: all 0.3s;
}
.search-bar input:focus {
  border-color: rgba(124,58,237,0.5);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.search-bar input::placeholder { color: rgba(255,255,255,0.25); }
.search-bar .search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: rgba(255,255,255,0.3);
}

/* ── Category tabs ── */
.category-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px; justify-content: center;
}
.cat-tab {
  padding: 8px 18px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.25s; white-space: nowrap;
  font-family: inherit;
}
.cat-tab:hover { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.cat-tab.active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

/* ── Command cards grid ── */
.cards-grid {
  display: flex; flex-direction: column; gap: 8px;
}
@media (min-width: 900px) {
  .cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.cmd-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s;
  animation: cardIn 0.35s ease;
}
.cmd-card:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.14);
}

/* ── Collapsed header bar ── */
.cmd-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  cursor: pointer; user-select: none;
  width: 100%; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left;
}
.cmd-bar:focus-visible, .cat-tab:focus-visible, .copy-btn:focus-visible {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}
.cmd-bar .cmd-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.cmd-bar .cmd-title {
  flex: 1; font-size: 14px; font-weight: 600; color: #fff;
}
.cmd-bar .cmd-cat {
  font-size: 11px; color: rgba(255,255,255,0.3);
  padding: 3px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.05);
  white-space: nowrap;
}
.cmd-bar .cmd-hint {
  font-size: 11px; color: rgba(255,255,255,0.2);
  white-space: nowrap;
}
.cmd-bar .expand-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  color: rgba(255,255,255,0.2);
  transition: transform 0.3s;
}
.cmd-card.expanded .expand-icon { transform: rotate(180deg); color: rgba(255,255,255,0.5); }

/* ── Expanded body ── */
.cmd-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s;
  opacity: 0;
}
.cmd-card.expanded .cmd-body {
  max-height: 900px; opacity: 1;
}
.cmd-body-inner {
  padding: 0 18px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.cmd-card.hidden { display: none; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cmd-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.cmd-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.cmd-title {
  font-size: 16px; font-weight: 600; color: #fff;
}
.cmd-desc {
  font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 2px;
}

/* ── Form fields ── */
.cmd-fields {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}
.field-row {
  display: flex; gap: 10px; align-items: center;
}
.field-row label {
  font-size: 12px; color: rgba(255,255,255,0.45);
  min-width: 70px; text-align: right; flex-shrink: 0;
}
.field-row input, .field-row select {
  flex: 1; padding: 9px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); color: #fff;
  font-size: 13px; font-family: inherit; outline: none;
  transition: all 0.25s;
  min-width: 0;
}
.field-row input:focus, .field-row select:focus {
  border-color: rgba(124,58,237,0.5);
  background: rgba(255,255,255,0.1);
}
.field-row input.invalid, .field-row select.invalid {
  border-color: rgba(248,113,113,0.75);
  background: rgba(127,29,29,0.18);
}
.field-row input::placeholder { color: rgba(255,255,255,0.2); }
.field-row select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}
.field-row select option { background: #1e1b3c; color: #fff; }

/* ── Checkbox / toggle fields ── */
.toggle-row {
  display: flex; align-items: center; gap: 10px;
  padding-left: 80px;
}
.toggle-row label {
  font-size: 12px; color: rgba(255,255,255,0.4);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.toggle-row input[type="checkbox"] {
  accent-color: #7c3aed; width: 14px; height: 14px; cursor: pointer;
}
.toggle-row.disabled { opacity: 0.38; }
.toggle-row.disabled label, .toggle-row.disabled input { cursor: not-allowed; }

.cmd-validation {
  display: none;
  margin-top: -2px;
  font-size: 12px;
  color: #fca5a5;
}
.cmd-validation.show { display: block; }

/* ── Output ── */
.cmd-output {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
}
.cmd-output code {
  flex: 1; padding: 11px 16px; border-radius: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px; color: #a5f3fc;
  word-break: break-all; line-height: 1.5;
  min-height: 40px; display: flex; align-items: center;
}
.copy-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s; flex-shrink: 0;
}
.copy-btn:hover {
  background: rgba(255,255,255,0.14); color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.copy-btn.copied {
  background: rgba(34,197,94,0.2); color: #4ade80;
  border-color: rgba(34,197,94,0.3);
}
.copy-btn.copy-failed {
  background: rgba(239,68,68,0.2); color: #fca5a5;
  border-color: rgba(239,68,68,0.35);
}
.copy-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.copy-btn svg { width: 16px; height: 16px; }

/* ── No results ── */
.no-results {
  text-align: center; padding: 60px 20px;
  color: rgba(255,255,255,0.25); font-size: 14px;
  display: none;
}
.no-results.show { display: block; }

@media (max-width: 600px) {
  .app { padding-inline: 12px; }
  .cmd-bar { gap: 8px; padding-inline: 12px; }
  .cmd-bar .cmd-hint, .cmd-bar .cmd-cat { display: none; }
  .cmd-body-inner { padding-inline: 12px; }
}

@media (max-width: 420px) {
  .field-row { align-items: stretch; flex-direction: column; gap: 5px; }
  .field-row label { min-width: 0; text-align: left; }
  .toggle-row { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
