/* ==== RESET BÁSICO ==== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==== BODY & TIPOGRAFÍA ==== */
body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
  background-color: #d4d4d4;
  color: #7a7a7a;
  line-height: 1.6;
}

/* ==== INTRO ==== */
#introScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #adadad;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1s ease, transform 1s ease;
}

#introLogo {
  max-width: 300px;
  width: 80%;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.4));
  transition: transform 1s ease, opacity 1s ease;
}

#introScreen.hide {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.2);
}


/* ==== CONTENEDOR PRINCIPAL (HEADER) ==== */
.header {
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}


/* === Selector de idioma elegante === */
#languageSelector {
  appearance: none; /* quita el estilo nativo en la mayoría de navegadores */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #f5f5f5;
  border: 1.5px solid #ccc;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  width: 160px; /* controla el ancho del select */
  text-align: center;
  text-align-last: center; /* para centrar el texto seleccionado */
}

#languageSelector option {
  font-size: 0.9rem;
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%; /* se limita al ancho del select */
}

#languageSelector:hover {
  border-color: #888;
  background-color: #eaeaea;
}

/* Logo alineado a la izquierda */
.header__logo {
  align-self: flex-start;
  height: 175px;
  width: auto;
  user-select: none;
  margin-bottom: 1rem;
}

/* Descripción centrada y estilizada */
.header__description {
  font-size: 1.25rem;
  font-weight: 400;
  color: #444;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.75;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

/* ==== FORMULARIO ==== */
form {
  max-width: 500px;
  margin: 1rem auto;
  background-color: #fff;
  padding: 2rem;
  border-radius: 36px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
  transition: all 0.3s ease;
}

/* ==== ÁREA DE CARGA DE ARCHIVOS ==== */
.upload-area {
  border: 2px dashed #ccc;
  padding: 2.5rem;
  background: linear-gradient(to bottom, #fdfdfd, #f5f5f5);
  border-radius: 16px;
  transition: all 0.2s ease-in-out;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  min-height: 240px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.upload-area:hover {
  background: linear-gradient(to bottom, #f9f9f9, #eaeaea);
  border-color: #888;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.upload-icon {
  width: 64px;
  height: 64px;
  stroke: #444;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: #333;
  font-weight: 500;
  text-align: center;
  font-size: 1rem;
  max-width: 300px;
  line-height: 1.5;
}

/* Input oculto para el archivo */
input[type="file"] {
  display: none;
}

/* Nombre del archivo cargado */
.file-name-display {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: #2e7d32;
  font-weight: 500;
  text-align: center;
}

/* ==== ESTADO DE ARCHIVO CARGADO ==== */
.upload-area.filled {
  border: 2px solid #2e7d32;
  background: linear-gradient(to bottom, #e8f5e9, #c8e6c9);
  box-shadow: 0 4px 20px rgba(46, 125, 50, 0.3);
  transition: all 0.4s ease-in-out;
}

.upload-area.filled .upload-icon {
  stroke: #2e7d32;
  animation: bounce 0.6s;
}

.upload-area.filled .upload-text {
  color: #2e7d32;
  font-weight: 600;
}

.upload-area.filled::after {
  content: "✓ Archivo cargado";
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #2e7d32;
  background: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #2e7d32;
  animation: fadeIn 0.5s ease-in-out;
}

/* ==== BOTÓN PRINCIPAL ==== */
button {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.75rem;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #333;
}

/* ==== BARRA DE CARGA ==== */
.loading-bar-container {
  margin: 1.5rem auto;
  background: #ddd;
  border-radius: 6px;
  height: 12px;
  overflow: hidden;
  max-width: 500px;
  display: none;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #000, #555);
  transition: width 0.3s ease;
}

/* ==== RESULTADOS ==== */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem auto 0 auto;
  padding: 0 1.5rem;
  max-width: 1200px;
}

/* Bloque individual de sugerencias */
.suggestion-block {
  background: #f2f1f1;
  padding: 24px 28px;
  border-radius: 16px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
  color: #222;
  display: flex;
  flex-direction: column;
  cursor: default;
  user-select: text;
}

.suggestion-block:hover {
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.1),
    0 6px 12px rgba(0, 0, 0, 0.07);
  transform: translateY(-4px);
}

.suggestion-block h3 {
  margin-bottom: 12px;
  color: #111;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  user-select: none;
}

.suggestion-block p {
  margin: 0;
  line-height: 1.6;
  color: #444;
  white-space: pre-wrap;
  font-size: 1rem;
  font-weight: 400;
  flex-grow: 1;
}

/* ==== CAJA DE PUNTUACIÓN ==== */
.score-box {
  margin-top: 2rem;
  background: #f2f1f1;
  border-radius: 16px;
  padding: 20px 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  color: #111;
  font-weight: 700;
  font-size: 2rem;
  text-align: center;
  user-select: none;
  display: none;
  transition: opacity 0.4s ease, transform 0.3s ease;
  letter-spacing: 0.04em;
  position: relative;
  border: 1px solid #e0e0e0;
}

/* Mostrar caja con animación */
.score-box.visible {
  display: block;
  opacity: 1;
  transform: scale(1.03);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  animation: pulseScore 1.8s ease-in-out infinite alternate;
}

/* ==== ANIMACIONES ==== */
@keyframes bounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseScore {
  0% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }
}

/* ==== TRANSICIÓN OCULTAR FORMULARIO ==== */
.form {
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 1;
  transform: scale(1);
  transform-origin: top center;
}

.form.hide-fun {
  opacity: 0;
  transform: scale(0.3) rotate(-10deg);
  pointer-events: none;
}

/* ==== FOOTER ==== */
.footer {
  width: 100%;
  background-color: #f0f0f0;
  padding: 2rem 1rem;
  margin: 3rem 0 0;
  text-align: center;
  border-top: 1px solid #ddd;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.footer__text {
  font-size: 0.95rem;
  color: #777;
  letter-spacing: 0.5px;
  line-height: 1.6;
  opacity: 0.85;
}

.footer__link {
  color: #0071e3;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.footer__link:hover,
.footer__link:focus {
  color: #004bb5;
  text-decoration: underline;
  outline: none;
}

/* --- MEDIA QUERIES --- */

/* Telèfons mòbils petits (pantalles fins a 480px) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
    padding: 10px;
  }

  header, main, footer {
    padding: 10px;
  }

  /* Ajustar amplada dels formularis */
  input[type="file"], input[type="text"], textarea {
    max-width: 100%;
    font-size: 14px;
  }

  /* Botons més petits */
  button {
    padding: 10px 20px;
    font-size: 14px;
  }

  /* Centrar i fer responsives les imatges */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Ajustar capçaleres, paràgrafs */
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 20px;
  }
  p {
    line-height: 1.4;
  }
}

/* Telèfons mòbils mitjans i petites tablets (481px a 767px) */
@media (min-width: 481px) and (max-width: 767px) {
  body {
    font-size: 15px;
  }

  input[type="file"], input[type="text"], textarea {
    max-width: 100%;
    font-size: 15px;
  }

  button {
    padding: 11px 22px;
    font-size: 15px;
  }

  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 22px;
  }
}

/* Tablets (768px a 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  body {
    font-size: 16px;
  }

  input[type="file"], input[type="text"], textarea {
    max-width: 90%;
  }

  button {
    padding: 12px 24px;
    font-size: 16px;
  }

  h1 {
    font-size: 30px;
  }
  h2 {
    font-size: 24px;
  }
}


.switch-wrapper {
  max-width: 400px;   /* Opcional: limita ancho para que no ocupe todo */
  margin: 0 auto 0 auto; /* Centra horizontalmente y separa abajo */
  display: flex;
  justify-content: center; /* Centra el contenido dentro */
  position: relative;
}


.switch-wrapper input[type="radio"] {
  display: none;
}

.switch-label {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2;
  position: relative;
  border-radius: 30px;
  font-size: 1rem;
}

/* Slider que se mueve */
.switch-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 50%;
  background: #111;
  border-radius: 30px;
  transition: left 0.3s ease;
  z-index: 1;
}

/* Cuando está marcado 'LinkedIn', mueve el slider */
#option-linkedin:checked ~ .switch-slider {
  left: 50%;
}

/* Texto activo blanco */
#option-cv:checked ~ .switch-label[for="option-cv"],
#option-linkedin:checked ~ .switch-label[for="option-linkedin"] {
  color: #fff;
}

.form {
  overflow: hidden;
  max-height: 1000px; /* altura máxima cuando está visible */
  opacity: 1;
  transition: opacity 0.5s ease, max-height 0.5s ease;
  pointer-events: auto;
}

.form.hidden {
  opacity: 0;
  max-height: 0;
  pointer-events: none;
}
/* Estilo general para ambos formularios */
form.form {
  max-width: 500px;
  margin: 2rem auto -6rem auto;
  padding: 2rem;
  background-color: #ffffff;
  border: 1.5px solid #d3d3d3;
  border-radius: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease-in-out;
}

/* Contenedor del input */
/* Estil del formulari de text LinkedIn */
#linkedinTextForm {
  max-width: 600px;
  margin: 2rem auto;
  /* padding: 2rem; */
  border: 2px solid #444;
  border-radius: 1.5rem;
  background-color: #1e1e1e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
}

.linkedin-text-area {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.linkedin-text-area label {
  font-weight: 600;
  color: #ccc;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.linkedin-text-input {
  padding: 1rem 1.25rem;
  border: 2px solid #555;
  border-radius: 1rem;
  font-size: 1rem;
  resize: vertical;
  min-height: 160px;
  background-color: #2a2a2a;
  color: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.linkedin-text-input::placeholder {
  color: #888;
}

.linkedin-text-input:focus {
  border-color: #888;
  box-shadow: 0 0 0 3px rgba(200, 200, 200, 0.2);
  outline: none;
}

/* Scrollbar personalitzat per al textarea del LinkedIn */
.linkedin-text-input::-webkit-scrollbar {
  width: 10px;
}

.linkedin-text-input::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 10px;
}

.linkedin-text-input::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 10px;
  border: 2px solid #1e1e1e;
}

.linkedin-text-input::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Compatibilitat per Firefox */
.linkedin-text-input {
  scrollbar-width: thin;
  scrollbar-color: #444 #1e1e1e;
}

.submit-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 2rem;
  background-color: #444;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover,
.submit-btn:focus {
  background-color: #666;
  outline: none;
}

.submit-btn:active {
  transform: scale(0.98);
}

.linkedin-result {
  background: #fff;
  padding: 24px 28px;
  border-radius: 16px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.05),
    0 1px 4px rgba(0, 0, 0, 0.06);
  color: #222;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 700px;
  margin: 2rem auto;
}

.linkedin-result h3 {
  font-size: 1.8rem;      /* Más grande */
  font-weight: 800;
  color: #222;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
  user-select: none;
}

.linkedin-result p {
  font-size: 1.2rem;      /* Más grande y legible */
  line-height: 1.8;
  color: #333;
  font-weight: 500;
  white-space: pre-wrap;
}

.linkedin-result button.btn-action {
  margin-top: 20px;
  padding: 10px 18px;
  font-size: 1.1rem;
  background-color: #0073e6;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.linkedin-result button.btn-action:hover {
  background-color: #005bb5;
}

@media (max-width: 767px) {
  #languageSelector {
    font-size: 0.85rem;
    width: 140px;
    padding: 5px 10px;
    margin: 0 auto 1rem auto;
  }

  .header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .header__logo {
    align-self: center;
  }
}


