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

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(20, 20, 35, 0.8);
  --primary: #a855f7;
  --secondary: #06b6d4;
  --accent: #f472b6;
  --success: #22c55e;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --glow: 0 0 20px rgba(168, 85, 247, 0.4);
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse at 20% 0%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #0a0a0f 0%, #0f0f1a 100%);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
}

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

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Landing Page */
.landing {
  position: relative;
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.6;
  animation: float 15s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-icon {
  display: inline-block;
  animation: pulse-glow 2s ease-in-out infinite;
}

.title-icon.large {
  font-size: 0.8em;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.8)); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.cta-button {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  padding: 1.25rem 2.5rem;
  border-radius: 50px;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: var(--glow);
  animation: button-pulse 3s ease-in-out infinite;
}

@keyframes button-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.6), 0 0 60px rgba(244, 114, 182, 0.3); }
}

.cta-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.7);
}

.cta-arrow {
  transition: transform 0.3s ease;
}

.cta-button:hover .cta-arrow {
  transform: translateX(5px);
}

.landing-features {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.level-indicator {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.xp-counter {
  font-family: 'JetBrains Mono', monospace;
  color: var(--secondary);
  font-weight: 600;
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  padding: 2rem;
  flex: 1;
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    order: -1;
  }
}

.dashboard-content {
  max-width: 700px;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modules Path */
.modules-path {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.path-connector {
  width: 4px;
  height: 40px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  margin-left: 2.5rem;
  opacity: 0.5;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.module-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-card.current {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
  animation: current-pulse 2s ease-in-out infinite;
}

@keyframes current-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.2); }
  50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }
}

.module-card.completed {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.module-card:not(.locked):hover {
  transform: translateX(8px);
  border-color: var(--primary);
}

.module-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 12px;
  flex-shrink: 0;
}

.module-info {
  flex: 1;
}

.module-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.module-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.module-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.module-time {
  color: var(--text-muted);
}

.module-xp {
  color: var(--secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.module-status {
  font-size: 1.5rem;
  width: 40px;
  text-align: center;
}

.module-card.completed .module-status {
  color: var(--success);
}

.module-card.current .module-status {
  color: var(--primary);
}

/* Sidebar / Vibe Meter */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vibe-meter {
  padding: 1.5rem;
}

.vibe-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.vibe-meter-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.level-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 0.3rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 50px;
  margin-bottom: 1rem;
}

.equalizer-bar {
  width: 8px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 4px;
  animation: equalize 0.8s ease-in-out infinite alternate;
}

@keyframes equalize {
  0% { height: 20%; }
  100% { height: 100%; }
}

.xp-progress {
  margin-bottom: 1rem;
}

.xp-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.xp-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--secondary);
}

.streak-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.streak-fire {
  font-size: 1.25rem;
  animation: fire-flicker 0.5s ease-in-out infinite alternate;
}

@keyframes fire-flicker {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

.daily-tip {
  padding: 1rem;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 12px;
  border-left: 3px solid var(--primary);
}

.tip-label {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tip-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.mini-achievements {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.mini-badge {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mini-badge:hover {
  transform: scale(1.2);
}

/* Achievements Panel */
.achievements-panel {
  padding: 1.5rem;
}

.achievements-panel h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 10px;
}

.achievement-icon {
  font-size: 1.5rem;
}

.achievement-name {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Lesson View */
.lesson-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.back-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
}

.back-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

.lesson-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.lesson-icon {
  font-size: 3rem;
}

.lesson-title {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-dots {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.progress-dot.done {
  background: var(--success);
}

.progress-dot.active {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.lesson-content {
  padding: 2rem;
  min-height: 300px;
  margin-bottom: 2rem;
}

.lesson-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
}

.vibe-tip {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 12px;
  border-left: 4px solid var(--success);
}

.tip-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.vibe-tip p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text);
}

.code-block {
  background: #1a1a2e;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Quiz */
.quiz-container {
  text-align: left;
}

.quiz-question {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.1);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.2);
}

.quiz-option.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.quiz-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(168, 85, 247, 0.1);
  border-radius: 10px;
  font-size: 1rem;
  text-align: center;
}

.next-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.next-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.achievement-modal {
  padding: 2.5rem;
  text-align: center;
  max-width: 400px;
  animation: pop-in 0.4s ease;
}

@keyframes pop-in {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.achievement-icon-large {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.achievement-modal h3 {
  color: var(--primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.achievement-modal h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.achievement-modal p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.close-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--glow);
}

/* Footer */
.footer {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--accent);
}

.landing-footer {
  justify-content: center;
}

.reset-btn {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .header-left, .header-right {
    width: 100%;
    justify-content: center;
  }
  
  .dashboard {
    padding: 1rem;
  }
  
  .module-card {
    flex-direction: column;
    text-align: center;
  }
  
  .path-connector {
    margin-left: auto;
    margin-right: auto;
  }
  
  .lesson-view {
    padding: 1rem;
  }
  
  .lesson-content {
    padding: 1.25rem;
  }
  
  .hero-title {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .title-icon.large {
    display: none;
  }
}