/* ============================================================
   search-channels.css
   Buscador en la sección "Canales Disponibles"
   Ajustado a las variables y breakpoints de index.css
   ============================================================ */

/* --- Contenedor del buscador --- */
.channels-search-wrapper {
  position: relative;
  margin: 0 auto 1.5rem;
  width: 100%;
}

/* --- Input principal --- */
.channels-search {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 42px 13px 46px;
  background: rgba(18, 21, 40, 0.55);

  border: 1px solid rgba(114, 214, 255, 0.18);
  border-radius: 12px;
  color: #e2e6f0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  outline: none;
  transition: border-color var(--animation-speed) ease,
              box-shadow   var(--animation-speed) ease,
              background   var(--animation-speed) ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.channels-search::placeholder {
  color: rgba(180, 195, 220, 0.45);
}

/* Focus */
.channels-search:focus {
  border-color: rgba(114, 214, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(114, 214, 255, 0.1),
              0 0 20px rgba(114, 214, 255, 0.07);
  background: rgba(18, 21, 40, 0.7);
}

/* --- Icono lupa (SVG) --- */
.channels-search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  color: rgba(114, 214, 255, 0.4);
  transition: color var(--animation-speed) ease;
}

.channels-search-wrapper:focus-within .channels-search-icon {
  color: rgba(114, 214, 255, 0.8);
}

/* --- Botón limpiar (×) --- */
.channels-search-clear {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(114, 214, 255, 0.07);
  border: 1px solid rgba(114, 214, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  color: rgba(180, 195, 220, 0.5);
  transition: background var(--animation-speed) ease,
              color      var(--animation-speed) ease,
              opacity    var(--animation-speed) ease;
  opacity: 0;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.channels-search-wrapper.has-value .channels-search-clear {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) {
  .channels-search-clear:hover {
    background: rgba(114, 214, 255, 0.16);
    color: rgba(114, 214, 255, 0.9);
  }
}

.channels-search-clear:active {
  background: rgba(114, 214, 255, 0.22);
  transform: translateY(-50%) scale(0.9);
}

/* --- Mensaje sin resultados --- */
.channels-no-results {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(180, 195, 220, 0.4);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  grid-column: 1 / -1;
}

.channels-no-results .no-results-icon {
  display: block;
  margin: 0 auto 0.75rem;
  width: 40px;
  height: 40px;
  color: rgba(114, 214, 255, 0.2);
}

.channels-no-results .no-results-title {
  display: block;
  color: rgba(180, 195, 220, 0.6);
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .channels-search-wrapper {
    max-width: 100%;
  }

  .channels-search {
    font-size: 1rem; /* evita zoom en iOS */
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

@media (max-width: 480px) {
  .channels-search {
    padding-left: 42px;
    padding-right: 38px;
  }

  .channels-search-icon {
    left: 13px;
    width: 16px;
    height: 16px;
  }

  .channels-search-clear {
    right: 9px;
    width: 22px;
    height: 22px;
  }
}

/* --- Reducido movimiento --- */
@media (prefers-reduced-motion: reduce) {
  .channels-search,
  .channels-search-icon,
  .channels-search-clear {
    transition: none;
  }
}