/* Quarantined in the `legacy` cascade layer: aura.css (tokens, type,
   components) wins over everything here regardless of selector weight.
   New work goes in aura.css, not this file. */
@layer legacy {
/* =============================================================================
   FILE: public/css/tesGate.css
   TES Gate Engine — Day 13
   Progress visualization, content gating, gate advancement animations.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   CSS Variables (extend Aura palette)
   --------------------------------------------------------------------------- */
:root {
  --tes-locked:     #c8c8c0;
  --tes-unlocked:   var(--champagne-gold, #d4af37);
  --tes-current:    var(--deep-forest, #2d3e2a);
  --tes-track:      #e2e0d8;
  --tes-track-fill: var(--champagne-gold, #d4af37);
  --tes-text-muted: var(--warm-grey, #6b7562);
  --tes-radius:     10px;
}

/* ---------------------------------------------------------------------------
   Gate Progress Bar
   5-step horizontal progress indicator
   --------------------------------------------------------------------------- */
.tes-progress {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 1.5rem 0 2rem;
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.tes-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  cursor: default;
}

/* Connecting track line between steps */
.tes-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 3px;
  background: var(--tes-track);
  z-index: 0;
  transition: background 0.4s ease;
}

.tes-step.unlocked:not(:last-child)::after,
.tes-step.current:not(:last-child)::after {
  background: var(--tes-track-fill);
}

/* Step circle */
.tes-step__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--tes-locked);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: border-color 0.3s ease, background 0.3s ease;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--tes-locked);
}

.tes-step.unlocked .tes-step__circle {
  border-color: var(--tes-unlocked);
  background:   var(--tes-unlocked);
  color: #fff;
}

.tes-step.current .tes-step__circle {
  border-color: var(--tes-current);
  background:   var(--tes-current);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(45, 62, 42, 0.15);
}

/* Check icon inside unlocked circles */
.tes-step.unlocked .tes-step__circle::after {
  content: '✓';
  font-size: 0.85rem;
}

/* Gate label */
.tes-step__label {
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tes-locked);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.3;
  max-width: 64px;
}

.tes-step.unlocked .tes-step__label,
.tes-step.current .tes-step__label {
  color: var(--tes-current);
}

/* ---------------------------------------------------------------------------
   Gate Status Card
   Full status display with current tier and next requirements
   --------------------------------------------------------------------------- */
.tes-status-card {
  background:    var(--soft-cream, #faf8f4);
  border:        1px solid var(--sage-mist, #e8ede4);
  border-radius: var(--tes-radius);
  padding:       1.5rem 2rem;
  max-width:     480px;
}

.tes-status-card__tier {
  display:     flex;
  align-items: center;
  gap:         0.75rem;
  margin-bottom: 1rem;
}

.tes-status-card__badge {
  background:    var(--champagne-gold, #d4af37);
  color:         #fff;
  font-size:     0.7rem;
  font-weight:   700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding:       0.25rem 0.75rem;
  border-radius: 20px;
}

.tes-status-card__tier-name {
  font-size:   1rem;
  font-weight: 600;
  color:       var(--deep-forest, #2d3e2a);
}

.tes-status-card__hint {
  font-size:   0.82rem;
  color:       var(--tes-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Next gate requirement rows */
.tes-requirement {
  display:     flex;
  align-items: center;
  gap:         0.6rem;
  padding:     0.4rem 0;
  font-size:   0.82rem;
  color:       var(--charcoal, #2c2c2c);
}

.tes-requirement__icon {
  width:       16px;
  height:      16px;
  border-radius: 50%;
  flex-shrink: 0;
  display:     flex;
  align-items: center;
  justify-content: center;
  font-size:   0.65rem;
}

.tes-requirement.met .tes-requirement__icon {
  background: #4caf50;
  color:      #fff;
}

.tes-requirement.met .tes-requirement__icon::after { content: '✓'; }

.tes-requirement.unmet .tes-requirement__icon {
  border:     2px solid var(--tes-locked);
  background: transparent;
}

.tes-requirement.met .tes-requirement__text {
  text-decoration: line-through;
  color: var(--tes-text-muted);
}

/* ---------------------------------------------------------------------------
   Gated Content Lock Overlay
   Applied to elements with data-tes-gate="N" when user is below tier N
   --------------------------------------------------------------------------- */
.tes-locked-content {
  position:       relative;
  pointer-events: none;
  user-select:    none;
}

.tes-locked-content::before {
  content:       '';
  position:      absolute;
  inset:         0;
  background:    rgba(250, 248, 244, 0.82);
  border-radius: inherit;
  z-index:       10;
  backdrop-filter: blur(2px);
}

.tes-lock-badge {
  position:    absolute;
  top:         50%;
  left:        50%;
  transform:   translate(-50%, -50%);
  z-index:     11;
  background:  var(--soft-cream, #faf8f4);
  border:      1px solid var(--sage-mist, #e8ede4);
  border-radius: 8px;
  padding:     0.5rem 1rem;
  font-size:   0.78rem;
  color:       var(--tes-text-muted);
  font-weight: 600;
  white-space: nowrap;
  display:     flex;
  align-items: center;
  gap:         0.4rem;
  box-shadow:  0 2px 8px rgba(0,0,0,0.06);
}

.tes-lock-badge::before {
  content:   '🔒';
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------------
   Gate Advancement Celebration
   Used with .bloom-reveal class from bloom.css
   --------------------------------------------------------------------------- */
.tes-gate-advance-banner {
  background:      var(--deep-forest, #2d3e2a);
  color:           #fff;
  padding:         1rem 1.5rem;
  border-radius:   var(--tes-radius);
  display:         flex;
  align-items:     center;
  gap:             1rem;
  max-width:       400px;
  box-shadow:      0 4px 24px rgba(45, 62, 42, 0.2);
  opacity:         0;
  transform:       translateY(12px);
}

.tes-gate-advance-banner.bloom-reveal {
  animation: botanical-bloom 600ms ease-out forwards;
}

.tes-gate-advance-banner__icon {
  font-size:   1.8rem;
  flex-shrink: 0;
}

.tes-gate-advance-banner__text strong {
  display:   block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.tes-gate-advance-banner__text span {
  font-size:   0.78rem;
  opacity:     0.8;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Unlock Reveal
   Shown when a specific content key becomes available
   --------------------------------------------------------------------------- */
.tes-unlock-reveal {
  border-left: 3px solid var(--champagne-gold, #d4af37);
  padding-left: 1rem;
  opacity:      0;
}

.tes-unlock-reveal.bloom-reveal {
  animation: botanical-bloom 500ms ease-out 200ms forwards;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .tes-step__label { font-size: 0.6rem; max-width: 52px; }
  .tes-step__circle { width: 26px; height: 26px; }
  .tes-step.unlocked .tes-step__circle::after { font-size: 0.72rem; }
}
}
