/* ============================================================
   Writing Lesson 2 — Opinion Essay Builder
   ============================================================ */

.wl2-page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ── Guide notes ── */
.wl2-guide-note {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 1rem; color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
}
.wl2-guide-note.wl2-gn-gold {
  background: rgba(251,191,36,0.08);
  border-color: rgba(251,191,36,0.3);
  color: #fde68a;
}
.wl2-gn-arrow { font-size: 1.15rem; }

/* ── Intro card ── */
.wl2-intro-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 28px 32px 24px;
  margin-bottom: 36px;
}
.wl2-ic-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.wl2-ic-icon { font-size: 1.5rem; }
.wl2-ic-title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.wl2-ic-body  { font-size: 1rem; line-height: 1.7; color: rgba(255,255,255,0.78); margin: 0 0 14px; }
.wl2-ic-section-title {
  font-size: .88rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 10px;
}
.wl2-ic-phrases {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.wl2-ic-phrase {
  display: inline-block;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .93rem; color: #fde68a;
  font-style: italic;
}
.wl2-ic-compare {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.wl2-ic-citem {
  flex: 1; min-width: 180px;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid transparent;
}
.wl2-ic-opinion  { background: rgba(96,165,250,0.08); border-color: rgba(96,165,250,0.3); }
.wl2-ic-discuss  { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.3); }
.wl2-ic-problem  { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.3); }
.wl2-ic-clabel {
  font-size: .9rem; font-weight: 700; margin-bottom: 6px;
}
.wl2-ic-opinion .wl2-ic-clabel  { color: #93c5fd; }
.wl2-ic-discuss .wl2-ic-clabel  { color: #c4b5fd; }
.wl2-ic-problem .wl2-ic-clabel  { color: #6ee7b7; }
.wl2-ic-cdesc { font-size: .88rem; color: rgba(255,255,255,0.7); line-height: 1.5; }

/* ── Main grid wrap ── */
.wl2-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: start;
  gap: 0;
}

.wl2-row-fullspan { grid-column: 1 / -1; }
.wl2-row-org      { grid-column: 1; }
.wl2-row-essay    { grid-column: 2; }

/* ── Question box ── */
.wl2-qbox {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 12px;
  padding: 20px 28px;
  margin-bottom: 24px;
  text-align: center;
  position: relative;
}

.wl2-qlabel {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.wl2-qtext {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  font-weight: 500;
}

.wl2-q-part {
  border-radius: 5px;
  padding: 2px 4px;
  transition: background .3s, color .3s;
}

.wl2-q-highlighted {
  background: rgba(96,165,250,0.2);
  color: #93c5fd;
}

.wl2-q-gold.wl2-q-highlighted {
  background: rgba(251,191,36,0.2);
  color: #fcd34d;
}

/* ── Annotation popup (question box) ── */
.wl2-annotation {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  background: rgba(15,15,20,0.97);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 520px;
  text-align: left;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  animation: wl2-fadein .3s ease;
}

.wl2-ann-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px; height: 8px;
  background: rgba(15,15,20,0.97);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-left: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.15);
}

.wl2-ann-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: .04em;
}

.wl2-ann-body {
  font-size: .88rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

.wl2-ann-option {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
}
.wl2-ao-agree    { background: rgba(74,222,128,0.15); color: #86efac; border: 1px solid rgba(74,222,128,0.3); }
.wl2-ao-disagree { background: rgba(248,113,113,0.15); color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }
.wl2-ao-partial  { background: rgba(251,191,36,0.12); color: #fcd34d; border: 1px solid rgba(251,191,36,0.3); }

/* ── Organizer column ── */
.wl2-org-col {
  padding-right: 20px;
  padding-left: 0;
  box-sizing: border-box;
}

.wl2-org-section {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: visible;        /* allow tip panels to breathe */
  margin-bottom: 0;
}

.wl2-org-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px 12px 0 0;
}

.wl2-org-icon  { font-size: 1rem; }
.wl2-org-title { font-size: .95rem; font-weight: 700; color: rgba(255,255,255,0.85); flex: 1; }
.wl2-org-hint  { font-size: .72rem; color: rgba(255,255,255,0.3); }

.wl2-org-steps { padding: 6px 0; }

.wl2-org-arrow {
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 1.1rem;
  padding: 6px 0;
}

/* ── Individual steps ── */
.wl2-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  margin: 3px 8px;
  transition: background .2s, opacity .2s;
}

.wl2-step.next {
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
}
.wl2-step.next:hover { background: rgba(255,255,255,0.08); }

.wl2-step.done  { opacity: .65; }
.wl2-step.locked { opacity: .3; cursor: not-allowed; }

/* ── Step number badge ── */
.wl2-stepnum {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.wl2-stepnum.next {
  background: var(--gold);
  color: #111;
}

.wl2-stepnum.done {
  background: rgba(74,222,128,0.2);
  color: #86efac;
  border: 1px solid rgba(74,222,128,0.4);
}

.wl2-stepnum.locked {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.3);
}

/* Bounce animation on the next step number */
@keyframes wl2-bounce {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-5px); }
  60%       { transform: translateY(-2px); }
}
.wl2-stepnum.bounce {
  animation: wl2-bounce 1s ease infinite;
}

/* ── Step content (right of number) ── */
.wl2-step-content { grid-column: 3; }

.wl2-stepname {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2px;
}

.wl2-stepdesc {
  font-size: .86rem;
  color: rgba(255,255,255,0.42);
  line-height: 1.45;
}

.wl2-adot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 7px;
}

/* ── Locked sections ── */
.wl2-section-locked .wl2-org-header { opacity: .4; }

.wl2-locked-steps {
  font-size: .82rem;
  color: rgba(255,255,255,0.22);
  font-style: italic;
  padding: 10px 14px;
  text-align: center;
}

/* ── Essay column ── */
.wl2-essay-col {
  padding-left: 18px;
  box-sizing: border-box;
}

.wl2-essay-label {
  font-size: .75rem;
  font-weight: 800;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 14px;
}

.wl2-essay-para-block {
  margin-bottom: 8px;
}

.wl2-essay-para-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
  padding: 4px 0;
}
.wl2-epl-blue   { color: #60a5fa; border-bottom: 1px solid rgba(96,165,250,0.2); }
.wl2-epl-yellow { color: #fbbf24; border-bottom: 1px solid rgba(251,191,36,0.2); }
.wl2-epl-purple { color: #a78bfa; border-bottom: 1px solid rgba(167,139,250,0.2); }
.wl2-epl-green  { color: #4ade80; border-bottom: 1px solid rgba(74,222,128,0.2); }

/* Revealed sentence */
.wl2-sent {
  display: block;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.88);
  padding: 6px 14px 6px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  border-left: 4px solid transparent;
  animation: wl2-fadein .4s ease;
}

.wl2-sent-lbl {
  display: inline-block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-right: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  vertical-align: middle;
  white-space: nowrap;
}

/* Empty placeholder slot */
.wl2-essay-empty {
  display: flex;
  align-items: center;
  height: 36px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0 14px;
  margin-bottom: 2px;
}

.wl2-essay-placeholder {
  font-size: .85rem;
  color: rgba(255,255,255,0.2);
  font-style: italic;
}

/* Locked body/conclusion blocks */
.wl2-essay-locked { opacity: .35; }

/* ── SVG overlay ── */
.wl2-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ── Fade-in animation ── */
@keyframes wl2-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Final essay copy ── */
.wl2-final-essay {
  margin-top: 48px;
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 16px;
  overflow: hidden;
  animation: wl2-fadein .5s ease;
}

.wl2-final-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  background: rgba(74,222,128,0.07);
  border-bottom: 1px solid rgba(74,222,128,0.15);
}

.wl2-final-icon {
  font-size: 1.6rem;
}

.wl2-final-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #86efac;
  margin-bottom: 2px;
}

.wl2-final-sub {
  font-size: .82rem;
  color: rgba(255,255,255,0.4);
}

.wl2-final-body {
  padding: 28px 36px;
}

.wl2-final-p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.88);
  margin: 0 0 18px 0;
}

.wl2-final-p:last-child { margin-bottom: 0; }

/* ── Final essay — clickable highlighted spans ── */
@keyframes wl2-hl-pulse {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.35); }
}

.wl2-fa-hl {
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 3px;
  border-bottom: 2px solid;
  animation: wl2-hl-pulse 2.8s ease-in-out infinite;
  transition: filter .15s;
  display: inline;
}
.wl2-fa-hl:hover { animation: none; filter: brightness(1.6); }

/* Color variants */
.wl2-hl-blue    { background: rgba(96,165,250,0.14);  border-color: rgba(96,165,250,0.55); }
.wl2-hl-gold    { background: rgba(251,191,36,0.14);  border-color: rgba(251,191,36,0.55); }
.wl2-hl-slate   { background: rgba(148,163,184,0.14); border-color: rgba(148,163,184,0.5); }
.wl2-hl-orange  { background: rgba(249,115,22,0.14);  border-color: rgba(249,115,22,0.55); }
.wl2-hl-teal    { background: rgba(45,212,191,0.14);  border-color: rgba(45,212,191,0.55); }
.wl2-hl-cyan    { background: rgba(34,211,238,0.14);  border-color: rgba(34,211,238,0.55); }
.wl2-hl-pink    { background: rgba(244,114,182,0.14); border-color: rgba(244,114,182,0.55); }
.wl2-hl-rose    { background: rgba(251,113,133,0.14); border-color: rgba(251,113,133,0.55); }
.wl2-hl-purple  { background: rgba(167,139,250,0.14); border-color: rgba(167,139,250,0.55); }
.wl2-hl-amber   { background: rgba(245,158,11,0.14);  border-color: rgba(245,158,11,0.55); }
.wl2-hl-yellow  { background: rgba(250,204,21,0.14);  border-color: rgba(250,204,21,0.55); }
.wl2-hl-green   { background: rgba(74,222,128,0.14);  border-color: rgba(74,222,128,0.55); }
.wl2-hl-emerald { background: rgba(52,211,153,0.14);  border-color: rgba(52,211,153,0.55); }

/* ── Tip popup — fixed, appended to body ── */
.wl2-fa-popup {
  position: absolute;
  z-index: 9999;
  background: #13131e;
  border: 1px solid rgba(251,191,36,0.35);
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  animation: wl2-fadein .2s ease;
}

.wl2-fa-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .15s;
}
.wl2-fa-close:hover { color: rgba(255,255,255,0.85); }

.wl2-fa-pop-label {
  font-size: .88rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: .03em;
  padding-right: 24px;
}

.wl2-fa-pop-body {
  font-size: .9rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.75;
}
