/* ============================================================
   ProfeAcademī · Slideshow para usuarios aprobados
   Reemplaza subtítulo + buscador + filtros una vez logeado.
   ============================================================ */

/* Modo "approved": ocultar subtítulo, búsqueda y filtros */
.dashboard-main.pa-approved .dashboard-subtitle,
.dashboard-main.pa-approved .search-container,
.dashboard-main.pa-approved .category-filters {
  display: none !important;
}

/* ── Contenedor principal del slideshow ── */
.pa-slideshow {
  display: none;
  position: relative;
  width: min(94%, 1100px);
  margin: 1.2rem auto 0.4rem;
  aspect-ratio: 32 / 9;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 20%, rgba(167,139,250,0.18), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(124,58,237,0.18), transparent 60%),
    linear-gradient(135deg, rgba(26,16,51,0.55), rgba(45,21,90,0.55));
  box-shadow:
    0 18px 50px rgba(76, 29, 149, 0.28),
    0 0 0 1px rgba(167,139,250,0.18),
    inset 0 0 0 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: pa-slideshow-in 0.7s cubic-bezier(.2,.8,.25,1) both;
}
.dashboard-main.pa-approved .pa-slideshow { display: block; }

@keyframes pa-slideshow-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* Glow externo sutil */
.pa-slideshow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(167,139,250,0.35), rgba(56,189,248,0.18), rgba(244,114,182,0.25));
  z-index: -1;
  filter: blur(16px);
  opacity: 0.55;
  animation: pa-slideshow-glow 8s ease-in-out infinite alternate;
}
@keyframes pa-slideshow-glow {
  0%   { opacity: 0.4; }
  100% { opacity: 0.75; }
}

/* ── Track de slides ── */
.pa-slideshow-track {
  position: absolute;
  inset: 0;
}

.pa-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.1s ease, transform 8s ease-out;
  pointer-events: none;
}
.pa-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.pa-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Ken Burns suave en la imagen activa */
.pa-slide.is-active img {
  animation: pa-kenburns 12s ease-out forwards;
}
@keyframes pa-kenburns {
  from { transform: scale(1.0); }
  to   { transform: scale(1.08); }
}

/* Velo degradado encima de la imagen para legibilidad de controles */
.pa-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(20,5,45,0.55) 100%),
    linear-gradient(90deg, rgba(20,5,45,0.25), transparent 25%, transparent 75%, rgba(20,5,45,0.25));
  pointer-events: none;
}

/* ── Estado vacío (sin imágenes) ── */
.pa-slideshow-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: rgba(226, 220, 255, 0.85);
  text-align: center;
  padding: 1rem;
}
.pa-slideshow-empty .pa-empty-icon {
  font-size: 2.6rem;
  filter: drop-shadow(0 4px 12px rgba(124,58,237,0.5));
}
.pa-slideshow-empty h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pa-slideshow-empty p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(199,189,236,0.75);
  max-width: 360px;
}

.pa-slideshow.has-slides .pa-slideshow-empty { display: none; }

/* ── Flechas de navegación ── */
.pa-slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(20, 5, 45, 0.45);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, transform 0.2s ease;
}
.pa-slideshow:hover .pa-slide-arrow,
.pa-slideshow:focus-within .pa-slide-arrow { opacity: 1; }
.pa-slide-arrow:hover {
  background: rgba(124,58,237,0.7);
  transform: translateY(-50%) scale(1.08);
}
.pa-slide-arrow.prev { left: 14px; }
.pa-slide-arrow.next { right: 14px; }

.pa-slideshow:not(.has-slides) .pa-slide-arrow,
.pa-slideshow.single .pa-slide-arrow { display: none; }

/* ── Indicadores (dots) ── */
.pa-slide-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.pa-slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.pa-slide-dot.is-active {
  width: 26px;
  border-radius: 4px;
  background: linear-gradient(90deg, #a78bfa, #f0abfc);
  box-shadow: 0 0 14px rgba(167,139,250,0.7);
}

.pa-slideshow:not(.has-slides) .pa-slide-dots,
.pa-slideshow.single .pa-slide-dots { display: none; }

/* ── Botón flotante "Gestionar" (solo admin) ── */
.pa-slide-manage {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(20, 5, 45, 0.55);
  backdrop-filter: blur(10px);
  color: #f5f3ff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.pa-slide-manage:hover {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  transform: translateY(-1px);
}
.dashboard-main.pa-is-admin .pa-slide-manage { display: inline-flex; }

/* ── Modal de gestión ── */
.pa-slide-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 3, 24, 0.7);
  backdrop-filter: blur(10px);
  z-index: 9100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pa-slide-modal-overlay.open { display: flex; }

.pa-slide-modal {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 88vh;
  overflow: auto;
  background: linear-gradient(160deg, #1a1033, #251247);
  border: 1px solid rgba(167,139,250,0.35);
  border-radius: 20px;
  padding: 1.8rem 1.6rem 1.4rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 50px rgba(124,58,237,0.25);
  animation: pa-slideshow-in 0.35s ease both;
}

.pa-slide-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.pa-slide-modal-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #a78bfa, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pa-slide-modal-head p {
  margin: 0;
  font-size: 0.82rem;
  color: #a5a3c7;
}
.pa-slide-modal-close {
  background: none;
  border: 0;
  color: #9ca3af;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.pa-slide-modal-close:hover { color: #fff; }

/* Drop zone */
.pa-drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.6rem 1rem;
  border: 2px dashed rgba(167,139,250,0.45);
  border-radius: 14px;
  background: rgba(124,58,237,0.06);
  color: #c4b5fd;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.pa-drop-zone:hover,
.pa-drop-zone.dragover {
  background: rgba(124,58,237,0.16);
  border-color: rgba(167,139,250,0.85);
  transform: translateY(-1px);
}
.pa-drop-zone .pa-drop-icon { font-size: 2rem; }
.pa-drop-zone strong { color: #ede9fe; font-weight: 600; }
.pa-drop-zone small { color: #9ca3af; font-size: 0.75rem; }
.pa-drop-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* Lista de imágenes */
.pa-slide-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.pa-slide-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(167,139,250,0.25);
  background: #0f0824;
}
.pa-slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pa-slide-item-actions {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: linear-gradient(180deg, transparent, rgba(8,3,24,0.85));
  opacity: 0;
  transition: opacity 0.2s;
}
.pa-slide-item:hover .pa-slide-item-actions { opacity: 1; }
.pa-slide-item-actions button {
  flex: 1;
  padding: 4px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  background: rgba(255,255,255,0.92);
  color: #1f1037;
  transition: background 0.15s, transform 0.1s;
}
.pa-slide-item-actions button:hover { background: #fff; transform: translateY(-1px); }
.pa-slide-item-actions button.danger {
  background: rgba(239,68,68,0.9);
  color: #fff;
}
.pa-slide-item-actions button.danger:hover { background: #ef4444; }

.pa-slide-empty-list {
  grid-column: 1 / -1;
  text-align: center;
  padding: 1.4rem 1rem;
  color: #9ca3af;
  font-size: 0.85rem;
  border: 1px dashed rgba(167,139,250,0.2);
  border-radius: 10px;
}

.pa-slide-modal-status {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: #c4b5fd;
  min-height: 1.1em;
}
.pa-slide-modal-status.error { color: #fca5a5; }
.pa-slide-modal-status.ok { color: #86efac; }

/* ── Responsivo ── */
@media (max-width: 760px) {
  .pa-slideshow {
    aspect-ratio: 32 / 9;
    border-radius: 18px;
    margin-top: 0.8rem;
  }
  .pa-slide-arrow { width: 36px; height: 36px; }
  .pa-slide-manage { font-size: 0.72rem; padding: 5px 10px; }
}
@media (max-width: 480px) {
  .pa-slideshow { aspect-ratio: 4 / 3; }
}

/* ── Variantes por tema ── */
body.theme-light .pa-slideshow {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(167,139,250,0.18), transparent 60%),
    linear-gradient(135deg, rgba(255,237,213,0.6), rgba(254,215,170,0.55));
  box-shadow:
    0 14px 40px rgba(255, 138, 76, 0.18),
    0 0 0 1px rgba(255,255,255,0.5),
    inset 0 0 0 1px rgba(255,255,255,0.4);
}
body.theme-light .pa-slideshow::before {
  background: linear-gradient(135deg, rgba(255,184,107,0.5), rgba(244,114,182,0.4), rgba(167,139,250,0.4));
}
body.theme-light .pa-slideshow-empty {
  color: #4b1f7a;
}
body.theme-light .pa-slideshow-empty p { color: #7c3aed; }

body.theme-rosa .pa-slideshow {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,182,193,0.4), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(236,72,153,0.18), transparent 60%),
    linear-gradient(135deg, rgba(252,231,243,0.65), rgba(251,207,232,0.55));
  box-shadow:
    0 14px 40px rgba(236, 72, 153, 0.22),
    0 0 0 1px rgba(255,255,255,0.4);
}
body.theme-rosa .pa-slideshow::before {
  background: linear-gradient(135deg, rgba(244,114,182,0.5), rgba(167,139,250,0.4));
}

body.theme-neon .pa-slideshow {
  box-shadow:
    0 0 30px rgba(167,139,250,0.5),
    0 0 60px rgba(56,189,248,0.25),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}
body.theme-neon .pa-slide-dot.is-active {
  box-shadow: 0 0 20px rgba(167,139,250,0.95), 0 0 30px rgba(244,114,182,0.7);
}
