/* ═══ AI Academy — Combined Design System ═══
   Карточки уроков: Glassmorphism
   Боссы: RPG Trading Card
   Карта модулей: Duolingo path
   Достижения: Пиксельный
*/

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

/* ─── Duolingo World Map ─── */
.worlds {
  position: relative;
  padding: 0 8px;
}

.worlds::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg,
    var(--purple) 0%,
    var(--cyan) 40%,
    var(--green) 70%,
    rgba(255,215,0,0.3) 100%);
  transform: translateX(-50%);
  opacity: 0.15;
  border-radius: 2px;
  pointer-events: none;
}

.world-card {
  position: relative;
  border-radius: 20px;
  padding: 18px 16px;
  background: rgba(15, 20, 50, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139,113,255,0.2);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  overflow: hidden;
}

.world-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(139,113,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.world-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px var(--world-glow, rgba(139,113,255,0.35));
}

.world-card--current {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(139,113,255,0.3), 0 0 30px rgba(139,113,255,0.2);
  animation: world-pulse 2.5s ease-in-out infinite;
}

@keyframes world-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(139,113,255,0.3), 0 0 30px rgba(139,113,255,0.2); }
  50% { box-shadow: 0 0 0 3px rgba(139,113,255,0.5), 0 0 50px rgba(139,113,255,0.35); }
}

.world-card--done {
  border-color: rgba(0,230,118,0.4);
}
.world-card--done::before {
  background: radial-gradient(circle at 20% 50%, rgba(0,230,118,0.07) 0%, transparent 60%);
}

.world-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.world-card__name {
  font-family: 'Orbitron', var(--font-title);
  font-size: 14px;
  font-weight: 700;
}

.world-card__progress {
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: visible;
  position: relative;
}

.world-card__fill {
  height: 100%;
  border-radius: 3px;
  position: relative;
}
.world-card__fill::after {
  content: '';
  position: absolute;
  right: -1px; top: -3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: inherit;
  box-shadow: 0 0 8px currentColor;
}

/* Stars for completed worlds */
.world-card--done .world-card__count::before {
  content: '⭐⭐⭐ ';
  font-size: 9px;
}

/* ─── Lessons Path — Glassmorphism Nodes ─── */
.lessons-path {
  padding: 10px 16px 20px;
  position: relative;
}

.lesson-connector {
  width: 3px;
  height: 28px;
  background: rgba(139,113,255,0.15);
  border-radius: 2px;
  margin: 0 auto;
  position: relative;
}

.lesson-connector--done {
  background: linear-gradient(180deg, var(--green), rgba(0,230,118,0.4));
}

/* Regular lesson node — glass pill */
.lesson-node {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(139,113,255,0.25);
  background: rgba(15,20,50,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  font-family: 'Orbitron', var(--font-title);
  font-size: 14px;
  font-weight: 700;
}

.lesson-node:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 32px rgba(139,113,255,0.4);
}

.lesson-node--current {
  border-color: var(--purple);
  background: linear-gradient(135deg, rgba(139,113,255,0.25), rgba(32,232,255,0.1));
  box-shadow: 0 0 0 4px rgba(139,113,255,0.15), 0 0 30px rgba(139,113,255,0.4);
  animation: node-pulse 2s ease-in-out infinite;
}

@keyframes node-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(139,113,255,0.15), 0 0 30px rgba(139,113,255,0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(139,113,255,0.08), 0 0 50px rgba(139,113,255,0.6);
  }
}

.lesson-node--done {
  background: linear-gradient(135deg, var(--green), #00b862);
  border-color: var(--green);
  box-shadow: 0 4px 20px rgba(0,230,118,0.35);
  color: #0a0a0a;
}

.lesson-node--locked {
  opacity: 0.3;
  pointer-events: none;
  backdrop-filter: none;
}

/* ─── Boss Node — RPG Trading Card ─── */
.lesson-node--boss {
  width: 88px;
  height: 88px;
  border-radius: 16px !important;
  border: none !important;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  animation: none !important;
  position: relative;
  overflow: visible;
}

.lesson-node--boss::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a0a0f 0%, #2a0a14 50%, #1a0a1a 100%);
  border: 2px solid rgba(255,77,106,0.6);
  box-shadow:
    0 0 20px rgba(255,77,106,0.4),
    0 0 60px rgba(255,77,106,0.15),
    inset 0 0 20px rgba(255,77,106,0.05);
  z-index: 0;
}

.lesson-node--boss::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,77,106,0.3) 0%, transparent 50%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      rgba(255,77,106,0.03) 4px,
      rgba(255,77,106,0.03) 5px
    );
  z-index: 0;
}

.lesson-node--boss > * {
  position: relative;
  z-index: 1;
}

.lesson-node--boss:hover {
  transform: scale(1.08) rotate(-1deg) !important;
}

.lesson-node--boss.lesson-node--done::before {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255,215,0,0.4), 0 0 60px rgba(255,215,0,0.15);
}

.lesson-node--boss-locked {
  opacity: 0.5;
  pointer-events: none;
}

/* Boss title tag */
.lesson-node--boss .lesson-node__title {
  top: 92px;
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  color: rgba(255,77,106,0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Boss XP badge */
.lesson-node--boss-locked .lesson-node__progress {
  font-family: var(--font-game);
  font-size: 8px;
  color: rgba(255,77,106,0.5);
  top: 108px;
}

/* ─── Badges — Pixel Style ─── */
.badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.badge {
  background: #0f0f0f;
  border: 2px solid rgba(139,113,255,0.4);
  border-radius: 4px !important;
  padding: 14px 10px;
  text-align: center;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
  /* Pixel corners */
  clip-path: polygon(
    4px 0%, calc(100% - 4px) 0%,
    100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) 100%, 4px 100%,
    0% calc(100% - 4px), 0% 4px
  );
}

.badge:not(.badge--locked):hover {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(139,113,255,0.5);
}

.badge--locked {
  opacity: 0.25;
  filter: grayscale(1);
  border-color: #222;
}

.badge__icon {
  font-size: 26px;
  margin-bottom: 6px;
  display: block;
  image-rendering: pixelated;
}

.badge__name {
  font-family: var(--font-game);
  font-size: 7px !important;
  color: var(--purple) !important;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Earned badge glow */
.badge:not(.badge--locked)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(139,113,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* Pixel scan line on earned badges */
.badge:not(.badge--locked)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(139,113,255,0.04) 2px,
    rgba(139,113,255,0.04) 4px
  );
  pointer-events: none;
}

/* ─── Theory block — enhanced glass ─── */
.block-theory {
  background: rgba(15,20,50,0.7) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(139,113,255,0.2) !important;
  border-radius: 16px !important;
  border-left: 3px solid var(--purple) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* ─── Boss screen — RPG card style ─── */
.boss {
  padding: 16px;
}

.boss__arena {
  background: rgba(10,5,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255,77,106,0.4);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255,77,106,0.2), inset 0 0 40px rgba(255,77,106,0.05);
}

.boss__arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,77,106,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139,113,255,0.1) 0%, transparent 50%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(255,77,106,0.02) 8px,
      rgba(255,77,106,0.02) 9px
    );
  pointer-events: none;
}

.boss__icon {
  filter: drop-shadow(0 0 20px rgba(255,77,106,0.8));
  font-size: 72px !important;
}

.boss__title {
  font-family: 'Orbitron', var(--font-title) !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(255,77,106,0.6);
}

.hp-bar {
  border-radius: 4px !important;
  border: 1px solid rgba(255,255,255,0.1);
  height: 18px !important;
  image-rendering: pixelated;
}

.hp-bar__fill--boss {
  background: linear-gradient(90deg, #c0392b, #e74c3c, #ff6b6b) !important;
  position: relative;
}
.hp-bar__fill--boss::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 6px,
    rgba(0,0,0,0.2) 6px,
    rgba(0,0,0,0.2) 8px
  );
}

.hp-bar__fill--player {
  background: linear-gradient(90deg, #00b894, #00cec9, #55efc4) !important;
}

/* Boss question — glass card */
.boss__question {
  background: rgba(15,10,30,0.8) !important;
  border: 1px solid rgba(139,113,255,0.25) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ─── XP Popup — pixel style ─── */
.xp-popup {
  border-radius: 4px !important;
  border-width: 3px !important;
  clip-path: polygon(
    6px 0%, calc(100% - 6px) 0%,
    100% 6px, 100% calc(100% - 6px),
    calc(100% - 6px) 100%, 6px 100%,
    0% calc(100% - 6px), 0% 6px
  );
}

.xp-popup__title {
  font-family: 'Orbitron', var(--font-title) !important;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ─── Complete button — neon glass ─── */
.btn-complete {
  background: linear-gradient(135deg,
    rgba(139,113,255,0.9),
    rgba(32,232,255,0.8)) !important;
  border-radius: 14px !important;
  box-shadow: 0 0 20px rgba(139,113,255,0.4), 0 4px 0 rgba(90,63,212,0.8);
  font-family: 'Orbitron', var(--font-title) !important;
  font-size: 13px !important;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
}

.btn-complete:hover {
  box-shadow: 0 0 35px rgba(139,113,255,0.6), 0 4px 0 rgba(90,63,212,0.8) !important;
}

/* ─── Progress shimmer animation ─── */
@keyframes shimmer-right {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.world-card__fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer-right 2.5s ease-in-out infinite;
}
