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

:root {
  --primary: #c44cff;
  --secondary: #ff6b9d;
  --accent: #00d4ff;
  --bg-dark: #0a0a1a;
  --bg-card: #12122a;
  --text: #e8e8ff;
  --text-muted: #8888aa;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(196, 76, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 107, 157, 0.08) 0%, transparent 60%),
    var(--bg-dark);
  position: relative;
}

/* Floating Sparkles */
.sparkles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-sparkle {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0;
  animation: floatSparkle 5s ease-in-out infinite;
}

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

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -20px;
  border-radius: 3px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Header */
.header {
  text-align: center;
  padding: 3rem 1rem 2rem;
  position: relative;
  z-index: 1;
}

.title {
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary), #ffb347);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
  background-size: 200% 200%;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  position: relative;
  z-index: 1;
}

/* Input Section */
.input-section {
  background: var(--bg-card);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(196, 76, 255, 0.2);
  box-shadow: 0 0 40px rgba(196, 76, 255, 0.1);
}

.vibe-input {
  width: 100%;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(196, 76, 255, 0.3);
  border-radius: 1rem;
  padding: 1rem;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(196, 76, 255, 0.2); }
  50% { box-shadow: 0 0 30px rgba(196, 76, 255, 0.4); }
}

.vibe-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(196, 76, 255, 0.5);
}

.vibe-input::placeholder {
  color: var(--text-muted);
}

/* Vibe-O-Meter */
.vibe-meter {
  margin: 1.5rem 0;
}

.vibe-meter-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.vibe-stage {
  color: var(--primary);
  font-weight: 600;
}

.vibe-meter-track {
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  overflow: hidden;
}

.vibe-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  border-radius: 6px;
  transition: width 0.3s ease;
  box-shadow: 0 0 15px rgba(196, 76, 255, 0.5);
}

/* Vibe Button */
.vibe-button {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  border: none;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.vibe-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(196, 76, 255, 0.4);
}

.vibe-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vibe-button.generating {
  animation: pulse 1s ease-in-out infinite;
}

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

/* Panels Container */
.panels-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .panels-container {
    grid-template-columns: 1fr 1fr;
  }
}

.code-panel {
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(196, 76, 255, 0.2);
}

.panel-header {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vibes-display {
  padding: 1rem;
  font-size: 1.1rem;
  min-height: 200px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
}

.vibe-char {
  display: inline-block;
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sparkle-trail {
  animation: sparkleTrail 0.5s ease-in-out infinite;
}

@keyframes sparkleTrail {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Matrix Code */
.matrix-container {
  padding: 1rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  min-height: 200px;
  overflow: hidden;
}

.code-line {
  color: #00ff88;
  opacity: 0;
  animation: typeIn 0.3s ease forwards;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

@keyframes typeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Preview Panel */
.preview-panel {
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(0, 212, 255, 0.3);
  margin-bottom: 2rem;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-header {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-dot.red { background: #ff5f56; }
.preview-dot.yellow { background: #ffbd2e; }
.preview-dot.green { background: #27ca40; }

.preview-title {
  margin-left: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.preview-content {
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  position: relative;
}

/* Preview Components */
.preview-button {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 2rem;
  background: linear-gradient(135deg, #ff6b9d, #c44cff, #00d4ff);
  background-size: 200% 200%;
  color: white;
  cursor: pointer;
  animation: gradientMove 3s ease infinite;
  transition: transform 0.2s;
}

.preview-button:hover {
  transform: scale(1.05);
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.preview-counter {
  text-align: center;
}

.counter-value {
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.counter-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.counter-buttons button {
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.counter-buttons button:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(196, 76, 255, 0.4);
}

.preview-colors {
  padding: 2rem 3rem;
  border-radius: 1rem;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.preview-timer {
  text-align: center;
}

.timer-display {
  font-size: 3rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  color: var(--accent);
  margin-bottom: 1rem;
}

.timer-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.timer-button:hover {
  transform: scale(1.05);
}

.preview-hello {
  text-align: center;
}

.preview-hello h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.preview-hello p {
  color: var(--text-muted);
}

/* Motivational Message */
.motivational-message {
  text-align: center;
  padding: 1rem;
  font-size: 1.2rem;
  color: var(--accent);
  animation: bounceIn 0.5s ease;
}

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

/* Stats Panel */
.stats-panel {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(196, 76, 255, 0.2);
  margin-bottom: 2rem;
}

.stats-panel h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.75rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-level .stat-value {
  font-size: 1rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.footer-text {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--secondary);
}

.share-button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s;
}

.share-button:hover {
  background: var(--accent);
  color: var(--bg-dark);
}

/* Easter Egg Modal */
.easter-egg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.easter-egg-modal {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 1.5rem;
  text-align: center;
  max-width: 400px;
  margin: 1rem;
  border: 2px solid var(--primary);
  box-shadow: 0 0 50px rgba(196, 76, 255, 0.3);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.easter-egg-content {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.easter-egg-close {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  transition: transform 0.2s;
}

.easter-egg-close:hover {
  transform: scale(1.05);
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .header {
    padding: 2rem 1rem 1.5rem;
  }
  
  .vibe-input {
    min-height: 100px;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .preview-content {
    padding: 1.5rem;
  }
  
  .counter-value {
    font-size: 3rem;
  }
  
  .timer-display {
    font-size: 2.5rem;
  }
}