/* JediTrack Component Styles */

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1;
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg-tertiary); }

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
}
.btn-ghost:hover { background: var(--color-accent-subtle); }

.btn-danger {
  background: var(--color-status-danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  min-height: 32px;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.card-padded { padding: var(--space-4); }
.card-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-separator);
}
.card-body { padding: var(--space-4); }

/* ── Inputs ─────────────────────────────────────────────────── */

.input {
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: 44px;
  min-width: 0;
  transition: border-color var(--duration-fast) var(--ease-out);
}

select.input {
  -webkit-appearance: menulist;
  appearance: menulist;
}
.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}
.input::placeholder { color: var(--color-text-tertiary); }

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.input-group {
  margin-bottom: var(--space-5);
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: 1;
}

.badge-active { background: var(--color-status-active-bg); color: var(--color-status-active); }
.badge-warning { background: var(--color-status-warning-bg); color: var(--color-status-warning); }
.badge-danger { background: var(--color-status-danger-bg); color: var(--color-status-danger); }
.badge-info { background: var(--color-status-info-bg); color: var(--color-status-info); }
.badge-neutral { background: var(--color-bg-tertiary); color: var(--color-text-secondary); }

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-active { background: var(--color-status-active); }
.status-dot-warning { background: var(--color-status-warning); }
.status-dot-danger { background: var(--color-status-danger); }
.status-dot-neutral { background: var(--color-status-neutral); }

.status-dot-pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Tables ─────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border-strong);
}
.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-separator);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }

/* ── Data display ───────────────────────────────────────────── */

.data-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.data-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.data-pair {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* ── Dividers ───────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--color-separator);
  border: none;
}

/* ── Utility ────────────────────────────────────────────────── */

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-accent { color: var(--color-accent); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Empty State ─────────────────────────────────────────── */

.empty-state {
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

/* ── Toggle Switch ──────────────────────────────────────── */

.toggle-switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--color-bg-tertiary); border-radius: var(--radius-full);
  transition: background var(--duration-fast) var(--ease-out);
}
.toggle-slider::before {
  content: ''; position: absolute; width: 27px; height: 27px;
  left: 2px; bottom: 2px; background: white; border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-status-active); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
