/* ============================================================
   WATCH PAGE — Clean, Modern, Minimal Idiotoon Visual System
============================================================ */

/* --------------------------
   Header (Shared Style)
--------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1000px;
  margin: 2rem auto 1rem;
  padding: 0 1rem;
}

.page-header h1 {
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-medium);
  font-weight: 600;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  text-decoration: none;
  transition: 0.25s ease;
}

.close-btn:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

/* --------------------------
   Tabs
--------------------------- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tabs button {
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-medium) var(--radius-medium) 0 0;
  transition: 0.25s ease;
}

.tabs button:hover { color: var(--color-secondary); }

.tabs button.active {
  color: var(--color-bg);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

/* ============================================================
   YOUTUBE GRID — Clean Apple-Style
============================================================ */
.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.yt-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  box-shadow: 0 6px 25px rgba(0,0,0,0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}

.yt-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
}

.yt-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

/* ============================================================
   VIDEO OVERLAY PLAYER (Fullscreen)
============================================================ */
.yt-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  z-index: 9999;
}

.yt-overlay-content {
  width: 90%;
  max-width: 900px;
  aspect-ratio: 16/9;
  position: relative;
}

#ytPlayer {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 20px;
}

.yt-close {
  position: absolute;
  top: -50px;
  right: 0;
  font-size: 2rem;
  color: white;
  border: none;
  background: none;
  cursor: pointer;
}

/* ============================================================
   LESSONS TAB
============================================================ */


/* Safety */
html, body {
  overflow-x: hidden;
}

/* ------------------------------------------------------------
   Search
------------------------------------------------------------ */
.yt-search {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(140,255,220,0.35);
  color: var(--color-text);
  margin-bottom: 2rem;
  outline: none;
}

.yt-search::placeholder {
  color: var(--color-muted);
}

/* ------------------------------------------------------------
   Layout (unchanged logic, overflow-safe)
------------------------------------------------------------ */
.lesson-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 820px) {
  .lesson-layout {
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    align-items: start;
  }
}

/* Prevent horizontal push */
.lesson-left,
.lesson-cloud,
.lesson-card {
  min-width: 0;
  max-width: 100%;
}

/* ------------------------------------------------------------
   Lesson list (original look)
------------------------------------------------------------ */
.lesson-cloud {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 1.1rem;
  border-radius: 20px;
  border: 1px dashed rgba(140,255,220,0.3);
  background: rgba(255,255,255,0.04);

  /* scrolling behavior */
  max-height: 320px;   /* ~6–8 lessons */
  overflow-y: auto;
  overflow-x: hidden;
}



/* Lesson item */
.lesson-bubble {
  width: 100%;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.06);
  color: var(--color-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  line-height: 1.35;
}

.lesson-bubble:hover {
  background: rgba(255,255,255,0.09);
}

.lesson-bubble.active {
  border-color: rgba(140,255,220,0.55);
  background: rgba(255,255,255,0.12);
}

/* ------------------------------------------------------------
   Video (same position, smaller, no box)
------------------------------------------------------------ */
.lesson-video {
  margin-top: 1.2rem;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.lesson-video iframe,
#lessonVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: none;
  display: block;
}


/* ------------------------------------------------------------
   Lesson content (right side)
------------------------------------------------------------ */
.lesson-card {
  display: none;
  background: none;
  border: none;
  padding: 0;
}

.lesson-card.show {
  display: block;
}

.lesson-card h3 {
  margin: 0 0 1.2rem;
  font-size: 1.6rem;
}

/* Section titles */
.lesson-card h4 {
  margin: 1.6rem 0 0.6rem;
  color: var(--color-secondary);
  font-weight: 600;
}

/* Lists */
.lesson-card ul {
  padding-left: 1.2rem;
  max-width: 100%;
}

.lesson-card li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
  color: var(--color-muted);
}


/* ============================================================
   FULL WIDTH CONTEXT + QUESTIONS — CENTERED EDITORIAL
   (Put this at the bottom of your CSS and remove older versions)
============================================================ */

/* --- Context wrapper (full-width section, centered reading width) --- */
.lesson-full-context{
  max-width: 760px;
  margin: 90px auto 0;
  padding: 0 1.2rem;
}

/* Section title (e.g., "Real-Life Mini Scenes") */
.lesson-full-context .lesson-section-title{
  text-align: center;
  font-size: 1.85rem;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

/* Context body */
.lesson-context{
  text-align: left;
  line-height: 1.9;
  font-size: 1.05rem;
  color: var(--color-muted);
}

/* Intro paragraph (first <p> inside context) */
.lesson-context > p:first-of-type{
  text-align: center;
  margin: 0 0 54px;
  font-size: 1.05rem;
  color: var(--color-muted);
  opacity: 0.95;
}

/* Level headings (Easy / Medium / Advanced) */
.lesson-context h3{
  margin: 62px 0 14px;
  font-size: 1.15rem;
  color: var(--color-secondary);
  letter-spacing: 0.02em;
}

/* First level shouldn't have huge top margin */
.lesson-context h3:first-of-type{
  margin-top: 0;
}

/* Level paragraphs */
.lesson-context p{
  margin: 0 0 18px;
  color: var(--color-muted);
}

/* Highlighted vocab inside context */
.lesson-context strong{
  color: var(--color-text);
  font-weight: 700;
}

/* --- Questions wrapper (always under context, same width) --- */
.lesson-full-questions{
  max-width: 760px;
  margin: 70px auto 0;     /* gap under context */
  padding: 0 1.2rem 60px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 50px;
}

/* Questions title */
.lesson-full-questions .lesson-section-title{
  text-align: center;
  font-size: 1.65rem;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

/* Question list */
.lesson-questions{
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Each question item */
.lesson-questions li{
  padding: 16px 20px;
  margin: 0 0 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--color-muted);
  line-height: 1.7;
  transition: 0.25s ease;
}

.lesson-questions li:hover{
  background: rgba(255,255,255,0.07);
  border-color: rgba(140,255,220,0.28);
}





/* ------------------------------------------------------------
   Button
------------------------------------------------------------ */
.yt-btn {
  display: inline-block;
  margin-top: 1.6rem;
  padding: 11px 20px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: var(--color-bg);
  text-decoration: none;
  font-weight: 600;
  transition: 0.25s ease;
}

.yt-btn:hover {
  opacity: 0.9;
}



/* ------------------------------------------------------------
 Lesson lists
------------------------------------------------------------ */
/* =========================
   Bottom lesson links (SEO) — cute, subtle, 2 columns
========================= */

.lesson-seo{
  max-width: 1200px;
  margin: 3rem auto 0;
  padding: 0 1rem;
}

.lesson-seo-title{
  margin: 0 0 .35rem;
  font-size: 1.15rem;
  color: var(--color-text);
  opacity: .9;
}

.lesson-seo-sub{
  margin: 0 0 1.2rem;
  color: var(--color-muted);
  font-size: .95rem;
}

/* make the container NOT look like a dashed card */
.lesson-cloud--links{
  border: none;
  background: transparent;
  padding: 0;
  max-height: none;
  overflow: visible;
   padding-bottom: 90px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 820px){
  .lesson-cloud--links{
    grid-template-columns: 1fr;
  }
}

/* pill links */
.lesson-bubble--link{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;

  padding: 12px 16px;
  border-radius: 16px;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--color-text);

  white-space: normal;     /* IMPORTANT: allow wrapping */
  line-height: 1.35;
}

.lesson-bubble--link::before{
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(140,255,220,0.8); /* matches your accent vibe */
  flex: 0 0 auto;
}

.lesson-bubble--link:hover{
  background: rgba(255,255,255,0.09);
  border-color: rgba(140,255,220,0.35);
}

.lesson-bubble--link:active{
  transform: translateY(1px);
}

/* WATCH — SEO dropdown wrapper (no overrides to your existing pills/grid) */
.lesson-seo-toggle{
  border: none;
  background: transparent;
  padding: 0;
}

.lesson-seo-summary{
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 16px;
}

.lesson-seo-summary::-webkit-details-marker{ display:none; }

.lesson-seo-summary::after{
  content: "▾";
  opacity: .85;
  transition: transform .18s ease;
}

.lesson-seo-toggle[open] .lesson-seo-summary::after{
  transform: rotate(180deg);
}

/* Lessons: hide video box until a lesson is clicked (JS adds .show to #lessonCard) */
#tab-lessons .lesson-video { display: none; }
#tab-lessons.lesson-selected .lesson-video { display: block !important; }

.lesson-moreHint{
  opacity: .85;
  font-style: italic;
  cursor: pointer;
}

/* =========================
   Single lesson page layout
========================= */

/* ============================================================
   SINGLE LESSON PAGE ( /lessons/... ) — clean + practical
   Uses your watch.css vibe, but avoids base dividers
============================================================ */

.lesson-shell{
  padding: 0 1rem 90px; /* nice bottom breathing room */
}

/* Card wrapper (same vibe as your site, but controlled) */
.lesson-cardWrap{
  max-width: 1200px;
  margin: 2rem auto 0;
  border-radius: 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

.lesson-cardInner{
  padding: 26px;
}

/* Back link spacing (not glued to edge) */
.lesson-back{
  display:inline-block;
  margin: 4px 0 18px;
  color: var(--color-muted);
  text-decoration:none;
  font-weight:600;
}
.lesson-back:hover{ color: var(--color-secondary); }

/* Title: stop cropping, allow wrap, more breathing space */
.lesson-title{
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 3.6vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.lesson-sub{
  color: var(--color-muted);
  margin: 0 0 18px;
}

.lesson-note{
  margin: 0 0 18px;
  color: var(--color-muted);
  line-height: 1.7;
}

/* Layout */
.lesson-grid{
  display: grid;
  gap: 26px;
  align-items: start;
}

@media (min-width: 980px){
  .lesson-grid{
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  }
}

/* Video */
.lesson-video{
  width:100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow:hidden;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(140,255,220,0.18);
  box-shadow: 0 10px 35px rgba(0,0,0,0.45);
}

.lesson-video iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}

.lesson-yt{
  margin-top: 14px;
}

/* Headings: remove base gradient/divider lines without nuking global styles */
.lesson-shell h1::after,
.lesson-shell h2::after,
.lesson-shell h3::after,
.lesson-shell .section-divider,
.lesson-shell .gradient-line,
.lesson-shell hr{
  display:none !important;
  content:none !important;
}

.lesson-h{
  margin: 22px 0 10px;
  font-size: 1.2rem;
  color: var(--color-secondary);
}

/* Lists */
.lesson-list{
  margin: 0;
  padding-left: 1.2rem;
}

.lesson-list li{
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--color-muted);
}

.lesson-list strong{
  color: var(--color-text);
}

/* ============================================================
   MORE LESSONS — outside the card, simple 2-col list
============================================================ */

.lesson-more{
  max-width: 1200px;
  margin: 18px auto 0;
}

.lesson-moreInner{
  padding: 18px 6px 0;
}

.lesson-moreTitle{
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--color-text);
  opacity: .9;
}

.lesson-moreList{
  list-style: none;
  margin: 0;
  padding: 0 0 60px; /* extra bottom space after list */
  display: grid;
  gap: 10px 18px;
}

@media (min-width: 860px){
  .lesson-moreList{
    grid-template-columns: 1fr 1fr;
  }
}

.lesson-moreList a{
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
  color: var(--color-secondary);
  opacity: .95;
  line-height: 1.35;
}

.lesson-moreList a::before{
  content: "•";
  color: rgba(140,255,220,0.9);
}

.lesson-moreList a:hover{
  opacity: 1;
  color: var(--color-text);
}


/* Prevent refresh flash: hide Lessons SEO strip until JS marks page ready */
.lesson-seo { opacity: 0; transition: opacity .15s ease; }
body.watch-ready .lesson-seo { opacity: 1; }