:root {
  --bg-color: #050505;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #7000FF;
  --accent-glow: rgba(112, 0, 255, 0.4);
  --secondary: #00F0FF;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(10, 10, 10, 0.6);
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Decorative Elements */
.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://grainy-gradients.vercel.app/noise.svg');
  opacity: 0.05;
  pointer-events: none;
  z-index: 1000;
}

.bg-glow {
  position: fixed;
  top: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  animation: glow-float 20s infinite alternate ease-in-out;
}

@keyframes glow-float {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-20%, 20%);
  }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* Hero Section */
.hero {
  margin-bottom: 80px;
  text-align: left;
}

.hero-tagline {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  letter-spacing: 0.4em;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.text-gradient {
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* App Card */
.app-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 48px;
  backdrop-filter: blur(20px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  animation: card-reveal 1.2s cubic-bezier(0.23, 1, 0.32, 1) backwards 0.2s;
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Creative Input */
.input-container {
  margin-bottom: 48px;
}

.input-wrapper {
  position: relative;
}

.creative-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--card-border);
  padding: 24px 0 12px;
  font-size: 2rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.creative-input::placeholder {
  color: rgba(255, 255, 255, 0.12);
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.5rem;
}

.creative-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}

.input-label {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Difficulty Selector */
.options-container {
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.difficulty-card {
  cursor: pointer;
  position: relative;
}

.difficulty-card input {
  position: absolute;
  opacity: 0;
}

.card-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.difficulty-card input:checked+.card-content {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(112, 0, 255, 0.3);
}

.difficulty-card:hover .card-content {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.age {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.level {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Generate Button */
.generate-button {
  width: 100%;
  padding: 24px;
  border-radius: 20px;
  border: none;
  background: var(--text-primary);
  color: var(--bg-color);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-text {
  transition: opacity 0.2s ease;
}

.generate-button:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: wait;
  transform: none;
}

.generate-button:hover {
  transform: scale(1.02);
  background: var(--accent);
  color: white;
}

.generate-button:active {
  transform: scale(0.98);
}

.status-message {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  font-family: var(--font-accent);
  font-size: 0.9rem;
  text-align: center;
  animation: slide-up 0.3s ease;
}

.status-message.error {
  background: rgba(255, 50, 50, 0.1);
  color: #ff5050;
  border: 1px solid rgba(255, 50, 50, 0.2);
}

.status-message.success {
  background: rgba(50, 255, 100, 0.1);
  color: #32ff64;
  border: 1px solid rgba(50, 255, 100, 0.2);
}

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

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}

.generate-button:hover .btn-shine {
  left: 150%;
}

/* Result Section */
.result-section {
  margin-top: 100px;
  animation: reveal 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.action-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: white;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-family: var(--font-accent);
  font-weight: 600;
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-btn.primary {
  background: var(--text-primary);
  color: var(--bg-color);
  padding: 12px 24px;
}

.action-btn.primary:hover {
  background: var(--secondary);
  border-color: var(--secondary);
}

/* Canvas / Frame */
.canvas-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 40px;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.5s ease;
}

.frame {
  background: white;
  padding: 30px;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  position: relative;
  max-width: 100%;
  animation: frame-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes frame-pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.frame img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  transition: opacity 0.3s ease;
}

.frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* Button Loader */
.btn-loader {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.loader-bar {
  width: 40%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  animation: scan 1.5s infinite ease-in-out;
}

@keyframes scan {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(250%);
  }
}

@keyframes bounce {
  from {
    transform: translateY(0);
    opacity: 0.3;
  }

  to {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: 60px 0;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }

  .app-card {
    padding: 32px 24px;
  }

  .creative-input {
    font-size: 1.4rem;
  }

  .difficulty-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* Print Styles */
@media print {
  @page {
    size: letter portrait;
    margin: 0;
  }

  body {
    background: white;
    color: black;
    margin: 0;
    padding: 0;
  }

  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .hero,
  .app-card,
  .footer,
  .bg-noise,
  .bg-glow,
  .result-header {
    display: none !important;
  }

  .result-section {
    margin: 0;
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .canvas-container {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
  }

  .frame {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 8.5in;
    height: 11in;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .frame img {
    width: 8.5in;
    height: 11in;
    object-fit: contain;
  }
}