/* =================================================================
   MATERIAIS.CSS  —  Central de Materiais de Estudo
   ASD Concursos de TI
   Complementa style.css (nunca duplica variáveis globais)
   ================================================================= */

/* ===================================================================
   HERO BANNER
   =================================================================== */
.mat-hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 130px 24px 90px;
  text-align: center;
}

/* Camada 1 — imagem + gradiente de fallback */
.mat-hero__bg {
  position: absolute;
  inset: 0;
  background:
    url('../assets/banners/hero-materiais.jpg') center / cover no-repeat,
    linear-gradient(135deg, #1e1b4b 0%, #2d1b69 50%, #0f172a 100%);
  z-index: 0;
  /* Ken Burns: zoom in lento e suave */
  animation: hero-zoom 20s ease-in-out infinite alternate;
  transform-origin: center center;
}
@keyframes hero-zoom {
  0%   { transform: scale(1);    }
  100% { transform: scale(1.06); }
}

/* Camada 2 — overlay direcional */
.mat-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 8, 20, 0.68) 0%,
    rgba(10, 8, 20, 0.42) 40%,
    rgba(10, 8, 20, 0.95) 100%
  );
  z-index: 1;
}

/* Camada 3 — grid sutil */
.mat-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 2;
  pointer-events: none;
}

/* Camada 4 — glow central com pulsação */
.mat-hero__glow {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 560px;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.30) 0%, transparent 66%);
  pointer-events: none;
  z-index: 2;
  animation: glow-breathe 5s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.65; transform: translateX(-50%) scale(1);    }
  50%       { opacity: 1;    transform: translateX(-50%) scale(1.12); }
}

/* Camada 5 — luz ambiente animada (sutil drift de cor) */
.mat-hero__ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 60%, rgba(124, 58, 237, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 55% 70% at 85% 40%, rgba(99, 102, 241, 0.10) 0%, transparent 55%);
  z-index: 2;
  pointer-events: none;
  animation: ambient-drift 12s ease-in-out infinite alternate;
}
@keyframes ambient-drift {
  0%   { opacity: 0.7; transform: scale(1) translateX(0);     }
  100% { opacity: 1;   transform: scale(1.04) translateX(-1%); }
}

/* Conteúdo do hero */
.mat-hero__content {
  position: relative;
  z-index: 3;
  max-width: 720px;
}

/* Stagger progressivo nas entradas do hero */
.mat-hero__content > .fade-in:nth-child(1) { transition-delay: 60ms;  }
.mat-hero__content > .fade-in:nth-child(2) { transition-delay: 160ms; }
.mat-hero__content > .fade-in:nth-child(3) { transition-delay: 270ms; }
.mat-hero__content > .fade-in:nth-child(4) { transition-delay: 400ms; }

.mat-hero__title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  color: #F1F5F9;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.mat-hero__subtitle {
  font-size: 1.1rem;
  color: #94A3B8;
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.mat-hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.mat-hero__count {
  color: #94A3B8;
  font-size: 0.875rem;
  font-weight: 500;
}
.mat-hero__count span {
  color: #C4B5FD;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ===================================================================
   BARRA DE FILTROS (sticky)
   =================================================================== */
.mat-filters-section {
  position: sticky;
  top: 64px;
  z-index: 50;
  background: rgba(10, 8, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
}

.mat-filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mat-filters::-webkit-scrollbar { display: none; }

.mat-filter-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  border: 1px solid rgba(139, 92, 246, 0.22);
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
  line-height: 1;
}
.mat-filter-btn:hover {
  color: #C4B5FD;
  border-color: rgba(196, 181, 253, 0.4);
  background: rgba(124, 58, 237, 0.08);
}
.mat-filter-btn.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(99, 102, 241, 0.18));
  color: #C4B5FD;
  border-color: rgba(196, 181, 253, 0.42);
  box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.08);
}

/* Badge de contagem no filtro */
.mat-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.18);
  color: #94A3B8;
  margin-left: 7px;
  transition: all 0.22s ease;
}
.mat-filter-btn.active .mat-filter-count {
  background: rgba(196, 181, 253, 0.22);
  color: #C4B5FD;
}

/* ===================================================================
   SKELETON LOADING
   =================================================================== */
.mat-skeleton-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 24px 0;
}

.mat-skeleton-row { margin-bottom: 52px; }

.mat-skeleton-title {
  width: 180px;
  height: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.07) 0%,
    rgba(139, 92, 246, 0.15) 50%,
    rgba(139, 92, 246, 0.07) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.mat-skeleton-cards {
  display: flex;
  gap: 16px;
  overflow: hidden;
}

.mat-skeleton-card {
  flex-shrink: 0;
  width: 280px;
  height: 218px;
  border-radius: 16px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(139, 92, 246, 0.07) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
.mat-skeleton-card:nth-child(2) { animation-delay: 0.12s; }
.mat-skeleton-card:nth-child(3) { animation-delay: 0.24s; }
.mat-skeleton-card:nth-child(4) { animation-delay: 0.36s; }

@keyframes skeleton-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ===================================================================
   ÁREA PRINCIPAL
   =================================================================== */
.mat-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 24px 96px;
  /* Transição para troca suave ao filtrar */
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ===================================================================
   LINHA POR CATEGORIA  (Netflix-style row)
   =================================================================== */
.mat-row { margin-bottom: 56px; }

.mat-row__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.mat-row__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #F1F5F9;
  letter-spacing: -0.01em;
}

.mat-row__count {
  font-size: 12px;
  color: #64748B;
  font-weight: 500;
}

/* Botões de navegação (setas) */
.mat-row__nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.mat-row__nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #94A3B8;
  font-size: 17px;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}
.mat-row__nav-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  color: #C4B5FD;
  border-color: rgba(196, 181, 253, 0.42);
  transform: scale(1.08);
}

/* Wrapper do scroll com fade na borda direita */
.mat-row__scroll-wrapper {
  position: relative;
}
.mat-row__scroll-wrapper::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 16px;
  width: 72px;
  background: linear-gradient(to left, #0a0814, transparent);
  pointer-events: none;
  z-index: 2;
}

/* Scroll horizontal — scrollbar oculta (navega por setas / gesto) */
.mat-row__scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.mat-row__scroll::-webkit-scrollbar { display: none; }

/* ===================================================================
   CARD DE EPISÓDIO
   =================================================================== */
.ep-card {
  flex-shrink: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1),
              box-shadow 0.32s ease,
              border-color 0.28s ease;
  position: relative;
  outline: none;
  scroll-snap-align: start;
}

/* Linha glow no topo ao hover */
.ep-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7C3AED, #6366F1, #C4B5FD);
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: 4;
}
.ep-card:hover::before,
.ep-card:focus-visible::before { opacity: 1; }

.ep-card:hover,
.ep-card:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow:
    0 24px 60px rgba(124, 58, 237, 0.34),
    0 0 0 1px rgba(196, 181, 253, 0.14);
  border-color: rgba(196, 181, 253, 0.3);
}

.ep-card:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.5);
  outline-offset: 2px;
}

/* Badge "Novo" — aparece no canto do thumbnail */
.ep-card__badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #10B981, #06B6D4);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
}

/* ===== THUMBNAIL ===== */
.ep-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b4b 0%, #2d1b69 100%);
}

.ep-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ep-card:hover .ep-card__thumb img { transform: scale(1.1); }

.ep-card__thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 8, 20, 0.6) 0%, transparent 50%);
  transition: opacity 0.3s ease;
}
.ep-card:hover .ep-card__thumb-overlay { opacity: 0.45; }

/* Placeholder com inicial do título — sem emoji */
.ep-card__thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  font-weight: 900;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.05em;
  color: rgba(196, 181, 253, 0.22);
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.20) 0%,
    rgba(99, 102, 241, 0.10) 50%,
    rgba(15, 12, 30, 0.85) 100%
  );
  user-select: none;
}

/* Ícone play — animação spring ao aparecer */
.ep-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.55);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.5);
}
.ep-card__play::after {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 17px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.ep-card:hover .ep-card__play,
.ep-card:focus-visible .ep-card__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ===== CORPO DO CARD ===== */
.ep-card__body { padding: 14px 16px 16px; }

.ep-card__category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(124, 58, 237, 0.18);
  color: #C4B5FD;
  border: 1px solid rgba(196, 181, 253, 0.18);
  margin-bottom: 8px;
}

.ep-card__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #F1F5F9;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Descrição — oculta em repouso, revela no hover (MasterClass-style) */
.ep-card__desc {
  font-size: 0.76rem;
  color: #94A3B8;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Estado oculto */
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transition: max-height 0.4s ease,
              opacity    0.3s ease,
              margin-bottom 0.3s ease;
}
.ep-card:hover .ep-card__desc,
.ep-card:focus-visible .ep-card__desc {
  max-height: 72px;
  opacity: 1;
  margin-bottom: 12px;
}

.ep-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ep-card__files-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #6EE7B7;
  font-weight: 600;
}

.ep-card__duration {
  font-size: 11px;
  color: #64748B;
  font-weight: 500;
}

/* ===================================================================
   MODAL PREMIUM
   =================================================================== */
.mat-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 4, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s;
}
.mat-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mat-modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f0c1e;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.35) transparent;
  /* Animação de entrada spring */
  transform: scale(0.92) translateY(28px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 48px 100px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(196, 181, 253, 0.05),
    inset 0 1px 0 rgba(196, 181, 253, 0.07);
}
.mat-modal-backdrop.open .mat-modal {
  transform: scale(1) translateY(0);
}
.mat-modal::-webkit-scrollbar       { width: 4px; }
.mat-modal::-webkit-scrollbar-track { background: transparent; }
.mat-modal::-webkit-scrollbar-thumb { background: rgba(124, 58, 237, 0.4); border-radius: 2px; }

/* Botão fechar */
.mat-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(5, 4, 14, 0.8);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #94A3B8;
  font-size: 14px;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1;
}
.mat-modal__close:hover {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
  border-color: rgba(196, 181, 253, 0.48);
  transform: scale(1.1) rotate(90deg);
}

/* ===== BANNER DO MODAL ===== */
.mat-modal__banner-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(135deg, #1e1b4b, #2d1b69);
}

.mat-modal__banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.mat-modal-backdrop.open .mat-modal__banner {
  transform: scale(1.03);
}

/* Overlay gradiente — deixa a imagem respirar, título legível na base */
.mat-modal__banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 12, 30, 1.0)  0%,
    rgba(15, 12, 30, 0.55) 38%,
    rgba(15, 12, 30, 0.10) 72%,
    transparent            100%
  );
}

/* Placeholder sem imagem */
.mat-modal__banner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 900;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.05em;
  color: rgba(196, 181, 253, 0.18);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(15, 12, 30, 0.9));
  user-select: none;
}

/* Título + badge dentro do banner — Apple TV+ / MasterClass style */
.mat-modal__banner-content {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 18px 24px 22px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mat-modal__banner-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #F1F5F9;
  line-height: 1.2;
  letter-spacing: -0.022em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  /* Animação de entrada com o modal */
  transform: translateY(6px);
  opacity: 0;
  transition: transform 0.4s ease 0.15s, opacity 0.4s ease 0.15s;
}
.mat-modal-backdrop.open .mat-modal__banner-title {
  transform: translateY(0);
  opacity: 1;
}

/* ===== CORPO DO MODAL ===== */
.mat-modal__body { padding: 20px 28px 32px; }

.mat-modal__desc {
  font-size: 0.9rem;
  color: #94A3B8;
  line-height: 1.78;
  margin-bottom: 20px;
}

/* Meta info (data, contagem de arquivos) */
.mat-modal__meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.mat-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94A3B8;
}
.mat-meta-item strong { color: #C4B5FD; font-weight: 600; }

/* Seção de arquivos */
.mat-modal__files-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mat-modal__files {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Item de arquivo */
.mat-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.13);
  border-radius: 12px;
  transition: all 0.22s ease;
}
.mat-file-item:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(196, 181, 253, 0.24);
  transform: translateX(2px);
}

.mat-file-info {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mat-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(196, 181, 253, 0.14);
}

.mat-file-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #F1F5F9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mat-file-size {
  font-size: 11px;
  color: #64748B;
  margin-top: 2px;
}

.mat-file-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

/* Botões de ação — tamanhos touch-friendly */
.mat-btn-view,
.mat-btn-dl {
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  line-height: 1;
  min-height: 36px;
}

.mat-btn-view {
  background: transparent;
  color: #C4B5FD;
  border: 1px solid rgba(196, 181, 253, 0.28);
}
.mat-btn-view:hover {
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(196, 181, 253, 0.5);
  color: #fff;
}

.mat-btn-dl {
  background: linear-gradient(135deg, #7C3AED, #6366F1);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.38);
}
.mat-btn-dl:hover {
  background: linear-gradient(135deg, #6D28D9, #4F46E5);
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.58);
  transform: translateY(-1px);
}

/* Feedback visual ao iniciar download */
.mat-btn-dl.downloading {
  background: linear-gradient(135deg, #10B981, #06B6D4);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  pointer-events: none;
}

/* ===================================================================
   ESTADO VAZIO
   =================================================================== */
.mat-empty {
  text-align: center;
  padding: 90px 24px;
  color: #64748B;
}

/* ===================================================================
   ITEM ATIVO NO NAVBAR
   =================================================================== */
.nav-link-active {
  color: #C4B5FD !important;
  font-weight: 600;
}

/* ===================================================================
   RESPONSIVIDADE
   =================================================================== */
@media (max-width: 900px) {
  .ep-card { width: 248px; }
  .mat-skeleton-card { width: 248px; }
}

@media (max-width: 768px) {
  .mat-hero {
    min-height: 58vh;
    padding: 118px 20px 68px;
  }
  .mat-hero__actions {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .mat-modal__body { padding: 18px 20px 28px; }
  .mat-modal__banner-title { font-size: 1.25rem; }
  .mat-main { padding: 36px 16px 72px; }
  .mat-skeleton-container { padding: 36px 16px 0; }
  .mat-filters { padding: 12px 16px; }
  .mat-row__nav { display: none; } /* Setas ocultas em tablet/mobile — usa gesto */
}

/* Mobile — modal vira bottom sheet */
@media (max-width: 640px) {
  .mat-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .mat-modal {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .mat-modal-backdrop.open .mat-modal {
    transform: translateY(0);
  }
  /* Pill de drag (indicador de bottom sheet) */
  .mat-modal::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(139, 92, 246, 0.28);
    margin: 12px auto 0;
  }
  .mat-modal__banner-wrap {
    aspect-ratio: 16 / 7;
    border-radius: 0;
  }
  .mat-modal__banner-title { font-size: 1.15rem; }
  .mat-btn-view,
  .mat-btn-dl {
    padding: 11px 16px;
    font-size: 12px;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .ep-card { width: 215px; }
  .mat-skeleton-card { width: 215px; }
  .mat-file-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .mat-file-actions { width: 100%; justify-content: flex-end; }
  .mat-modal__meta { gap: 12px; }
}

/* ===================================================================
   HERO SLIDER  (Netflix / Prime Video style)
   =================================================================== */
.mat-slider-section {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 500px;
  max-height: 780px;
  overflow: hidden;
  background: #0a0814;
}

/* Container que empilha todos os slides */
.mat-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Cada slide */
.mat-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.mat-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.mat-slide.leaving {
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* Fundo do slide — gradiente por módulo */
.mat-slide__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: background 1s ease;
}

/* Grid sutil sobre o fundo */
.mat-slide__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,92,246,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

/* Glow central do slide */
.mat-slide__glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 820px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
}
.mat-slide.active .mat-slide__glow {
  opacity: 1;
  animation: slide-glow-pulse 6s ease-in-out infinite;
}
@keyframes slide-glow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1);    opacity: 0.7; }
  50%       { transform: translateX(-50%) scale(1.1); opacity: 1;   }
}

/* Overlay gradiente na base (legibilidade do texto) */
.mat-slide__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(10,8,20,0.96) 0%,
    rgba(10,8,20,0.72) 38%,
    rgba(10,8,20,0.20) 65%,
    transparent        100%
  ),
  linear-gradient(
    to top,
    rgba(10,8,20,0.92) 0%,
    rgba(10,8,20,0.30) 30%,
    transparent        60%
  );
}

/* Conteúdo textual do slide (lado esquerdo) */
.mat-slide__content {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(calc(-50% + 24px));
  z-index: 3;
  max-width: 580px;
  padding: 0 60px 0 64px;
  opacity: 0;
  transition:
    opacity  0.65s ease 0.35s,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}
.mat-slide.active .mat-slide__content {
  opacity: 1;
  transform: translateY(-50%);
}

/* Eyebrow — "Módulo 01 · Redes de Computadores" */
.mat-slide__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(196,181,253,0.7);
}
.mat-slide__eyebrow-sep {
  width: 20px;
  height: 1px;
  background: rgba(196,181,253,0.35);
  display: inline-block;
}

/* Ícone grande do módulo */
.mat-slide__icon {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 4px 24px rgba(124,58,237,0.5));
}

/* Título principal */
.mat-slide__title {
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  font-weight: 900;
  color: #F1F5F9;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

/* Descrição curta */
.mat-slide__desc {
  font-size: 1rem;
  color: #94A3B8;
  line-height: 1.72;
  margin-bottom: 32px;
  max-width: 430px;
}

/* Botões CTA */
.mat-slide__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mat-slide__btn-primary {
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  background: linear-gradient(135deg, #7C3AED, #6366F1);
  box-shadow: 0 6px 24px rgba(124,58,237,0.42);
}
.mat-slide__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(124,58,237,0.62);
  background: linear-gradient(135deg, #6D28D9, #4F46E5);
}

.mat-slide__btn-secondary {
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  text-decoration: none;
  color: #C4B5FD;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(196,181,253,0.28);
  backdrop-filter: blur(8px);
}
.mat-slide__btn-secondary:hover {
  background: rgba(124,58,237,0.22);
  border-color: rgba(196,181,253,0.5);
  color: #fff;
  transform: translateY(-2px);
}

/* Badge de contagem de materiais no slide */
.mat-slide__count {
  position: absolute;
  bottom: 28px;
  left: 64px;
  z-index: 4;
  font-size: 11px;
  font-weight: 600;
  color: rgba(148,163,184,0.7);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease 0.7s, transform 0.5s ease 0.7s;
}
.mat-slide.active .mat-slide__count { opacity: 1; transform: translateY(0); }
.mat-slide__count strong { color: #C4B5FD; }

/* ===== UI de navegação (sobre todos os slides) ===== */
.mat-slider__ui {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}
.mat-slider__ui > * { pointer-events: auto; }

/* Setas */
.mat-slider__arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10,8,20,0.55);
  border: 1px solid rgba(139,92,246,0.3);
  color: #C4B5FD;
  font-size: 22px;
  font-family: system-ui, sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.mat-slider__arrow:hover {
  background: rgba(124,58,237,0.38);
  border-color: rgba(196,181,253,0.5);
  color: #fff;
  transform: scale(1.1);
}

/* Dots de progresso */
.mat-slider__dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mat-slider__dot {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.35s cubic-bezier(0.34,1.2,0.64,1), background 0.35s ease;
  width: 22px;
  position: relative;
}
.mat-slider__dot.active {
  width: 52px;
  background: rgba(196,181,253,0.3);
}
/* Preenchimento animado no dot ativo */
.mat-slider__dot.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #7C3AED, #C4B5FD);
  border-radius: 2px;
  width: 0%;
  animation: dot-fill-progress var(--slide-interval, 5.5s) linear forwards;
}
@keyframes dot-fill-progress {
  from { width: 0%;   }
  to   { width: 100%; }
}
.mat-slider__dot:hover:not(.active) { background: rgba(255,255,255,0.35); }

/* ===================================================================
   PAINEL DECORATIVO DIREITO (preview do módulo)
   =================================================================== */
.mat-slide__preview {
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%) translateX(36px);
  opacity: 0;
  z-index: 4;
  width: 298px;
  background: rgba(10, 8, 25, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 20px;
  padding: 18px 20px 16px;
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(196, 181, 253, 0.05),
    inset 0 1px 0 rgba(196, 181, 253, 0.07);
  transition:
    opacity  0.65s ease 0.5s,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}
.mat-slide.active .mat-slide__preview {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.mat-slide__preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mat-slide__preview-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748B;
}
.mat-slide__preview-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.2);
  color: #C4B5FD;
  border: 1px solid rgba(196, 181, 253, 0.18);
}

.mat-slide__preview-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mat-slide__preview-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mat-slide__preview-item:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(196, 181, 253, 0.22);
}

.mat-slide__preview-thumb {
  position: relative;
  width: 52px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.28), rgba(99,102,241,0.15));
}
.mat-slide__preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mat-slide__preview-initial {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: rgba(196, 181, 253, 0.4);
  font-family: 'Inter', sans-serif;
}

.mat-slide__preview-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mat-slide__preview-title {
  font-size: 12px;
  font-weight: 600;
  color: #E2E8F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mat-slide__preview-files {
  font-size: 10px;
  color: #6EE7B7;
  font-weight: 500;
}

.mat-slide__preview-footer {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  font-size: 11px;
  color: #64748B;
  text-align: center;
}
.mat-slide__preview-footer strong {
  color: #C4B5FD;
  font-weight: 700;
}

/* ===================================================================
   CARD — badge "Assistido" (localStorage)
   =================================================================== */
.ep-card__badge-viewed {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(100,116,139,0.55);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
}

/* ===================================================================
   RESPONSIVIDADE SLIDER
   =================================================================== */
@media (max-width: 1100px) {
  .mat-slide__preview { width: 260px; right: 40px; }
}

@media (max-width: 900px) {
  .mat-slider-section { height: 62vh; min-height: 440px; }
  .mat-slide__content { padding: 0 40px 0 40px; max-width: 500px; }
  .mat-slide__count { left: 40px; }
  .mat-slide__preview { display: none; }
}

@media (max-width: 640px) {
  .mat-slider-section { height: 88vw; min-height: 360px; max-height: 560px; }
  .mat-slide__overlay {
    background: linear-gradient(
      to top,
      rgba(10,8,20,0.97) 0%,
      rgba(10,8,20,0.75) 45%,
      rgba(10,8,20,0.30) 75%,
      transparent 100%
    );
  }
  .mat-slide__content {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(22px);
    padding: 0 20px 68px;
    max-width: 100%;
    text-align: left;
  }
  .mat-slide.active .mat-slide__content {
    transform: translateY(0);
  }
  .mat-slide__icon { font-size: 2.4rem; margin-bottom: 10px; }
  .mat-slide__title { font-size: 1.65rem; margin-bottom: 10px; }
  .mat-slide__desc { font-size: 0.85rem; margin-bottom: 22px; max-width: 100%; }
  .mat-slide__btn-primary,
  .mat-slide__btn-secondary { padding: 12px 22px; font-size: 13px; }
  .mat-slide__count { left: 20px; bottom: 8px; font-size: 10px; }
  .mat-slider__ui { bottom: 14px; gap: 10px; }
  .mat-slider__arrow { width: 34px; height: 34px; font-size: 18px; }
  .mat-slider__dot { width: 18px; }
  .mat-slider__dot.active { width: 40px; }
}
