/* ViralForge - Modern Dark Theme */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --accent: #6366f1;
  --accent-bright: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, .logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

/* App Container */
.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 0 3rem;
}

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

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 20px var(--accent));
}

.logo-text {
  font-size: 2.25rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Main Content */
.main {
  flex: 1;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Generator Form */
.generator-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

label .optional {
  color: var(--text-muted);
  font-weight: 400;
}

input, textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Generate Button */
.generate-btn {
  width: 100%;
  background: var(--gradient-accent);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.generate-btn:hover .btn-icon {
  transform: translateX(4px);
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 4rem 2rem;
}

.loading-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s ease-out infinite;
}

.pulse-ring:nth-child(2) {
  animation-delay: 0.3s;
}

.pulse-ring:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes pulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.loading-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.loading-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Results */
.results {
  margin-top: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.new-search-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.new-search-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Name Card */
.name-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

.name-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

.name-card.top-pick {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.name-content {
  min-width: 0;
}

.name-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.top-badge {
  background: var(--gradient-accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tagline-text {
  color: var(--accent-bright);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.reasoning {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Virality Score */
.score-section {
  text-align: center;
  min-width: 100px;
}

.virality-score {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 0.5rem;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}

.score-ring-value {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Score Reasons */
.score-reasons {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  grid-column: 1 / -1;
}

.reason-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reason-tag {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-bright);
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Footer */
.footer {
  text-align: center;
  padding: 3rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
  .app {
    padding: 1rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .name-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .score-section {
    order: -1;
  }
  
  .name-header {
    justify-content: center;
  }
  
  .reason-tags {
    justify-content: center;
  }
}

/* SVG Gradient Definition (for score rings) */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
}