/* ==========================================================================
   TranslaStars design system - shared tokens, typography and components
   Used by the Talent Pool pages and aligned with the Jobs Portal
   (jobs-board-v8). Light + dark mode via prefers-color-scheme.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Brand ---------------------------------------------------------------- */
  --p500: #522D6D;
  --p700: #3a1f52;
  --p300: #7B3FAF;
  --p300-hover: #6a31a0;
  --orange: #FF6B00;
  --orange2: #F4511E;

  /* Surfaces ------------------------------------------------------------- */
  --bg: #faf8fd;
  --surface: #fff;
  --surface-2: #f4f0f9;
  --chip-bg: #f0ebf5;
  --chip-fg: #522D6D;
  --border: #e8e2f0;
  --border-strong: #d8c8ea;
  --border-accent: #eaddf7;

  /* Text ----------------------------------------------------------------- */
  --fg: #332a3d;
  --muted: #6b6273;
  --muted-2: #9b8aaa;
  --on-dark: #fff;
  --on-dark-muted: #c9b0e0;

  /* Status --------------------------------------------------------------- */
  --success-bg: #e8f5e9;
  --success-fg: #2e7d32;
  --success-line: #a5d6a7;
  --success-dot: #2e9e4f;
  --success-2: #4caf50;
  --danger-bg: #fdecea;
  --danger-fg: #c62828;
  --danger-line: #f5c6c6;
  --danger-dot: #e05a5a;
  --danger: #dc3545;
  --danger-hover: #c82333;
  --warn-bg: #fff3e0;
  --warn-fg: #e65100;
  --warn-line: #ffd9b8;
  --info-bg: #e3f2fd;
  --info-fg: #1565c0;
  --info-line: #90caf9;

  /* Shape and depth ------------------------------------------------------ */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 12px rgba(82, 45, 109, .06);
  --shadow-md: 0 4px 24px rgba(82, 45, 109, .12);
  --shadow-lg: 0 8px 32px rgba(82, 45, 109, .12);
  --overlay: rgba(45, 37, 53, .6);
  --header-gradient: linear-gradient(135deg, var(--p500) 0%, var(--p300) 100%);

  /* Type ----------------------------------------------------------------- */
  --font-sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', 'Montserrat', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15121f;
    --surface: #1d1930;
    --border: #4a3e63;
    --fg: #e8e4ef;
    --muted: #a49ab5;

    --surface-2: #241f36;
    --chip-bg: #2a2440;
    --chip-fg: #d5c6ea;
    --border-strong: #5c4f78;
    --border-accent: #3d3358;
    --muted-2: #8d84a0;

    --shadow-sm: 0 2px 12px rgba(0, 0, 0, .35);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
    --overlay: rgba(0, 0, 0, .68);

    --success-bg: #14301c;
    --success-fg: #7fe0a0;
    --success-line: #2f6b45;
    --success-dot: #4cc46e;
    --danger-bg: #3a1a1e;
    --danger-fg: #ff9c9c;
    --danger-line: #7a3a40;
    --danger-dot: #ff8a8a;
    --warn-bg: #3a2a12;
    --warn-fg: #ffc078;
    --warn-line: #7a5a28;
    --info-bg: #12283c;
    --info-fg: #8fc7ff;
    --info-line: #2f5a80;
  }
}

/* Explicit override, same values as the dark media query.
   Mirrors the Jobs Portal so a theme toggle can reuse it. */
[data-theme="dark"] {
  --bg: #15121f;
  --surface: #1d1930;
  --border: #4a3e63;
  --fg: #e8e4ef;
  --muted: #a49ab5;
  --surface-2: #241f36;
  --chip-bg: #2a2440;
  --chip-fg: #d5c6ea;
  --border-strong: #5c4f78;
  --border-accent: #3d3358;
  --muted-2: #8d84a0;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .35);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);
  --overlay: rgba(0, 0, 0, .68);
  --success-bg: #14301c;
  --success-fg: #7fe0a0;
  --success-line: #2f6b45;
  --success-dot: #4cc46e;
  --danger-bg: #3a1a1e;
  --danger-fg: #ff9c9c;
  --danger-line: #7a3a40;
  --danger-dot: #ff8a8a;
  --warn-bg: #3a2a12;
  --warn-fg: #ffc078;
  --warn-line: #7a5a28;
  --info-bg: #12283c;
  --info-fg: #8fc7ff;
  --info-line: #2f5a80;
}

/* --------------------------------------------------------------------------
   Base typography
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  transition: background .3s, color .3s;
}

h1, h2, h3, h4,
.brand-name,
.ts-display {
  font-family: var(--font-display);
}

a { color: inherit; }

::selection { background: var(--p300); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
}

.ts-btn:disabled { opacity: .5; cursor: not-allowed; }
.ts-btn--sm { padding: 7px 15px; font-size: .8rem; }
.ts-btn--block { width: 100%; }

.ts-btn--primary { background: var(--orange); color: var(--on-dark); }
.ts-btn--primary:hover:not(:disabled) { background: var(--orange2); }

.ts-btn--secondary { background: var(--p300); color: var(--on-dark); }
.ts-btn--secondary:hover:not(:disabled) { background: var(--p300-hover); }

.ts-btn--outline { background: transparent; color: var(--p300); border-color: var(--p300); }
.ts-btn--outline:hover:not(:disabled) { background: var(--chip-bg); }

.ts-btn--danger { background: var(--danger); color: var(--on-dark); }
.ts-btn--danger:hover:not(:disabled) { background: var(--danger-hover); }

.ts-btn--ghost { background: var(--chip-bg); color: var(--chip-fg); }
.ts-btn--ghost:hover:not(:disabled) { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Cards and panels
   -------------------------------------------------------------------------- */
.ts-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.ts-card--flat { box-shadow: none; }
.ts-card--tint { background: var(--surface-2); border-color: var(--border-accent); }

.ts-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--p500);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.ts-input,
.ts-select,
.ts-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.ts-textarea { min-height: 80px; resize: vertical; }

.ts-input:focus,
.ts-select:focus,
.ts-textarea:focus { border-color: var(--p300); }

.ts-input::placeholder,
.ts-textarea::placeholder { color: var(--muted-2); }

.ts-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--p300);
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   Badges and chips
   -------------------------------------------------------------------------- */
.ts-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  background: var(--chip-bg);
  color: var(--chip-fg);
}

.ts-badge--brand { background: linear-gradient(135deg, var(--p500), var(--p300)); color: var(--on-dark); }
.ts-badge--success { background: var(--success-bg); color: var(--success-fg); }
.ts-badge--danger { background: var(--danger-bg); color: var(--danger-fg); }
.ts-badge--warn { background: var(--warn-bg); color: var(--warn-fg); }
.ts-badge--info { background: var(--info-bg); color: var(--info-fg); }

.ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: .78rem;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}

.ts-chip:hover { border-color: var(--p300); }
.ts-chip--selected { background: var(--p300); border-color: var(--p300); color: var(--on-dark); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.ts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .85rem;
}

.ts-table th,
.ts-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ts-table th {
  background: var(--surface-2);
  color: var(--p500);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.ts-table tbody tr:last-child td { border-bottom: none; }
.ts-table tbody tr:hover td { background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Small utilities shared by the three pages
   -------------------------------------------------------------------------- */
.ts-muted { color: var(--muted); }
.ts-hidden { display: none; }

/* --------------------------------------------------------------------------
   Iconos de linea (public/assets/ts-icons.js)
   El SVG escala con el tamano de letra y hereda el color via currentColor.
   -------------------------------------------------------------------------- */
.ts-ic {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex: none;
}

/* Estrella / corazon marcados: mismo trazado de linea, relleno solido */
.ts-ic-fill { fill: currentColor; }
/* La estrella de favorito se rellena cuando el boton esta activo */
.btn-star.active .ts-ic { fill: currentColor; }

/* Punto de estado (sustituye al circulo verde/rojo como caracter) */
.ts-dot {
  display: inline-block;
  width: .62em;
  height: .62em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.02em;
  flex: none;
}
