/* ============================================
   EduFlame — subject.css
   Subject page styling — Videos & PDFs
   ============================================ */

/* ---- Hero Section ---- */
.subj-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 24px 40px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.subj-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}

.subj-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.subj-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 14px;
}

.subj-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
}

.stat-pill svg {
  color: var(--accent);
}

.subj-hero-shape {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(45, 106, 79, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ---- Tabs ---- */
.tabs-wrap {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
}

.tabs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab svg {
  flex-shrink: 0;
}

/* ---- Main ---- */
.subj-main {
  padding-top: 32px !important;
}

/* ---- Video Player ---- */
.player-wrap {
  background: var(--text);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-hover);
  animation: fadeUp 0.25s ease both;
}

.player-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-close {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  flex-shrink: 0;
}

.player-close:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.player-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-frame {
  position: relative;
  padding-bottom: 56.25%;
  /* 16:9 */
  height: 0;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---- Content List ---- */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Content Card ---- */
.content-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.3s ease both;
  text-decoration: none;
  color: inherit;
}

.content-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.content-card.is-video:hover {
  border-color: #1d4ed8;
}

.content-card.is-pdf:hover {
  border-color: #c2410c;
}

/* Active video card */
.content-card.is-playing {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: none;
}

/* ---- Type Icon ---- */
.content-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s;
}

.content-card:hover .content-type-icon {
  transform: scale(1.05);
}

.content-type-icon.icon-video {
  background: var(--blue-light);
  color: var(--blue);
}

.content-type-icon.icon-pdf {
  background: var(--coral-light);
  color: var(--coral);
}

/* ---- Content Info ---- */
.content-info {
  flex: 1;
  min-width: 0;
}

.content-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.content-card.is-playing .content-title {
  color: var(--accent);
}

.content-type-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Action Icon ---- */
.content-action {
  flex-shrink: 0;
  color: var(--text-light);
  transition: color 0.18s, transform 0.18s;
}

.content-card.is-video:hover .content-action {
  color: var(--blue);
}

.content-card.is-pdf:hover .content-action {
  color: var(--coral);
}

.content-card:hover .content-action {
  transform: scale(1.1);
}

/* ---- Skeleton ---- */
.content-skeleton {
  height: 72px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.6s infinite;
}

.content-skeleton:nth-child(2) {
  animation-delay: 0.1s;
}

.content-skeleton:nth-child(3) {
  animation-delay: 0.2s;
}

.content-skeleton:nth-child(4) {
  animation-delay: 0.3s;
}

/* ---- Stagger ---- */
.content-card:nth-child(1) {
  animation-delay: 0.04s;
}

.content-card:nth-child(2) {
  animation-delay: 0.08s;
}

.content-card:nth-child(3) {
  animation-delay: 0.12s;
}

.content-card:nth-child(4) {
  animation-delay: 0.16s;
}

.content-card:nth-child(5) {
  animation-delay: 0.20s;
}

.content-card:nth-child(6) {
  animation-delay: 0.24s;
}

.content-card:nth-child(7) {
  animation-delay: 0.28s;
}

.content-card:nth-child(8) {
  animation-delay: 0.32s;
}

.content-card:nth-child(9) {
  animation-delay: 0.36s;
}

.content-card:nth-child(10) {
  animation-delay: 0.40s;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .subj-hero {
    padding: 32px 20px 28px;
  }

  .tabs {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .content-card {
    padding: 14px 14px;
    gap: 12px;
  }

  .content-type-icon {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .subj-hero {
    padding: 24px 16px 20px;
  }

  .subj-stats {
    gap: 8px;
  }

  .player-wrap {
    border-radius: var(--radius);
  }

  .content-card {
    padding: 12px 14px;
  }

  .content-type-icon {
    width: 36px;
    height: 36px;
  }

  .content-type-icon svg {
    width: 14px;
    height: 14px;
  }

  .content-title {
    font-size: 13px;
  }

  .content-type-label {
    font-size: 10.5px;
  }
}