/* Conversor IAE CNAE - Estilos principales */

.conversor-iae-cnae-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.conversor-hero {
  text-align: center;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 60px 20px;
  border-radius: 20px;
  margin-bottom: 40px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.conversor-hero h1 {
  font-size: 2.5em;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.conversor-hero p {
  font-size: 1.2em;
  opacity: 0.95;
}

/* Estadísticas */
.conversor-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 10px;
  line-height: 1;
}

.stat-label {
  color: #666;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card principal del conversor */
.conversor-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

/* Búsqueda */
.search-container {
  position: relative;
  margin-bottom: 30px;
}

.search-input {
  width: 100%;
  padding: 20px 60px 20px 20px;
  font-size: 18px;
  border: 3px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.3s;
  outline: none;
  font-family: inherit;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
  color: #999;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  pointer-events: none;
}

/* Botones de tipo de búsqueda */
.tipo-busqueda {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tipo-btn {
  padding: 12px 30px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.tipo-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.tipo-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Resultados */
.resultados {
  display: none;
  animation: fadeIn 0.3s;
}

.resultados.visible {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.resultado-item {
  padding: 20px;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
}

.resultado-item:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.codigo-tag {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  margin-right: 10px;
}

.descripcion {
  margin-top: 10px;
  color: #555;
  line-height: 1.6;
}

/* Loading spinner */
.loading {
  text-align: center;
  padding: 30px;
  color: #999;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.no-resultados {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

/* Correspondencias */
.correspondencias {
  margin-top: 30px;
  padding: 25px;
  background: #f8f9ff;
  border-radius: 12px;
  display: none;
}

.correspondencias.visible {
  display: block;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

.correspondencia-titulo {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.correspondencia-item {
  padding: 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid #667eea;
  transition: transform 0.2s;
}

.correspondencia-item:hover {
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nivel-coincidencia {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

/* Códigos populares */
.populares {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.populares h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 24px;
}

.popular-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s;
}

.popular-item:hover {
  background: #f8f9ff;
}

.popular-item:last-child {
  border-bottom: none;
}

/* Lista de códigos */
.lista-codigos {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.codigo-item {
  padding: 15px;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}

.codigo-item:hover {
  background: #f8f9ff;
}

.codigo-item:last-child {
  border-bottom: none;
}

.filtros {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filtro-select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.filtro-select:focus {
  border-color: #667eea;
}

/* Paginación */
.paginacion {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.pagina-btn {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.pagina-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.pagina-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
  .conversor-hero h1 {
    font-size: 1.8em;
  }

  .conversor-hero p {
    font-size: 1em;
  }

  .conversor-card {
    padding: 20px;
  }

  .search-input {
    padding: 15px 50px 15px 15px;
    font-size: 16px;
  }

  .tipo-busqueda {
    flex-direction: column;
  }

  .tipo-btn {
    width: 100%;
  }

  .stat-number {
    font-size: 2em;
  }

  .popular-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Utilidades */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}
