:root {
  /* Light Theme Colors */
  --bg-primary: #000000;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2d2d2d;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #b0b0b0;
  --border-color: #404040;
  
  /* JavaScript Yellow Theme */
  --js-primary: #f7df1e;
  --js-secondary: #ffeb3b;
  --js-dark: #000000;
  --js-light: #fff59d;
  --js-gradient: linear-gradient(135deg, #f7df1e 0%, #ffeb3b 50%, #fff59d 100%);
  --js-glow: 0 0 30px rgba(247, 223, 30, 0.3);
  
  /* Level Colors */
  --beginner-color: #d4af37;
  --beginner-gradient: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
  --beginner-glow: 0 0 30px rgba(212, 175, 55, 0.3);
  
  --intermediate-color: #cd853f;
  --intermediate-gradient: linear-gradient(135deg, #cd853f 0%, #daa520 100%);
  --intermediate-glow: 0 0 30px rgba(205, 133, 63, 0.3);
  
  --advanced-color: #b8860b;
  --advanced-gradient: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
  --advanced-glow: 0 0 30px rgba(184, 134, 11, 0.3);
  
  /* Status Colors */
  --success-color: #d4af37;
  --warning-color: #cd853f;
  --error-color: #daa520;
  --info-color: #b8860b;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(255 255 255 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(255 255 255 / 0.3), 0 2px 4px -2px rgb(255 255 255 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(255 255 255 / 0.3), 0 4px 6px -4px rgb(255 255 255 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(255 255 255 / 0.3), 0 8px 10px -6px rgb(255 255 255 / 0.3);
  --shadow-glow: 0 0 40px rgba(247, 223, 30, 0.15);
}

[data-theme="light"] {
  /* Light Theme Colors */
  --bg-primary: #f5f5dc;
  --bg-secondary: #faf0e6;
  --bg-tertiary: #fff8dc;
  --text-primary: #000000;
  --text-secondary: #2f2f2f;
  --text-muted: #555555;
  --border-color: #d4c4a8;
  --shadow-sm: 0 1px 2px 0 rgb(139 69 19 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(139 69 19 / 0.1), 0 2px 4px -2px rgb(139 69 19 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(139 69 19 / 0.1), 0 4px 6px -4px rgb(139 69 19 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(139 69 19 / 0.1), 0 8px 10px -6px rgb(139 69 19 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-shapes {
  position: relative;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: var(--js-gradient);
  opacity: 0.1;
  animation: float 20s infinite linear;
}

.shape-1 {
  width: 80px;
  height: 80px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 60px;
  height: 60px;
  top: 60%;
  right: 15%;
  animation-delay: -5s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  top: 80%;
  left: 20%;
  animation-delay: -10s;
}

.shape-4 {
  width: 40px;
  height: 40px;
  top: 30%;
  right: 30%;
  animation-delay: -15s;
}

.shape-5 {
  width: 120px;
  height: 120px;
  top: 10%;
  right: 5%;
  animation-delay: -7s;
}

.shape-6 {
  width: 70px;
  height: 70px;
  top: 50%;
  left: 5%;
  animation-delay: -12s;
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(120deg);
  }
  66% {
    transform: translateY(30px) rotate(240deg);
  }
  100% {
    transform: translateY(0px) rotate(360deg);
  }
}

/* Header Styles */
.header {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

[data-theme="light"] .header {
  background: rgba(245, 245, 220, 0.8);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Title Styles */
.title {
  text-align: center;
  flex: 1;
  position: relative;
}

.title-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.title-js {
  font-size: 2rem;
  font-weight: 800;
  background: var(--js-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.title-style {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}

.title-underline {
  width: 60px;
  height: 3px;
  background: var(--js-gradient);
  margin: 0.5rem auto 0;
  border-radius: 2px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.7;
    transform: scaleX(1.1);
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.exp-counter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--js-gradient);
  color: var(--js-dark);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  box-shadow: var(--shadow-lg), var(--js-glow);
  position: relative;
  overflow: hidden;
}

.exp-counter::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.exp-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  animation: rotate 4s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.exp-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.exp-number {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}

.exp-label {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-back {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-back:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.btn-theme {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  padding: 0;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme:hover {
  background: var(--js-gradient);
  color: var(--js-dark);
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), var(--js-glow);
}

.theme-icon-container {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-icon-container .icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme:hover .theme-icon-container .icon {
  transform: translate(-50%, -50%) rotate(180deg);
}

.btn-primary {
  background: var(--js-gradient);
  color: var(--js-dark);
  box-shadow: var(--shadow-lg), var(--js-glow);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl), var(--js-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-success {
  background: var(--beginner-gradient);
  color: var(--js-dark);
  box-shadow: var(--shadow-md), var(--beginner-glow);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--beginner-glow);
}

.btn-warning {
  background: linear-gradient(135deg, #cd853f 0%, #daa520 100%);
  color: var(--js-dark);
  box-shadow: var(--shadow-md), 0 0 20px rgba(205, 133, 63, 0.3);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(205, 133, 63, 0.4);
}

.btn-validate {
  background: var(--info-color);
  color: var(--js-dark);
  box-shadow: var(--shadow-md);
}

.btn-validate:hover {
  background: #b8860b;
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  gap: 0.25rem;
}

.btn-small .icon {
  width: 14px;
  height: 14px;
}

.btn-close {
  background: none;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
}

.btn-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.1);
}

.btn-certificate {
  background: var(--js-gradient);
  color: var(--js-dark);
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl), var(--js-glow);
  position: relative;
  overflow: hidden;
}

.btn-certificate:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), var(--js-glow);
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.btn-certificate:hover .btn-shine {
  left: 100%;
}

/* Icon Styles */
.icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2;
}

.lock-icon-large {
  width: 4rem;
  height: 4rem;
  opacity: 0.6;
}

.check-icon {
  color: var(--success-color);
}

/* Theme Toggle Icons */
[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Main Content */
.main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 4rem;
  padding: 3rem 0;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  background: var(--js-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--js-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

/* Levels Container */
.levels-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-bottom: 4rem;
}

/* Level Section */
.level-section {
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(139, 69, 19, 0.25);
}

.level-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.level-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--intermediate-gradient);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(205, 133, 63, 0.5);
  }
  to {
    box-shadow: 0 0 40px rgba(205, 133, 63, 0.8);
  }
}

.level-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--js-primary);
  border-radius: 50%;
  opacity: 0.6;
  animation: particle-float 6s infinite linear;
}

.particle:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.particle:nth-child(3) {
  bottom: 20%;
  left: 80%;
  animation-delay: 4s;
}

@keyframes particle-float {
  0%, 100% {
    transform: translateY(0px);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px);
    opacity: 1;
  }
}

.level-header {
  margin-bottom: 2.5rem;
}

.level-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.level-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: badge-shimmer 4s infinite;
}

@keyframes badge-shimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

.level-badge.intermediate {
  background: var(--intermediate-gradient);
  color: var(--js-dark);
  box-shadow: var(--shadow-md), var(--intermediate-glow);
}

.badge-icon {
  width: 16px;
  height: 16px;
}

.level-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.level-progress {
  background: var(--bg-primary);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.progress-percentage {
  font-size: 0.875rem;
  color: var(--js-primary);
  font-weight: 700;
}

.progress-bar {
  height: 1rem;
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(139, 69, 19, 0.1);
}

.progress-fill {
  height: 100%;
  border-radius: 0.5rem;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  position: relative;
  overflow: hidden;
}

.intermediate-fill {
  background: var(--intermediate-gradient);
  box-shadow: var(--intermediate-glow);
}

.progress-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Tasks Grid */
.tasks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Task Card */
.task-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--js-gradient);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-card:hover::before {
  transform: scaleX(1);
}

.task-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: var(--js-primary);
}

.task-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(247, 223, 30, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.task-card:hover .task-glow {
  opacity: 1;
}

.task-card.completed {
  border-color: var(--success-color);
  background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(212, 175, 55, 0.05) 100%);
  box-shadow: var(--shadow-lg), var(--beginner-glow);
}

.task-card.completed::before {
  background: var(--beginner-gradient);
  transform: scaleX(1);
}

.task-card.completed .task-glow {
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  opacity: 1;
}

.task-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.task-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--js-gradient);
  border-radius: 1rem;
  color: var(--js-dark);
  box-shadow: var(--shadow-md), var(--js-glow);
  flex-shrink: 0;
}

.task-icon svg {
  width: 28px;
  height: 28px;
}

.task-info {
  flex: 1;
}

.task-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.task-description {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 0.9375rem;
}

.task-exp {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem 0.75rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.exp-value {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--js-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.exp-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-status {
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--success-color);
  border-radius: 50%;
  color: var(--js-dark);
  box-shadow: var(--shadow-md), var(--beginner-glow);
}

.task-card.completed .task-status {
  opacity: 1;
  animation: checkmark-appear 0.6s ease;
}

@keyframes checkmark-appear {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.task-card.completed .task-start-btn {
  opacity: 0.6;
  cursor: default;
  transform: none !important;
}

/* Certificate Section */
.certificate-section {
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.certificate-decoration {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.certificate-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--js-gradient);
  animation: certificate-glow 4s ease-in-out infinite alternate;
}

@keyframes certificate-glow {
  from {
    box-shadow: 0 0 30px rgba(247, 223, 30, 0.5);
  }
  to {
    box-shadow: 0 0 60px rgba(247, 223, 30, 0.8);
  }
}

.certificate-sparkles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--js-primary);
  border-radius: 50%;
  animation: sparkle 3s infinite linear;
}

.sparkle:nth-child(1) {
  top: 20%;
  left: 20%;
  animation-delay: 0s;
}

.sparkle:nth-child(2) {
  top: 60%;
  right: 20%;
  animation-delay: 1s;
}

.sparkle:nth-child(3) {
  bottom: 30%;
  left: 60%;
  animation-delay: 2s;
}

.sparkle:nth-child(4) {
  top: 40%;
  left: 80%;
  animation-delay: 1.5s;
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.certificate-card {
  max-width: 700px;
  margin: 0 auto;
}

.certificate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.certificate-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--js-gradient);
  border-radius: 1rem;
  color: var(--js-dark);
  box-shadow: var(--shadow-md), var(--js-glow);
}

.certificate-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--bg-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.certificate-preview {
  position: relative;
  margin-bottom: 2.5rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.certificate-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.certificate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(212, 175, 55, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.certificate-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  color: var(--js-dark);
  padding: 2rem;
}

.lock-animation {
  margin-bottom: 1.5rem;
  animation: lock-pulse 2s infinite;
}

@keyframes lock-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.overlay-content p {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.certificate-actions {
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.certificate-actions.enabled {
  opacity: 1;
  pointer-events: auto;
}

.name-input-group {
  margin-bottom: 2rem;
}

.name-input-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 0.75rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--js-primary);
  box-shadow: 0 0 0 4px rgba(247, 223, 30, 0.1);
}

.input-focus-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px solid var(--js-primary);
  border-radius: 0.75rem;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-wrapper input:focus + .input-focus-border {
  opacity: 1;
  transform: scale(1);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(212, 175, 55, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(50px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-content {
  padding: 2.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.task-instructions {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
}

.task-instructions h4 {
  color: var(--js-primary);
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.task-instructions p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.task-instructions code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
}

.task-instructions pre {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-sm);
}

.task-instructions pre code {
  background: none;
  padding: 0;
}

/* Editor Container */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  min-height: 500px;
}

.editor-section,
.preview-section {
  border: 2px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.editor-header,
.preview-header {
  background: var(--bg-secondary);
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.editor-tabs {
  display: flex;
  gap: 1rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
  white-space: nowrap;
}

.tab-btn .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tab-btn.active {
  background: var(--js-gradient);
  color: var(--js-dark);
  border-color: var(--js-primary);
  box-shadow: var(--shadow-md), var(--js-glow);
  transform: translateY(-1px);
}

.tab-btn.active:hover {
  transform: translateY(-1px);
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Editor Content */
.editor-content {
  flex: 1;
  position: relative;
}

.code-editor {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border: none;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 1.25rem;
  resize: none;
  outline: none;
  min-height: 400px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.code-editor.active {
  opacity: 1;
  pointer-events: all;
}

#livePreview {
  width: 100%;
  flex: 1;
  border: none;
  background: white;
  min-height: 400px;
}

.validation-feedback {
  padding: 1.25rem;
  border-radius: 0.75rem;
  margin-top: 1.5rem;
  display: none;
  font-weight: 600;
  border: 2px solid;
}

.validation-feedback.success {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--success-color);
  color: var(--success-color);
  display: block;
}

.validation-feedback.error {
  background: rgba(218, 165, 32, 0.1);
  border-color: var(--error-color);
  color: var(--error-color);
  display: block;
}

/* Animations */
@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  70% {
    transform: scale(0.9) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.task-card.completed {
  animation: bounce-in 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.level-section {
  animation: fade-in-up 0.8s ease-out;
}

.level-section:nth-child(2) {
  animation-delay: 0.2s;
}

.level-section:nth-child(3) {
  animation-delay: 0.4s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .title {
    order: -1;
    flex-basis: 100%;
  }
  
  .title-main {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .title-js {
    font-size: 1.5rem;
  }
  
  .title-style {
    font-size: 1.125rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-divider {
    display: none;
  }
  
  .main {
    padding: 1rem;
  }
  
  .level-section {
    padding: 1.5rem;
  }
  
  .level-title-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .level-title {
    font-size: 1.375rem;
  }
  
  .task-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .task-exp {
    align-self: flex-start;
  }
  
  .certificate-section {
    padding: 2rem;
  }
  
  .certificate-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .modal {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .modal-content {
    padding: 1.5rem;
  }
  
  .editor-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .editor-header,
  .preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .editor-tabs {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  
  .tab-btn {
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    gap: 0.25rem;
  }
  
  .tab-btn .icon {
    width: 12px;
    height: 12px;
  }
  
  .editor-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 0.375rem;
  }
  
  .code-editor,
  #livePreview {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .levels-container {
    gap: 2rem;
  }
  
  .level-section {
    padding: 1rem;
  }
  
  .task-card {
    padding: 1.5rem;
  }
  
  .task-title {
    font-size: 1.125rem;
  }
  
  .certificate-section {
    padding: 1.5rem;
  }
  
  .modal-header {
    padding: 1.5rem;
  }
  
  .modal-content {
    padding: 1rem;
  }
  
  .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    gap: 0.1875rem;
  }
  
  .btn-small .icon {
    width: 12px;
    height: 12px;
  }
  
  .code-editor,
  #livePreview {
    min-height: 250px;
    font-size: 0.8125rem;
  }
  
  .editor-tabs {
    gap: 0.5rem;
  }
  
  .tab-btn {
    padding: 0.3125rem 0.5rem;
    font-size: 0.625rem;
    gap: 0.1875rem;
  }
  
  .tab-btn .icon {
    width: 10px;
    height: 10px;
  }
}