/* Eduflix — light Netflix-style learner TV */
.lrn-tv,
.lrn-tv-watch {
  font-family: 'Alexandria', sans-serif;
  color: #0f172a;
  min-height: 100%;
}

.lrn-tv-surface .learn-main {
  background: #f8fafc;
}

.lrn-tv {
  background: #f8fafc;
  margin: -12px -12px 0;
  padding: 0 0 56px;
}

/* Chrome integration */
.lrn-top-header__context--tv {
  align-items: center;
}

.lrn-tv-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lrn-tv-chrome__logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
}

.lrn-tv-chrome__logo span {
  color: #dc2626;
}

.lrn-tv-chrome__filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lrn-tv-chrome__filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
}

.lrn-tv-chrome__filter select {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 10px;
  padding: 6px 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
}

.lrn-tv__hero {
  position: relative;
  min-height: 48vh;
  margin: 0 0 36px;
  background: #e2e8f0 center/cover no-repeat;
  background-image: var(--hero-bg);
  overflow: hidden;
}

.lrn-tv__hero--netflix {
  min-height: 72vh;
  margin-top: -12px;
}

.lrn-tv__hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.lrn-tv__hero-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  transform: translate(-50%, -50%);
  border: none;
}

.lrn-tv__hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(15, 23, 42, 0.35) 100%);
  pointer-events: none;
}

.lrn-tv__hero--netflix .lrn-tv__hero-overlay {
  background: linear-gradient(0deg, #f8fafc 0%, rgba(248, 250, 252, 0.4) 35%, rgba(248, 250, 252, 0.15) 60%, rgba(248, 250, 252, 0.05) 100%),
    linear-gradient(90deg, rgba(248, 250, 252, 0.92) 0%, rgba(248, 250, 252, 0.5) 40%, transparent 70%);
}

.lrn-tv__hero--netflix.is-scrolled .lrn-tv__hero-overlay {
  background: linear-gradient(0deg, #f8fafc 0%, rgba(248, 250, 252, 0.85) 50%, rgba(248, 250, 252, 0.6) 100%);
}

.lrn-tv__hero-body {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lrn-tv__hero-title {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lrn-tv__hero--netflix.is-scrolled .lrn-tv__hero-title {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.lrn-tv__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.97) 0%, rgba(248, 250, 252, 0.75) 42%, rgba(248, 250, 252, 0.35) 100%),
    linear-gradient(0deg, #f8fafc 0%, transparent 45%);
}

.lrn-tv__hero-body {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 40px 24px 28px;
}

.lrn-tv__hero-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  margin-bottom: 12px;
}

.lrn-tv__hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 900;
  line-height: 1.2;
  color: #0f172a;
}

.lrn-tv__hero-meta,
.lrn-tv__hero-desc {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.65;
}

.lrn-tv__hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.lrn-tv__hero-stats {
  display: flex;
  gap: 14px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
}

.lrn-tv__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.lrn-tv__btn:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.lrn-tv__btn--play {
  background: #dc2626;
  color: #fff;
}

.lrn-tv__btn--play:hover {
  background: #b91c1c;
}

.lrn-tv__btn--ghost {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.lrn-tv__btn--ghost.is-on {
  background: #ecfdf5;
  border-color: #86efac;
  color: #047857;
}

.lrn-tv__rows {
  padding: 8px 0 32px;
}

.lrn-tv__row {
  margin-bottom: 44px;
  padding: 0 20px;
}

.lrn-tv__row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lrn-tv__row-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-tv__row-nav {
  display: flex;
  gap: 6px;
}

.lrn-tv__row-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.lrn-tv__row-btn:hover {
  background: #f1f5f9;
}

.lrn-tv__track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.lrn-tv__track::-webkit-scrollbar {
  height: 6px;
}

.lrn-tv__track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.lrn-tv__card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  position: relative;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.lrn-tv__card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

@media (min-width: 768px) {
  .lrn-tv__card {
    flex-basis: 228px;
  }
}

.lrn-tv__card-media {
  position: relative;
}

.lrn-tv__card-poster {
  display: block;
  aspect-ratio: 16/9;
  background: #e2e8f0 center/cover no-repeat;
  position: relative;
  text-decoration: none;
}

.lrn-tv__card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  opacity: 0;
  background: rgba(15, 23, 42, 0.25);
  color: #fff;
  transition: opacity 0.2s;
}

.lrn-tv__card:hover .lrn-tv__card-play {
  opacity: 1;
}

.lrn-tv__card-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 8px 10px;
  border: none;
  border-radius: 0 0 0 10px;
  background: #dc2626;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: auto;
}

.lrn-tv__card:hover .lrn-tv__card-ribbon,
.lrn-tv__card-ribbon.is-on {
  opacity: 1;
  transform: translateX(0);
}

.lrn-tv__card-ribbon.is-on {
  background: #059669;
}

.lrn-tv__card-body {
  padding: 10px 12px 6px;
}

.lrn-tv__card-title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.35;
  color: #0f172a;
  text-decoration: none;
}

.lrn-tv__card-title:hover {
  color: #dc2626;
}

.lrn-tv__card-body p {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
}

.lrn-tv__card-lesson {
  margin-top: 3px !important;
  color: #94a3b8 !important;
}

.lrn-tv__card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px 10px;
  border-top: 1px solid #f1f5f9;
}

.lrn-tv__card-views {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
}

.lrn-tv__card-like {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.lrn-tv__card-like.is-on {
  color: #dc2626;
}

.lrn-tv__empty {
  padding: 40px 24px;
  text-align: center;
  color: #64748b;
  font-weight: 700;
}

/* Watch page */
.lrn-tv-watch {
  background: #f8fafc;
  margin: -12px -12px 0;
  padding-bottom: 48px;
}

.lrn-tv-watch__player-wrap {
  position: relative;
  width: 100%;
  background: #0f172a;
  aspect-ratio: 16/9;
  max-height: 72vh;
}

.lrn-tv-watch__player {
  position: absolute;
  inset: 0;
}

.lrn-tv-watch__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-weight: 800;
}

.lrn-tv-watch__layout {
  display: grid;
  gap: 24px;
  padding: 20px;
}

@media (min-width: 960px) {
  .lrn-tv-watch__layout {
    grid-template-columns: 1fr minmax(280px, 360px);
    align-items: start;
  }
}

.lrn-tv-watch__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.lrn-tv-watch__head h1 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-tv-watch__teacher {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
}

.lrn-tv-watch__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
}

.lrn-tv-watch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lrn-tv-watch__desc {
  font-size: 0.78rem;
  line-height: 1.7;
  color: #475569;
  font-weight: 600;
  max-width: 720px;
}

.lrn-tv-watch__react {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  align-items: center;
}

.lrn-tv-watch__react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
}

.lrn-tv-watch__react-btn.is-on {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.lrn-tv-watch__react-btn em {
  font-style: normal;
  opacity: 0.8;
  margin-right: 2px;
}

.lrn-tv-watch__react-total {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
}

.lrn-tv-watch__comments {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.lrn-tv-watch__comments-head h2 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-tv-watch__comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.lrn-tv-watch__comment-form textarea {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  resize: vertical;
  min-height: 72px;
}

.lrn-tv-watch__comment-form textarea:focus {
  outline: 2px solid #fecaca;
  border-color: #fca5a5;
}

.lrn-tv-watch__comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
}

.lrn-tv-watch__comment {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.lrn-tv-watch__comment strong {
  font-size: 0.72rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-tv-watch__comment time {
  font-size: 0.62rem;
  font-weight: 700;
  color: #94a3b8;
  margin-right: 6px;
}

.lrn-tv-watch__comment p {
  margin: 6px 0 0;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.6;
  color: #334155;
}

.lrn-tv-watch__comment-empty {
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 12px 0;
}

.lrn-tv-watch__related {
  margin-top: 8px;
}

.lrn-tv-watch__related .lrn-tv__card {
  flex: 0 0 200px;
}

/* In-platform player chrome */
.lrn-tvp {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  user-select: none;
}

.lrn-tvp__wm {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 8%;
  transform: rotate(-14deg);
  opacity: 0.08;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
}

.lrn-tvp__stage {
  position: absolute;
  inset: 0;
}

.lrn-tvp__mount {
  width: 100%;
  height: 100%;
}

.lrn-tvp__blocker {
  position: absolute;
  inset: 0;
  z-index: 20;
  cursor: pointer;
}

.lrn-tvp__center {
  position: absolute;
  inset: 0;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lrn-tvp__center span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lrn-tvp__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  direction: ltr;
}

.lrn-tvp__ctrl {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.lrn-tvp__seek {
  flex: 1;
  accent-color: #dc2626;
  direction: ltr;
}

.lrn-tvp__time {
  font-size: 0.65rem;
  font-weight: 800;
  color: #e2e8f0;
  min-width: 90px;
  text-align: center;
}

.lrn-tvp iframe {
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

/* Lesson page TV strip + modal */
.lrn-lesson-tv {
  margin: 20px 0;
  padding: 14px 0 8px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.lrn-lesson-tv__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 10px;
}

.lrn-lesson-tv__head h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-lesson-tv__head a {
  font-size: 0.68rem;
  font-weight: 800;
  color: #dc2626;
  text-decoration: none;
}

.lrn-lesson-tv .lrn-tv__track {
  padding: 0 14px 8px;
}

.lrn-lesson-tv .lrn-tv__card {
  flex-basis: 168px;
  cursor: pointer;
}

.lrn-lesson-tv-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

body.lrn-lesson-tv-modal-open {
  overflow: hidden;
}

.lrn-lesson-tv-modal[hidden] {
  display: none;
}

.lrn-lesson-tv-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.lrn-lesson-tv-modal__box {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.lrn-lesson-tv-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.lrn-lesson-tv-modal__player {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: 0;
  padding-top: 56.25%;
  background: #0f172a;
}

.lrn-lesson-tv-modal__player > .lrn-tvp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lrn-lesson-tv-modal__meta {
  padding: 14px 16px;
}

.lrn-lesson-tv-modal__meta h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 900;
  color: #0f172a;
}

.lrn-lesson-tv-modal__meta p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}

.lrn-lesson-tv-card[data-open-tv] {
  cursor: pointer;
}

/* ── Cinema modal (lesson embed) ── */
.lrn-lesson-tv-modal--cinema {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.lrn-lesson-tv-modal--cinema .lrn-lesson-tv-modal__backdrop {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
}

.lrn-lesson-tv-modal__cinema {
  position: relative;
  z-index: 1;
  width: min(1280px, 100vw);
  height: min(92vh, 900px);
  margin: auto;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

.lrn-lesson-tv-modal--cinema .lrn-lesson-tv-modal__close {
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.lrn-lesson-tv-modal__content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lrn-lesson-tv-modal__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Alexandria', sans-serif;
}

.lrn-tv-embed {
  display: grid;
  grid-template-columns: 1fr 320px;
  height: 100%;
  min-height: 0;
  background: #fff;
}

.lrn-tv-embed__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.lrn-tv-embed__player-wrap {
  flex-shrink: 0;
  background: #000;
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.lrn-tv-embed__player {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.lrn-tv-embed__meta {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
}

.lrn-tv-embed__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
  font-family: 'Alexandria', sans-serif;
  line-height: 1.4;
}

.lrn-tv-embed__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.lrn-tv-embed__bar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
}

.lrn-tv-embed__bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lrn-tv-embed__comments {
  border-right: 1px solid #e2e8f0;
  border-left: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
}

@media (max-width: 900px) {
  .lrn-lesson-tv-modal__cinema {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    margin: 0;
  }
  .lrn-tv-embed {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    overflow-y: auto;
  }
  .lrn-tv-embed__comments {
    max-height: 280px;
    border-right: none;
    border-top: 1px solid #e2e8f0;
  }
}
