:root {
  --berry-red: #FF6B6B;
  --berry-pink: #FFE5E5;
  --berry-dark: #E84A4A;
  --berry-light: #FFF5F5;
  --cream: #FFFAF0;
  --text-dark: #2D1F1F;
  --text-light: #F5F5F5;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

body.light {
  background: linear-gradient(135deg, var(--berry-pink) 0%, var(--cream) 50%, var(--berry-light) 100%);
  color: var(--text-dark);
}

body.dark {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
  color: var(--text-light);
}

.app-container {
  min-height: 100vh;
  overflow-x: hidden;
}

/* 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: 50%;
  animation: confetti-fall 3s ease-out forwards;
}

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

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

.giant-strawberry {
  font-size: 200px;
  animation: spin-berry 2s ease-in-out infinite;
}

@keyframes spin-berry {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

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

/* Header */
.header {
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.2) 0%, transparent 100%);
}

.dark .header {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.1) 0%, transparent 100%);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-berry {
  font-size: 3rem;
  animation: bounce-berry 2s ease-in-out infinite;
}

@keyframes bounce-berry {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

.logo-text {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--berry-red), var(--berry-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.8;
  font-weight: 500;
}

.dark-mode-toggle {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark .dark-mode-toggle {
  background: rgba(255, 255, 255, 0.1);
}

.dark-mode-toggle:hover {
  transform: scale(1.1) rotate(20deg);
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* Input Section */
.input-section {
  margin-bottom: 2rem;
}

.input-wrapper {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(255, 107, 107, 0.15);
  border: 2px solid rgba(255, 107, 107, 0.2);
}

.dark .input-wrapper {
  background: rgba(30, 30, 50, 0.9);
  border-color: rgba(255, 107, 107, 0.3);
}

.idea-input {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border: 2px solid rgba(255, 107, 107, 0.3);
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: transparent;
  color: inherit;
}

.idea-input:focus {
  outline: none;
  border-color: var(--berry-red);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
}

.idea-input::placeholder {
  color: #999;
}

.input-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.generate-btn, .random-btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.generate-btn {
  background: linear-gradient(135deg, var(--berry-red), var(--berry-dark));
  color: white;
  flex: 1;
  min-width: 200px;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.random-btn {
  background: rgba(255, 107, 107, 0.15);
  color: var(--berry-red);
  border: 2px solid rgba(255, 107, 107, 0.3);
}

.dark .random-btn {
  background: rgba(255, 107, 107, 0.2);
  color: #FFB4B4;
}

.random-btn:hover {
  transform: translateY(-2px) rotate(-2deg);
  background: rgba(255, 107, 107, 0.25);
}

/* Preview Section */
.preview-section {
  margin-bottom: 3rem;
}

.preview-window {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  transition: all 0.5s ease;
}

.dark .preview-window {
  background: rgba(25, 25, 40, 0.95);
}

.preview-window.complete {
  box-shadow: 0 20px 60px rgba(255, 107, 107, 0.3);
  border-color: var(--berry-red);
}

.preview-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .preview-header {
  background: linear-gradient(135deg, #2a2a3e, #252535);
}

.preview-dots {
  display: flex;
  gap: 6px;
}

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

.dot.red { background: #FF6B6B; }
.dot.yellow { background: #FFBD44; }
.dot.green { background: #00D26A; }

.preview-url {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #666;
  padding: 0.25rem 1rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  margin: 0 1rem;
}

.dark .preview-url {
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
}

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

.preview-placeholder {
  text-align: center;
  opacity: 0.6;
  font-size: 1.1rem;
}

.building-animation {
  text-align: center;
}

.berry-spinner {
  font-size: 4rem;
  animation: spin-and-bounce 1s ease-in-out infinite;
}

@keyframes spin-and-bounce {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(0.9); }
}

.loading-message {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--berry-red);
  font-weight: 500;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.preview-success {
  text-align: center;
  animation: slide-up 0.5s ease;
}

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

.success-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.preview-success h4 {
  font-size: 1.5rem;
  color: var(--berry-red);
  margin-bottom: 0.5rem;
}

.mock-app {
  margin-top: 1.5rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 12px;
  padding: 1rem;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.mock-header {
  height: 20px;
  background: linear-gradient(90deg, var(--berry-red), var(--berry-dark));
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.mock-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mock-element {
  height: 12px;
  background: rgba(255, 107, 107, 0.3);
  border-radius: 4px;
}

.mock-element.short {
  width: 60%;
}

.mock-button {
  height: 24px;
  background: var(--berry-red);
  border-radius: 6px;
  margin-top: 0.5rem;
  width: 50%;
  margin-left: auto;
  margin-right: auto;
}

/* Gallery Section */
.gallery-section {
  margin-bottom: 3rem;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--berry-dark);
}

.dark .section-title {
  color: #FFB4B4;
}

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

.app-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
  animation: fade-in-up 0.5s ease backwards;
}

.dark .app-card {
  background: rgba(40, 40, 60, 0.9);
}

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

.app-card:hover {
  transform: translateY(-8px) rotate(-1deg);
  border-color: var(--berry-red);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.25);
}

.app-card-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.app-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.app-card-desc {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Stats Section */
.stats-section {
  margin-bottom: 3rem;
}

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

.stat-card {
  background: linear-gradient(135deg, var(--berry-red), var(--berry-dark));
  color: white;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: scale(1.05);
}

.stat-emoji {
  font-size: 2rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* How Section */
.how-section {
  margin-bottom: 3rem;
}

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

.step-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease;
}

.dark .step-card {
  background: rgba(40, 40, 60, 0.9);
}

.step-card:hover {
  transform: translateY(-5px);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--berry-red);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--berry-dark);
}

.dark .step-card h3 {
  color: #FFB4B4;
}

.step-card p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Testimonials */
.testimonials-section {
  margin-bottom: 3rem;
}

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

.testimonial {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 1.5rem;
  border-left: 4px solid var(--berry-red);
  transition: transform 0.3s ease;
}

.dark .testimonial {
  background: rgba(40, 40, 60, 0.9);
}

.testimonial:hover {
  transform: translateX(5px);
}

.testimonial p {
  font-style: italic;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.testimonial-author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--berry-red);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--berry-red), var(--berry-dark));
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

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

.footer-main {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

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

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-divider {
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 640px) {
  .logo-text {
    font-size: 1.75rem;
  }
  
  .logo-berry {
    font-size: 2.5rem;
  }
  
  .input-actions {
    flex-direction: column;
  }
  
  .generate-btn, .random-btn {
    width: 100%;
  }
  
  .section-title {
    font-size: 1.4rem;
  }
  
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .giant-strawberry {
    font-size: 120px;
  }
}