/*!
 * PodcastCatalog — estilos
 * Catálogo de podcasts (temporadas, episodios, búsqueda, categorías y
 * reproducción), independiente, sin dependencias.
 */

.pc {
  --pc-bg: #10182b;
  --pc-bg-2: #161f38;
  --pc-card: #182342;
  --pc-card-2: #1d2a4d;
  --pc-accent: #e2a63b;
  --pc-accent-2: #f4c469;
  --pc-live: #ef4444;
  --pc-text: #ffffff;
  --pc-text-dim: #a9b3c9;
  --pc-border: rgba(255, 255, 255, 0.1);
  --pc-radius: 16px;

  width: 100%;
  color: var(--pc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
.pc *, .pc *::before, .pc *::after { box-sizing: border-box; }

/* ---------- Barra de herramientas: búsqueda + categorías + temporada ---------- */
.pc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.pc-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}
.pc-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border-radius: 999px;
  border: 1px solid var(--pc-border);
  background: var(--pc-card);
  color: var(--pc-text);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pc-search input::placeholder { color: var(--pc-text-dim); }
.pc-search input:focus { border-color: rgba(226, 166, 59, 0.55); background: var(--pc-card-2); }
.pc-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--pc-text-dim);
  pointer-events: none;
}
.pc-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pc-text-dim);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}
.pc-search.has-query .pc-search-clear { display: flex; }
.pc-search-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--pc-text); }

.pc-season-select {
  flex: none;
  padding: 9px 30px 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--pc-border);
  background: var(--pc-card);
  color: var(--pc-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b3c9' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.pc-categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  width: 100%;
}
.pc-categories::-webkit-scrollbar { height: 5px; }
.pc-categories::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; }
.pc-cat-pill {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--pc-border);
  background: var(--pc-card);
  color: var(--pc-text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.pc-cat-pill:hover { background: var(--pc-card-2); color: var(--pc-text); }
.pc-cat-pill.is-active {
  background: linear-gradient(155deg, var(--pc-accent-2), var(--pc-accent));
  color: #161018;
  border-color: transparent;
}

/* ---------- Encabezado de temporada (agrupación) ---------- */
.pc-season-heading {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pc-accent-2);
  margin: 22px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pc-border);
}
.pc-season-heading:first-child { margin-top: 0; }

/* ---------- Lista de episodios ---------- */
.pc-list { display: flex; flex-direction: column; gap: 10px; }

.pc-episode {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--pc-bg) 0%, var(--pc-bg-2) 100%);
  border: 1px solid var(--pc-border);
  transition: border-color 0.15s ease;
}
.pc-episode.is-active { border-color: rgba(226, 166, 59, 0.5); }

.pc-ep-play {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pc-text);
  transition: background 0.15s ease, transform 0.15s ease;
}
.pc-ep-play:hover { background: rgba(255, 255, 255, 0.16); transform: scale(1.04); }
.pc-episode.is-active .pc-ep-play {
  background: linear-gradient(155deg, var(--pc-accent-2), var(--pc-accent));
  color: #161018;
}
.pc-ep-play svg { width: 16px; height: 16px; }
.pc-ep-play .pc-icon-pause { display: none; }
.pc-episode.is-playing .pc-ep-play .pc-icon-play { display: none; }
.pc-episode.is-playing .pc-ep-play .pc-icon-pause { display: block; }
.pc-ep-play .pc-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: pc-spin 0.7s linear infinite;
}
.pc-episode.is-loading .pc-ep-play .pc-icon-play,
.pc-episode.is-loading .pc-ep-play .pc-icon-pause { display: none; }
.pc-episode.is-loading .pc-ep-play .pc-spinner { display: block; border-top-color: #161018; }
@keyframes pc-spin { to { transform: rotate(360deg); } }

.pc-ep-cover {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(155deg, #24345c, #182342);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Sin "display" explícito: al ser hijo flex se vuelve bloque igual,
   y así el atributo "hidden" (usado por JS antes de cargar la portada)
   sigue funcionando — una regla "display" propia aquí le ganaría al
   "[hidden]" del navegador sin importar el orden. */
.pc-ep-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-ep-cover .pc-cover-fallback { width: 18px; height: 18px; color: var(--pc-accent); opacity: 0.85; }
.pc-ep-cover .pc-cover-fallback svg { width: 100%; height: 100%; }

.pc-ep-main { min-width: 0; }

.pc-ep-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pc-text-dim);
  margin-bottom: 3px;
}
.pc-ep-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  font-size: 0.62rem;
}
.pc-ep-duration::before { content: "⏱ "; }
.pc-ep-date::before { content: "· "; }

.pc-ep-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--pc-text);
}

.pc-ep-description {
  font-size: 0.78rem;
  color: var(--pc-text-dim);
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-episode.is-desc-expanded .pc-ep-description {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.pc-ep-more {
  background: none;
  border: none;
  padding: 0;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pc-accent-2);
  cursor: pointer;
}
.pc-ep-more:hover { text-decoration: underline; }

/* ---------- Reproductor inline (progreso + tiempos) ---------- */
.pc-ep-player {
  grid-column: 1 / -1;
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--pc-border);
}
.pc-episode.is-active .pc-ep-player { display: flex; }

.pc-ep-time {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pc-text-dim);
  min-width: 34px;
  text-align: center;
}
.pc-ep-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  outline: none;
  cursor: pointer;
}
.pc-ep-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pc-accent-2);
  border: 2px solid #161018;
  cursor: pointer;
}
.pc-ep-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pc-accent-2);
  border: 2px solid #161018;
  cursor: pointer;
}
.pc-ep-seek::-moz-range-progress { background: var(--pc-accent); border-radius: 999px; }

/* ---------- Estados vacíos ---------- */
.pc-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--pc-text-dim);
  font-size: 0.86rem;
  background: var(--pc-card);
  border-radius: var(--pc-radius);
  border: 1px solid var(--pc-border);
}
.pc-empty-clear {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pc-text);
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.pc-empty-clear:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Responsivo ---------- */
@media (max-width: 560px) {
  .pc-episode { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .pc-ep-cover { display: none; }
  .pc-ep-play { width: 38px; height: 38px; }
  .pc-season-select { flex: 1 1 auto; }
}
