/* assets/css/learning-layer.css */
/* SurferX Learning Layer Styling */

:root {
  --cyan: #39d6ff;
  --green: #74f7b2;
  --gold: #ffd166;
  --text: #eaffff;
  --muted: #8fb7c8;
  --panel: #071522;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

/* ─────────────────────────────────────────────────────────
   TIER SELECTOR
   ───────────────────────────────────────────────────────── */

/* Default panel selector (non-hero). Hero uses .level-row flex from index + .hero-learning-tier. */
#learningTierSelector:not(.hero-learning-tier) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 0;
}

.tier-option {
  position: relative;
  display: block;
  padding: 16px;
  border: 2px solid rgba(57, 214, 255, 0.18);
  border-radius: 16px;
  background: rgba(7, 21, 34, 0.72);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tier-option input {
  display: none;
}

.tier-option input:checked + .tier-label,
.tier-option.active {
  color: var(--green);
  border-color: rgba(116, 247, 178, 0.45);
  background: rgba(116, 247, 178, 0.08);
}

.tier-option .tier-label {
  display: block;
  font-weight: 900;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.tier-option .tier-desc {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.tier-option:hover {
  border-color: rgba(57, 214, 255, 0.32);
  background: rgba(57, 214, 255, 0.06);
}

/* ─────────────────────────────────────────────────────────
   HELP POPUPS
   ───────────────────────────────────────────────────────── */

.help-pop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 6px;
  border-radius: 50%;
  background: rgba(57, 214, 255, 0.12);
  border: 1px solid rgba(57, 214, 255, 0.3);
  color: var(--cyan);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.help-pop:hover {
  background: rgba(57, 214, 255, 0.25);
  border-color: rgba(57, 214, 255, 0.5);
  box-shadow: 0 0 16px rgba(57, 214, 255, 0.2);
}

.help-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.help-popup.visible {
  opacity: 1;
}

.help-popup-content {
  position: relative;
  max-width: 420px;
  margin: 20px;
  padding: 24px;
  border: 1px solid rgba(57, 214, 255, 0.22);
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(9, 27, 44, 0.96),
    rgba(7, 21, 34, 0.92)
  );
  box-shadow: var(--shadow);
  animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.help-popup-content h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--cyan);
  letter-spacing: -0.5px;
}

.help-popup-content p {
  margin: 0;
  font-size: 14px;
  color: #c4d9e2;
  line-height: 1.6;
}

.help-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.help-popup-close:hover {
  background: rgba(255, 107, 122, 0.2);
  color: #ff6b7a;
}

/* ─────────────────────────────────────────────────────────
   HELP INDICATORS (for "new" tier)
   ───────────────────────────────────────────────────────── */

.help-hint-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(116, 247, 178, 0.15);
  color: var(--green);
  font-weight: 900;
  font-size: 11px;
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.help-hint-indicator:hover {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────
   EXPANDABLE HELP CARDS
   ───────────────────────────────────────────────────────── */

.help-card {
  border: 1px solid rgba(57, 214, 255, 0.14);
  border-radius: 16px;
  padding: 14px;
  background: rgba(2, 6, 13, 0.42);
  cursor: pointer;
  transition: all 0.3s ease;
}

.help-card:hover {
  border-color: rgba(57, 214, 255, 0.3);
  background: rgba(57, 214, 255, 0.08);
}

.help-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text);
}

.help-card-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 14px;
  transition: transform 0.3s ease;
}

.help-card.expanded .help-card-icon {
  transform: rotate(180deg);
}

.help-card-content {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  opacity: 0;
  transition: all 0.3s ease;
}

.help-card.expanded .help-card-content {
  max-height: 200px;
  margin-top: 12px;
  opacity: 1;
}

.help-card-content p {
  margin: 0;
  font-size: 13px;
  color: #b9d6e0;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────
   VIDEO BLOCKS
   ───────────────────────────────────────────────────────── */

.learning-video-block {
  border: 1px solid rgba(116, 247, 178, 0.14);
  border-radius: 18px;
  padding: 20px;
  background: rgba(116, 247, 178, 0.04);
  margin: 20px 0;
}

.learning-video-block.hidden-video {
  display: none !important;
}

.learning-video-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--green);
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: rgba(2, 6, 13, 0.5);
  border: 2px dashed rgba(57, 214, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────
   TIER-BASED VISIBILITY
   ───────────────────────────────────────────────────────── */

[data-show-for] {
  /* Base style for tier-gated content */
}

/* By default, hide elements intended for other tiers */
[data-learning-tier='new'] [data-show-for='curious'],
[data-learning-tier='new'] [data-show-for='trader'],
[data-learning-tier='new'] [data-show-for='builder'],
[data-learning-tier='curious'] [data-show-for='trader'],
[data-learning-tier='curious'] [data-show-for='builder'],
[data-learning-tier='trader'] [data-show-for='builder'] {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────
   LEARNING BADGES & LABELS
   ───────────────────────────────────────────────────────── */

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(57, 214, 255, 0.1);
  border: 1px solid rgba(57, 214, 255, 0.2);
  font-size: 11px;
  font-weight: 900;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tier-badge.beginner {
  background: rgba(116, 247, 178, 0.1);
  border-color: rgba(116, 247, 178, 0.2);
  color: var(--green);
}

.tier-badge.advanced {
  background: rgba(255, 209, 102, 0.1);
  border-color: rgba(255, 209, 102, 0.2);
  color: var(--gold);
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  #learningTierSelector:not(.hero-learning-tier) {
    grid-template-columns: 1fr;
  }

  .help-popup-content {
    max-width: calc(100vw - 40px);
  }

  .help-pop {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
}

/* ─────────────────────────────────────────────────────────
   EXPANSION FOOTER + PANEL (works with hub + simulator pages)
   ───────────────────────────────────────────────────────── */

footer.sx-footer {
  text-align: left;
}

footer.sx-footer a {
  color: var(--cyan, #39d6ff);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer.sx-footer a:hover {
  color: var(--green, #74f7b2);
}

footer.sx-footer.sx-footer-compact {
  padding: 1.25rem 1.25rem 1.75rem !important;
}

footer.sx-footer.sx-footer-compact .sx-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

footer.sx-footer.sx-footer-compact h3 {
  font-size: 11px !important;
  margin: 0 0 8px !important;
}

footer.sx-footer.sx-footer-compact ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

footer.sx-footer.sx-footer-compact .sx-footer-copy {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(116, 247, 178, 0.12);
  text-align: center;
  font-size: 11px;
  color: var(--muted, #8fb7c8);
}

.learning-expansion-panel {
  border: 1px solid rgba(57, 214, 255, 0.22);
  border-radius: 18px;
  padding: 1.35rem 1.25rem;
  background: rgba(7, 21, 34, 0.65);
}

.shell {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
