/* ============================================
   GLOBALHIRE@ELAB — Shared Components
   Buttons, Cards, Badges, Forms, Tables
   ============================================ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  transition: all var(--duration-base) var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--duration-base);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-deep);
  box-shadow: var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--primary-glow-strong);
  transform: translateY(-3px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 100ms;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--secondary-glow);
}

.btn-secondary:hover {
  background: var(--secondary-light);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--secondary-glow);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 100ms;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-muted);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 232, 157, 0.1);
}

.btn-ghost:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 100ms;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--bg-deep);
  box-shadow: var(--primary-glow);
  transform: translateY(-3px) scale(1.02);
}

.btn-outline-primary:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 100ms;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  right: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
  opacity: 0;
  transition: opacity var(--duration-base), left var(--duration-slow) var(--ease-out);
}

.card:hover {
  border-color: var(--border-default);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  opacity: 1;
  left: 0;
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
}

.card-glow {
  background: var(--bg-surface);
  border: 1px solid var(--primary);
}

.card-glow:hover {
  box-shadow: var(--shadow-glow-primary);
}

.card-flat {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

.badge-primary {
  background: var(--primary-muted);
  color: var(--primary);
  border: 1px solid rgba(0, 232, 157, 0.2);
}

.badge-secondary {
  background: var(--secondary-muted);
  color: var(--secondary);
  border: 1px solid rgba(124, 92, 255, 0.2);
}

.badge-warning {
  background: rgba(255, 176, 32, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 176, 32, 0.2);
}

.badge-error {
  background: rgba(255, 92, 92, 0.12);
  color: var(--accent-coral);
  border: 1px solid rgba(255, 92, 92, 0.2);
}

.badge-info {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.badge-neutral {
  background: rgba(139, 145, 168, 0.12);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ── Inputs ── */
.input-group {
  position: relative;
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--duration-base);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.input-icon + .input {
  padding-left: var(--space-10);
}

.search-input {
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 100%;
  min-width: 280px;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--bg-elevated);
}

.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-default);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--duration-fast);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Avatar ── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-xl); }

/* ── Progress ── */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  transition: width 1s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-fast);
  z-index: var(--z-tooltip, 500);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Icon wrapper ── */
.icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--duration-slow) var(--ease-spring),
              box-shadow var(--duration-slow) var(--ease-out);
}

.icon-wrap svg {
  width: 22px;
  height: 22px;
  transition: transform var(--duration-slow) var(--ease-spring);
}

.card:hover .icon-wrap {
  transform: scale(1.1) translateY(-2px);
}

.card:hover .icon-wrap svg {
  transform: none;
}

.icon-wrap-primary {
  background: var(--primary-muted);
  color: var(--primary);
}

.icon-wrap-secondary {
  background: var(--secondary-muted);
  color: var(--secondary);
}

.icon-wrap-amber {
  background: rgba(255, 176, 32, 0.12);
  color: var(--accent-amber);
}

.icon-wrap-coral {
  background: rgba(255, 92, 92, 0.12);
  color: var(--accent-coral);
}

/* ── Tag ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ── Status Indicator ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-active {
  background: var(--success);
  box-shadow: 0 0 8px rgba(0, 232, 157, 0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot-pending {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(255, 176, 32, 0.4);
}

.status-dot-inactive {
  background: var(--text-tertiary);
}

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

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Accordion ── */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--duration-base);
}

.accordion-item.open {
  border-color: var(--border-accent);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.accordion-trigger:hover {
  color: var(--primary);
}

.accordion-trigger .chevron {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform var(--duration-base) var(--ease-out);
  flex-shrink: 0;
}

.accordion-item.open .accordion-trigger .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out);
}

.accordion-item.open .accordion-body {
  max-height: 600px;
}

.accordion-content {
  padding: 0 var(--space-6) var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ── Callout ── */
.callout {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--primary);
}

.callout-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-muted);
  color: var(--primary);
}

.callout-icon svg {
  width: 20px;
  height: 20px;
}

.callout-content h4 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.callout-content p {
  font-size: var(--text-sm);
}

/* ── Feature Card (enhanced) ── */
.feature-card {
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--primary-muted), transparent 70%);
  opacity: 0;
  transition: opacity var(--duration-slow);
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  font-size: var(--text-2xl);
  transition: transform var(--duration-slow) var(--ease-spring);
}

.feature-card:hover .feature-card-icon {
  transform: translateY(-4px);
}

.feature-card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.feature-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* ── Journey Steps ── */
.journey {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.journey::before {
  content: '';
  position: absolute;
  top: 0;
  left: 31px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  opacity: 0.25;
  transform-origin: top;
  animation: draw-line 1.5s var(--ease-out) both;
}

@keyframes draw-line {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.journey-step {
  display: flex;
  gap: var(--space-6);
  padding: var(--space-6) 0;
  position: relative;
}

.journey-number {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: var(--bg-surface);
  border: 2px solid var(--border-accent);
  color: var(--primary);
  transition: transform var(--duration-slow) var(--ease-spring),
              box-shadow var(--duration-slow) var(--ease-out),
              border-color var(--duration-slow);
}

.journey-step:hover .journey-number {
  transform: scale(1.12);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 232, 157, 0.3);
}

.journey-content h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.journey-content p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ── Dual CTA ── */
.dual-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.dual-cta-card {
  padding: var(--space-10);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  text-align: center;
  transition: all var(--duration-slow) var(--ease-out);
}

.dual-cta-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dual-cta-card h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.dual-cta-card p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Pipeline Table ── */
.pipeline-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.pipeline-table thead {
  background: var(--bg-elevated);
}

.pipeline-table th {
  padding: var(--space-3) var(--space-5);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-tertiary);
}

.pipeline-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.pipeline-table tbody tr:hover {
  background: var(--bg-hover);
}

.pipeline-table .stage-num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
}

/* ── Responsive: New Components ── */
@media (max-width: 768px) {
  .dual-cta {
    grid-template-columns: 1fr;
  }

  .journey::before {
    left: 23px;
  }

  .journey-number {
    width: 48px;
    height: 48px;
    font-size: var(--text-base);
  }

  .feature-card {
    padding: var(--space-6);
  }
}
