/* =================================================================
   CURRÍCULUM INTERACTIVO — hoja de estilos
   -----------------------------------------------------------------
   Cómo modificar el aspecto:
   • Los COLORES y tamaños globales están en :root (variables CSS).
     Cambia --accent, --accent-2, --radius, etc. y se actualiza todo.
   • El modo oscuro usa [data-theme="dark"] sobre las mismas variables.
   • Para imprimir / guardar como PDF se usa @media print al final.
   ================================================================= */

/* ---------- 1. VARIABLES (tema claro por defecto) ---------- */
:root {
  --accent: #6d5efc;        /* color principal (violeta) */
  --accent-2: #18c8b9;      /* color secundario (turquesa) */
  --bg: #eef1f8;
  --bg-2: #e3e8f5;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(120, 130, 170, 0.18);
  --text: #1d2233;
  --text-soft: #5a607a;
  --shadow: 0 18px 50px -20px rgba(40, 50, 90, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 980px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Poppins", var(--font);
}

[data-theme="dark"] {
  --bg: #0d1020;
  --bg-2: #141833;
  --surface: rgba(28, 33, 60, 0.66);
  --surface-solid: #161a30;
  --border: rgba(150, 160, 210, 0.16);
  --text: #eef1ff;
  --text-soft: #a6acce;
  --shadow: 0 22px 60px -24px rgba(0, 0, 0, 0.7);
}

/* ---------- 2. RESET BÁSICO ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-2), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ---------- 3. FONDO DECORATIVO (orbES) ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: float 14s ease-in-out infinite;
}
.orb-1 { width: 360px; height: 360px; background: var(--accent); top: -80px; left: -60px; }
.orb-2 { width: 420px; height: 420px; background: var(--accent-2); bottom: -120px; right: -80px; animation-delay: -5s; }
.orb-3 { width: 280px; height: 280px; background: #ff8bd1; top: 40%; left: 60%; animation-delay: -9s; opacity: 0.3; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.08); }
}

/* ---------- 4. BARRA SUPERIOR ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-family: var(--font-head);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-switch {
  display: flex;
  background: var(--bg-2);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}
.lang-btn {
  border: 0; background: transparent; cursor: pointer;
  font-weight: 700; font-size: 0.8rem; color: var(--text-soft);
  padding: 6px 12px; border-radius: 999px; transition: 0.2s;
}
.lang-btn.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid; place-items: center;
  transition: transform 0.2s, background 0.2s;
}
.icon-btn:hover { transform: translateY(-2px); }

/* ---------- 5. CONTENEDOR Y TARJETAS ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 6. HERO con FOTO REDONDA INTEGRADA ---------- */
.hero {
  display: flex;
  gap: 22px;
  padding: 28px;
  align-items: center;
}
.hero-avatar {
  flex: 0 0 auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;     /* encuadre: sube un poco la cara */
  display: block;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px -10px var(--accent);
}

.hero-info { min-width: 0; }
.hero-name { font-family: var(--font-head); font-size: clamp(1.5rem, 3.5vw, 2.2rem); line-height: 1.15; }
.hero-role { color: var(--accent); font-weight: 600; margin: 4px 0 10px; }
.hero-summary { color: var(--text-soft); max-width: 60ch; }

.contact-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.contact-chips li {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.85rem;
}
.contact-chips a { color: var(--text); text-decoration: none; }
.contact-chips li span.ic { font-size: 1rem; }

/* ---------- 7. PESTAÑAS (tabs) — Competencias arriba,
                 Experiencia + Formación debajo. ---------- */
.tabs-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  box-shadow: var(--shadow);
}
.tab-btn:hover { color: var(--text); transform: translateY(-1px); }
.tab-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px -10px var(--accent);
}
.tab-btn .tab-ic { font-size: 1.05rem; }

/* Botón principal: ancho completo, encima */
.tab-main { width: 100%; padding: 14px 22px; font-size: 1rem; }

/* Fila secundaria con los otros dos botones */
.tabs-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tab-pane { display: none; animation: fade 0.35s ease; }
.tab-pane.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 8. BLOQUES, TÍTULOS Y ACORDEONES ---------- */
.block { scroll-margin-top: 90px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.section-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  position: relative;
  padding-left: 14px;
}
.section-title::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 1.1em; border-radius: 4px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.ghost-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 0.2s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--accent); }

/* Acordeones */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc-item {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.acc-header {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font: inherit;
}
.acc-header:hover { background: var(--bg-2); }
.acc-dot {
  flex: 0 0 auto;
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.acc-titles { flex: 1; min-width: 0; }
.acc-title { font-weight: 700; font-size: 1rem; }
.acc-sub { color: var(--text-soft); font-size: 0.85rem; }
.acc-chevron {
  margin-left: auto;
  transition: transform 0.3s ease;
  color: var(--text-soft);
}
.acc-item.is-open .acc-chevron { transform: rotate(180deg); }

.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.acc-item.is-open .acc-body { max-height: 1200px; }
.acc-body-inner { padding: 0 18px 18px 42px; color: var(--text-soft); }
.acc-body-inner ul { margin: 6px 0 0 18px; }
.acc-body-inner li { margin: 4px 0; }
.acc-meta {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-2);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* En el panel de competencias, cada acordeón es un tipo Europass */
.acc-type {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
}
.acc-type-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 500;
}

/* ---------- 9. IDIOMAS (barras) ---------- */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow);
}
.lang-card .lang-name { font-weight: 700; font-size: 1.05rem; }
.lang-card .lang-level { color: var(--text-soft); font-size: 0.85rem; margin-bottom: 10px; }
.bar { height: 9px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bar > span {
  display: block; height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1s ease;
}

/* ---------- 10. LISTA ADICIONAL ---------- */
.extra-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.extra-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start;
}
.extra-list li .ic { font-size: 1.2rem; }

/* ---------- 11. FOOTER ---------- */
.footer { text-align: center; padding: 26px 20px 40px; color: var(--text-soft); font-size: 0.82rem; }

/* ---------- 12. RESPONSIVE ---------- */
@media (max-width: 720px) {
  .hero { flex-direction: column; text-align: center; padding: 26px 20px; }
  .hero-avatar { width: 110px; height: 110px; }
  .contact-chips { justify-content: center; }
  .hero-summary { margin: 0 auto; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .tabs-sub { grid-template-columns: 1fr; }
  .tab-btn { padding: 10px 14px; font-size: 0.9rem; }
}

/* ---------- 13. IMPRESIÓN / GUARDAR COMO PDF ---------- */
@media print {
  .bg-orbs, .topbar, .ghost-btn, #print-btn, #theme-toggle, .lang-switch, .tabs-block { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .acc-item, .lang-card, .tag, .extra-list li {
    box-shadow: none;
    border: 1px solid #ccc;
    background: #fff;
    backdrop-filter: none;
  }
  .tab-pane { display: block !important; }    /* al imprimir se ven todas */
  .acc-body { max-height: none !important; }
  .accordion { gap: 8px; }
  .container { gap: 18px; padding: 0; }
}