/* ============================================================
   CAREEROPS — COMPONENTS
   Botones, cards, inputs, badges, nav, modales, etc.
   ============================================================ */

/* ── Botones ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: rgba(239 68 68 / .15);
  color: var(--error);
  border-color: rgba(239 68 68 / .3);
}
.btn-danger:hover { background: rgba(239 68 68 / .25); }

.btn-lg { padding: var(--space-3) var(--space-8); font-size: var(--text-base); border-radius: var(--radius-md); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-icon { padding: var(--space-2); width: 36px; height: 36px; }

/* ── Inputs ──────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.textarea-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-fast);
}

.card:hover { border-color: var(--border-strong); }

.card-elevated {
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

/* ── Profile Cards (selector) ────────────────────────────────── */
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  user-select: none;
}

.profile-card:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
  transform: translateY(-4px);
  box-shadow: var(--shadow-accent), var(--shadow-lg);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.profile-card.add-profile {
  border-style: dashed;
  color: var(--text-muted);
}

.profile-card.add-profile:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Nav Sidebar ─────────────────────────────────────────────── */
.nav-section {
  padding: 0 var(--space-3);
}

.nav-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-light);
}

.nav-item .nav-icon { font-size: var(--text-base); opacity: 0.8; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* ── Score Badge ─────────────────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-badge.high   { background: rgba(34 197 94 / .15);  color: var(--score-high); }
.score-badge.good   { background: rgba(132 204 22 / .15); color: var(--score-good); }
.score-badge.mid    { background: rgba(245 158 11 / .15); color: var(--score-mid); }
.score-badge.low    { background: rgba(239 68 68 / .15);  color: var(--score-low); }

/* ── Score Bar ───────────────────────────────────────────────── */
.score-bar-wrap {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0 0 0 / .7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

/* ── Evaluation Blocks ───────────────────────────────────────── */
.eval-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.eval-block.streaming { border-color: var(--accent); }
.eval-block.done      { border-color: rgba(34 197 94 / .3); }

.eval-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  user-select: none;
}

.eval-block-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.eval-block-id {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
}

.eval-block.streaming .eval-block-id { background: var(--accent); color: #fff; }
.eval-block.done .eval-block-id       { background: rgba(34 197 94 / .2); color: var(--success); }

.eval-block-body {
  padding: var(--space-5);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.eval-block-body.hidden { display: none; }

/* Markdown render inside blocks */
.eval-block-body h3 { color: var(--text-primary); margin: var(--space-4) 0 var(--space-2); font-size: var(--text-base); }
.eval-block-body p  { margin-bottom: var(--space-3); }
.eval-block-body ul, .eval-block-body ol { padding-left: var(--space-5); margin-bottom: var(--space-3); }
.eval-block-body li { margin-bottom: var(--space-1); }
.eval-block-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
  margin-bottom: var(--space-4);
}
.eval-block-body th, .eval-block-body td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  text-align: left;
}
.eval-block-body th { background: var(--bg-elevated); font-weight: 600; color: var(--text-primary); }
.eval-block-body strong { color: var(--text-primary); font-weight: 600; }
.eval-block-body code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* Cursor de streaming */
.streaming-cursor::after {
  content: '▊';
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Tracker Table ───────────────────────────────────────────── */
.tracker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.tracker-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.tracker-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.tracker-table tbody tr:hover td {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Estado chips ────────────────────────────────────────────── */
.state-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.state-Evaluada, .state-Evaluated { background: rgba(99 102 241 / .15); color: var(--state-evaluated); }
.state-Applied, .state-Aplicada   { background: rgba(56 189 248 / .15); color: var(--state-applied); }
.state-Interview, .state-Entrevista { background: rgba(245 158 11 / .15); color: var(--state-interview); }
.state-Offer, .state-Oferta        { background: rgba(34 197 94 / .15);  color: var(--state-offer); }
.state-Rejected, .state-Rechazada  { background: rgba(239 68 68 / .15);  color: var(--state-rejected); }
.state-SKIP, .state-Descartada     { background: rgba(100 116 139 / .15); color: var(--state-skip); }

/* ── Stats Cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
}

.stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Theme Toggle ────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn.active { background: var(--bg-surface); box-shadow: var(--shadow-sm); }

/* ── Lang Toggle ─────────────────────────────────────────────── */
.lang-toggle {
  display: flex;
  gap: var(--space-1);
}

.lang-btn {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── PIN Input ───────────────────────────────────────────────── */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.pin-dot.filled {
  background: var(--accent);
  transform: scale(1.2);
}

.pin-dot.error { background: var(--error); }

/* ── Typography utilities ────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--text-primary); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-6); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
p  { color: var(--text-secondary); }

.section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Toast ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 2000;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideIn var(--transition) forwards;
  max-width: 320px;
}

.toast.success { border-color: rgba(34 197 94 / .4); color: var(--success); }
.toast.error   { border-color: rgba(239 68 68 / .4); color: var(--error); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Session Status Pill ─────────────────────────────────────── */
.session-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-strong);
}

.session-pill.checking .session-dot { background: var(--accent); animation: session-pulse 1.2s ease-in-out infinite; }
.session-pill.ready    .session-dot { background: #22c55e; }
.session-pill.error    .session-dot { background: var(--error); }
.session-pill.error                 { border-color: rgba(239 68 68 / .3); }

@keyframes session-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

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

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition);
}

.progress-bar.indeterminate {
  width: 40%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ── Pipeline Job Cards ──────────────────────────────────────── */
.job-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.job-card.enriched {
  border-color: rgba(99 102 241 / .25);
}

.job-card.enriched:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(99 102 241 / .15);
}

.job-header { display: flex; gap: var(--space-4); }

.job-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.job-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  user-select: text;
}

.job-company {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0;
  user-select: text;
}

.job-meta { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

.job-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  font-style: italic;
  border-left: 2px solid var(--border-strong);
  padding-left: var(--space-3);
  user-select: text;
}

.job-salary { font-size: 0.85rem; font-weight: 600; color: var(--success); }

/* Requirement match badges */
.req-match { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }

.req-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: var(--space-1);
}

.req-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.req-badge.found   { background: rgba(34 197 94 / .12); color: var(--success); border: 1px solid rgba(34 197 94 / .25); }
.req-badge.unknown { background: rgba(100 116 139 / .12); color: var(--text-muted); border: 1px solid var(--border); }
.req-count         { font-size: 0.72rem; color: var(--text-muted); margin-left: var(--space-1); }

/* Job links */
.job-links  { display: flex; align-items: center; gap: var(--space-2); }
.job-link   { font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }
.job-link:hover { color: var(--accent); }

.copy-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.8rem; color: var(--text-muted); padding: 0; line-height: 1;
  transition: transform var(--transition-fast);
}
.copy-btn:hover { transform: scale(1.2); }

.reject-btn  { background: rgba(239 68 68 / .1) !important; color: var(--error) !important; border-color: rgba(239 68 68 / .2) !important; }
.reject-btn:hover { background: rgba(239 68 68 / .2) !important; }
.broken-btn  { font-size: 0.75rem; padding: var(--space-1) var(--space-3); }
.job-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

