/* ── Shared component classes ── */

.card {
  @apply bg-white rounded-xl border border-gray-200 shadow-sm p-5;
}

.btn-primary {
  @apply inline-flex items-center justify-center bg-blue-600 hover:bg-blue-700 text-white
         font-medium px-4 py-2 rounded-lg transition focus:outline-none focus:ring-2 focus:ring-blue-500;
}

.btn-secondary {
  @apply inline-flex items-center justify-center bg-white hover:bg-gray-50 text-gray-700
         font-medium px-4 py-2 rounded-lg border border-gray-300 transition
         focus:outline-none focus:ring-2 focus:ring-gray-300;
}

.btn-icon {
  @apply flex items-center justify-center w-9 h-9 rounded-lg hover:bg-gray-100 transition;
}

.input-field {
  @apply w-full border border-gray-300 rounded-lg px-3 py-2 text-sm text-gray-800
         focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent
         placeholder-gray-400;
}

.label {
  @apply block text-sm font-medium text-gray-700 mb-1;
}

/* ── Status badges ── */

.status-badge {
  @apply inline-block text-xs font-semibold px-2 py-0.5 rounded-full;
}

.status-pending  { @apply bg-gray-100 text-gray-600; }
.status-running  { @apply bg-yellow-100 text-yellow-700; }
.status-stopping { @apply bg-orange-100 text-orange-700; }
.status-stopped  { @apply bg-slate-100 text-slate-700; }
.status-done     { @apply bg-green-100 text-green-700; }
.status-failed   { @apply bg-red-100 text-red-700; }
.status-kleinanzeigen { @apply bg-blue-100 text-blue-700; }
.status-ebay     { @apply bg-yellow-100 text-yellow-800; }
.status-whoppah  { @apply bg-purple-100 text-purple-700; }
.status-unknown  { @apply bg-gray-100 text-gray-500; }

/* ── Spinner ── */

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Step indicator ── */

.step-item {
  @apply flex flex-col items-center gap-1 flex-1;
  color: #9ca3af;
}

.step-item.active  { color: #2563eb; }
.step-item.done    { color: #16a34a; }

.step-circle {
  @apply w-8 h-8 rounded-full border-2 flex items-center justify-center text-sm font-bold;
  border-color: currentColor;
}

.step-line {
  @apply flex-1 h-px bg-gray-300 self-center;
  max-width: 60px;
}

/* ── Tailwind @apply fallback for non-CDN builds ── */
/* The Tailwind CDN handles utility classes at runtime. */
/* Custom component classes using @apply only work with a build step. */
/* For the CDN-only setup, override them with plain CSS below: */

.card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  padding: 1.25rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #fff;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  font-size: 0.875rem;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #374151;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  font-size: 0.875rem;
}
.btn-secondary:hover { background: #f9fafb; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc2626;
  color: #fff;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  font-size: 0.875rem;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-icon:hover { background: #f3f4f6; }

.input-field {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.input-field:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.status-pending   { background: #f3f4f6; color: #4b5563; }
.status-running   { background: #fef9c3; color: #92400e; }
.status-stopping  { background: #ffedd5; color: #9a3412; }
.status-stopped   { background: #e2e8f0; color: #334155; }
.status-done      { background: #dcfce7; color: #166534; }
.status-failed    { background: #fee2e2; color: #991b1b; }
.status-queued    { background: #e0e7ff; color: #3730a3; }
.status-kleinanzeigen { background: #dbeafe; color: #1e40af; }
.status-ebay      { background: #fef3c7; color: #92400e; }
.status-whoppah   { background: #ede9fe; color: #5b21b6; }
.status-unknown   { background: #f3f4f6; color: #6b7280; }

.step-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; color: #9ca3af; flex: 1; }
.step-item.active  { color: #2563eb; }
.step-item.done    { color: #16a34a; }
.step-circle {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 700;
}
.step-line { flex: 1; max-width: 60px; height: 1px; background: #d1d5db; align-self: center; }

/* ── Error Boxes ── */

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
}

.input-invalid {
  border-color: #ef4444 !important;
}
.input-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}


