/* Argha - 2026-03-03 - #11 - Reusable component styles */

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn-primary-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn-primary-modern:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-active));
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}
.btn-primary-modern:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.25);
}
.btn-primary-modern:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  user-select: none;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}
.btn-icon:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.btn-icon.btn-icon-danger:hover:not(:disabled) {
  background: var(--danger-light);
  color: var(--danger);
}
.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Cards ────────────────────────────────────────────────────────── */
.card-modern {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

.card-modern-hover {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card-modern-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ─── Status badges ─────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-badge.status-success {
  background: var(--success-light);
  color: var(--success-text);
}
.status-badge.status-success::before {
  background: var(--success);
}
.status-badge.status-warning {
  background: var(--warning-light);
  color: var(--warning-text);
}
.status-badge.status-warning::before {
  background: var(--warning);
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-badge.status-danger {
  background: var(--danger-light);
  color: var(--danger-text);
}
.status-badge.status-danger::before {
  background: var(--danger);
}
.status-badge.status-info {
  background: var(--info-light);
  color: var(--info-text);
}
.status-badge.status-info::before {
  background: var(--info);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ─── Tag chips ─────────────────────────────────────────────────────── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary-hover);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  border: 1px solid var(--primary-mid);
}

.tag-chip-filter {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.tag-chip-filter:hover {
  border-color: var(--primary-mid);
  color: var(--primary);
  background: var(--primary-light);
}
.tag-chip-filter.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

/* ─── Input ─────────────────────────────────────────────────────────── */
.input-modern {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.input-modern::placeholder {
  color: var(--text-muted);
}
.input-modern:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ─── Alert ─────────────────────────────────────────────────────────── */
.alert-modern {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}
.alert-modern.alert-danger {
  background: var(--danger-light);
  color: var(--danger-text);
  border-color: #fca5a5;
}
.alert-modern.alert-success {
  background: var(--success-light);
  color: var(--success-text);
  border-color: #6ee7b7;
}
.alert-modern.alert-info {
  background: var(--info-light);
  color: var(--info-text);
  border-color: #67e8f9;
}

/* ─── Spinner ────────────────────────────────────────────────────────── */
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-sm.spinner-dark {
  border-color: var(--border);
  border-top-color: var(--primary);
}

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

/* ─── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-8);
  gap: var(--space-4);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-mid));
  border-radius: var(--radius-xl);
  color: var(--primary);
  margin-bottom: var(--space-2);
}
.empty-state h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}
.empty-state p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}

/* ─── Workspace UI ───────────────────────────────────────────────────── */
/* Argha - 2026-03-04 - #17 - Styles for workspace chip, modal, cards, and danger confirm */

.workspace-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--primary-hover);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.workspace-chip:hover {
  background: var(--primary-mid);
}

.ws-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.workspace-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.workspace-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  max-width: 480px;
  width: 90%;
}

.api-key-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.api-key-text {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--text-sm);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-copy-btn {
  flex-shrink: 0;
  font-size: var(--text-xs);
  gap: 4px;
}

.btn-confirm-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-confirm-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.ws-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.ws-card-active {
  border-color: var(--primary-mid);
  background: var(--primary-light);
}

.ws-card-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.ws-card-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* ─── Section header ─────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}
.section-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}
.section-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
  margin-top: 2px;
}

/* Argha - 2026-03-07 - #20 - Onboarding steps (Workspaces page empty state) */
.onboarding-steps { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-5) 0; }
.onboarding-step { display: flex; gap: var(--space-4); align-items: flex-start; }
.onboarding-step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); border: 1.5px solid var(--primary-mid);
  color: var(--primary-hover); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  display: flex; align-items: center; justify-content: center;
}
.onboarding-step-num.step-warn {
  background: var(--warning-light); border-color: #fcd34d; color: var(--warning-text);
}
.onboarding-step-body h4 { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); margin: 0 0 2px; }
.onboarding-step-body p  { font-size: var(--text-xs); color: var(--text-muted); margin: 0; line-height: 1.5; }

/* Argha - 2026-03-07 - #20 - Nav setup prompt (amber badge when no workspace) */
.nav-setup-prompt {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 4px 10px; background: var(--warning-light);
  border: 1px solid #fcd34d; border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--warning-text); white-space: nowrap;
  transition: background var(--transition-fast); text-decoration: none;
}
.nav-setup-prompt:hover { background: #fef3c7; }
