
/* 🎨 Estilos base */
body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 1rem;
  color: #333;
}

.container {
  max-width: 800px;
  margin: auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
}

input, textarea, select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

input::placeholder, textarea::placeholder {
  color: #777;
}

button {
  background-color: #007bff;
  color: white;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}

button:hover {
  background-color: #0056b3;
}

.preview {
  margin-top: 2rem;
  padding: 1rem;
  border-top: 2px solid #007bff;
  background: #f9f9f9;
}

.cv-header {
  background-color: #007bff;
  color: white;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
}

.cv-section {
  margin-top: 1.5rem;
}

.cv-section h3 {
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
  color: inherit;
}

/* 🏷️ Habilidades */
.tag-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.tag {
  background-color: #f1f1f1;
  border-left: 4px solid #007bff;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

#cv-habilidades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#cv-habilidades .tag {
  background-color: #2dc2ac;
  color: white;
  font-weight: bold;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* 🧩 Plantillas */
.plantilla-clasica {
  background-color: white;
  color: #333;
  padding: 2rem;
  border: 1px solid #ccc;
}

.plantilla-moderna {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 1rem;
  padding: 2rem;
  background-color: #fdfdfd;
}

.plantilla-moderna .cv-header {
  grid-column: span 2;
  background-color: #343a40;
  color: white;
  border-radius: 6px;
  text-align: center;
  padding: 1rem;
}

.plantilla-moderna .cv-section {
  padding: 0.5rem;
}

.plantilla-moderna .cv-section:nth-child(even) {
  grid-column: 2;
}

.plantilla-moderna .cv-section:nth-child(odd):not(.cv-header) {
  grid-column: 1;
} 



/* 🌙 Modo oscuro */
body.dark {
  background-color: #121212;
  color: #e4e4e4;
}

body.dark .container {
  background-color: #1e1e1e;
  color: #e4e4e4;
}

body.dark .preview {
  background-color: #2c2c2c;
}

body.dark .cv-section h3 {
  color: #e4e4e4;
}

body.dark input,
body.dark textarea,
body.dark select {
  background-color: #2c2c2c !important;
  color: white !important;
  border: 1px solid #555;
}

body.dark input::placeholder,
body.dark textarea::placeholder {
  color: #bbb;
}

body.dark input:-webkit-autofill,
body.dark textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #2c2c2c inset;
  -webkit-text-fill-color: white;
  caret-color: white;
}

/* 🔘 Switch modo claro/oscuro */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* 🔧 Asegura color heredado en plantilla moderna + modo oscuro */
body.dark .plantilla-moderna .cv-section {
  color: #e4e4e4;
}

body.dark .plantilla-moderna .cv-section h3 {
  color: #e4e4e4;
}

body.dark .plantilla-moderna input,
body.dark .plantilla-moderna textarea {
  background-color: #2c2c2c !important;
  color: white !important;
  border: 1px solid #555;
}

body.dark .plantilla-moderna input::placeholder,
body.dark .plantilla-moderna textarea::placeholder {
  color: #bbb;
}

/* 🌙 Visibilidad de tags en modo oscuro */
body.dark .tag {
  background-color: #3a3a3a !important;
  color: #ffffff !important;
  border-left: 4px solid #00c6ff;
}
#cv-experiencia-lista .tag {
  background-color: #dbeafe; /* azul claro */
  border-left: 4px solid #2563eb;
  color: #1e3a8a;
}

body.dark #cv-experiencia-lista .tag {
  background-color: #1e3a8a;
  border-left: 4px solid #60a5fa;
  color: #ffffff;
}

.foto-perfil {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid white;
  margin-bottom: 1rem;
}

/* En plantilla moderna, que experiencia laboral ocupe todo el ancho */
.plantilla-moderna .seccion-experiencia {
  grid-column: span 2;
}

/* En plantilla moderna: Educación y Habilidades al lado izquierdo */
.plantilla-moderna .seccion-habilidades {
  grid-column: 1;
}

.bloque-experiencia {
  margin-bottom: 1rem;
}

.bloque-experiencia input,
.bloque-experiencia textarea {
  margin-bottom: 0.5rem;
}

#experiencias-form h4 {
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

#experiencias-container hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border: none;
  border-top: 1px solid #ccc;
}

/* En plantilla moderna: Certificaciones al lado derecho */
.plantilla-moderna .seccion-certificaciones {
  grid-column: 2;
}

/* En plantilla moderna: Idiomas a la izquierda */
.plantilla-moderna .seccion-idiomas {
  grid-column: 1;
}

#idiomas-form select {
  margin-right: 0.5rem;
  padding: 0.3rem;
}

#idiomas-form ul {
  list-style: disc;
  color: #555;
  font-size: 0.95rem;
}

@media print {
  body * {
    visibility: hidden;
  }

  #cv, #cv * {
    visibility: visible;
  }

  #cv {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .theme-toggle,
  .formulario,
  button {
    display: none !important;
  }
}


@media (max-width: 768px) {
  .plantilla-moderna {
    display: block;
    padding: 1rem;
  }

  .cv-header,
  .cv-section {
    grid-column: unset !important;
    padding: 1rem 0;
  }

  .foto-perfil {
    margin: 0 auto 1rem auto;
    display: block;
  }

  .theme-toggle {
    justify-content: center;
  }

  .container {
    padding: 1rem;
  }

  .preview {
    padding: 1rem;
  }
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem; /* 🧼 más espacio antes de la imagen */
  font-size: 0.9rem;
  align-items: center;
}

.social-links a {
  color: #007bff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.social-links a:hover {
  text-decoration: underline;
}

body.dark .social-links a {
  color: #4fc3f7;
}


/* Modo claro por defecto */
.seo-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #ffffff;
}

/* Títulos */
.seo-content h2,
.seo-content h3 {
  color: #111;
  margin-top: 1.5rem;
}

/* Modo oscuro forzado por clase */
body.dark-mode .seo-content {
  color: #e6e6e6;
  background-color: #121212;
}

body.dark-mode .seo-content h2,
body.dark-mode .seo-content h3 {
  color: #ffffff;
}

.fechas-experiencia {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0;
}

.fechas-experiencia label {
  font-size: 0.9rem;
}

.acciones-cv {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.acciones-cv button {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.3s;
  color: white;
}

.acciones-cv button:first-child {
  background-color: #1a73e8; /* Azul - Vista previa */
}

.acciones-cv button:first-child:hover {
  background-color: #1558b0;
}

.acciones-cv button:nth-child(2) {
  background-color: #d93025; /* Rojo - Descargar PDF */
}

.acciones-cv button:nth-child(2):hover {
  background-color: #b1271b;
}

.acciones-cv button:nth-child(3) {
  background-color: #5f6368; /* Gris - Imprimir */
}

.acciones-cv button:nth-child(3):hover {
  background-color: #444749;
}

/* Fix para perfil profesional en modo oscuro */
body.dark #cv-perfil {
  color: #e4e4e4;
}

.acciones-cv-abajo button {
  background-color: #444;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  margin: 0.5rem;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}

/* Estilo específico para el botón de descargar */
.acciones-cv-abajo button:first-child {
  background-color: #e53935;
}

.acciones-cv-abajo button:first-child:hover {
  background-color: #c62828;
}

/* Hover general */
.acciones-cv-abajo button:hover {
  background-color: #555;
}

.foto-perfil-uploader {
  text-align: center;
  margin: 1rem 0;
}

.custom-file-label {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: #007bff;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.custom-file-label:hover {
  background-color: #0056b3;
}

.nombre-archivo {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.preview-foto {
  margin-top: 1rem;
  text-align: center;
}

.preview-foto img {
  max-width: 120px;
  height: auto;
  border-radius: 8px;
  border: 2px solid #ddd;
}

.foto-perfil-uploader {
  margin: 1.5rem 0;
  text-align: center;
}

.custom-file-label {
  background-color: #4a90e2;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
  cursor: pointer;
  font-weight: bold;
}

.nombre-archivo {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

.preview-foto {
  margin-top: 1rem;
  position: relative;
  display: inline-block;
}

.preview-foto img {
  max-width: 120px;
  border-radius: 8px;
  border: 2px solid #ccc;
}

.btn-eliminar-foto {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4d4f;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-eliminar-foto:hover {
  background: #d9363e;
}