/**
 * Common Generator Styles
 * Shared CSS for all name/text generators
 * 
 * Usage: Link this CSS in all generator HTML files
 * Override variables in page <style> for custom themes
 */

/* ==========================================================================
   CSS Custom Properties (Theme Variables)
   ========================================================================== */
:root {
  /* Base Colors - Override these per generator */
  --bg-primary: #18181b;
  --bg-secondary: #1f1f23;
  --bg-card: #27272a;
  --text-primary: #f4f4f5;
  --text-secondary: #d4d4d8;
  --text-muted: #a1a1aa;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --border-color: rgba(139, 92, 246, 0.2);
  --success: #22c55e;
  --error: #ef4444;
  
  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Sizing */
  --max-width: 1200px;
  --border-radius: 12px;
  --border-radius-lg: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
}

/* ==========================================================================
   Base Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: 2px; }
h2 { font-size: clamp(1.5rem, 4vw, 1.8rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.4rem); }

p { margin-bottom: var(--space-md); }

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { text-decoration: underline; }

strong { color: var(--text-primary); }

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--accent-light);
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.hero-icon {
  font-size: 5rem;
  margin-bottom: var(--space-lg);
  display: inline-block;
  animation: heroPulse 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--accent-glow));
}

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

.hero h1 {
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* ==========================================================================
   Generator Section
   ========================================================================== */
.generator-section {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}

.generator-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ==========================================================================
   Category Tabs
   ========================================================================== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.category-tab {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: 30px;
  background: rgba(39, 39, 42, 0.8);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.category-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

@media (max-width: 768px) {
  .category-tab { padding: var(--space-sm) var(--space-md); font-size: 0.8rem; }
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.option-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.option-group label {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Gender/Toggle Buttons */
.btn-group {
  display: flex;
  gap: var(--space-sm);
}

.toggle-btn {
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.toggle-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
}

/* Count Selector */
.count-selector {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.count-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.count-btn:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.count-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 40px;
  text-align: center;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.checkbox-group label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}

/* ==========================================================================
   Generate Button
   ========================================================================== */
.generate-btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: var(--space-lg) auto;
  padding: var(--space-md) var(--space-xl);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 6px 30px var(--accent-glow);
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
}

.generate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: 0.5s;
}

.generate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px var(--accent-glow);
}

.generate-btn:hover::before {
  left: 100%;
}

/* ==========================================================================
   Results Grid
   ========================================================================== */
.results {
  background: rgba(24, 24, 27, 0.7);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  border: 1px solid var(--border-color);
  min-height: 200px;
}

.results h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* ==========================================================================
   Name Card
   ========================================================================== */
.name-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.name-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.name-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px var(--accent-glow);
}

.name-card:hover::before {
  opacity: 0.1;
}

.name-card .name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: var(--space-sm);
  position: relative;
}

.name-card .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.name-card .tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.name-card .tag {
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-light);
  border-radius: 15px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Copy Indicator */
.name-card .copy-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--accent);
  color: #fff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius);
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
  z-index: 10;
}

.name-card.copied .copy-indicator {
  opacity: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

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

/* ==========================================================================
   Article Section
   ========================================================================== */
.article-section {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-color);
}

.article-section h2 {
  color: #fff;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.article-section h3 {
  color: #fff;
  margin: var(--space-xl) 0 var(--space-md);
}

.article-section p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

.article-section ul, .article-section ol {
  color: var(--text-secondary);
  margin: var(--space-md) 0;
  padding-left: var(--space-lg);
  font-size: 1.05rem;
}

.article-section li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

/* Example Names */
.example-names {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.example-names span {
  background: var(--bg-card);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius);
  font-size: 1rem;
  color: var(--accent-light);
  border: 1px solid var(--border-color);
}

/* Info/Lore Box */
.info-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent);
  border: 1px solid var(--accent);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.info-box h4 {
  color: var(--accent-light);
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.info-box p {
  margin: 0;
  font-size: 1rem;
}

/* Related Generators */
.related-generators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  text-decoration: none;
  transition: all var(--transition-base);
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  text-decoration: none;
}

.related-card h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  font-size: 1rem;
}

.related-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* External Links */
.external-links {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

.external-links h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
}

.external-links ul {
  list-style: none;
  padding: 0;
}

.external-links li {
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--border-color);
}

.faq-section h2 {
  color: #fff;
  margin-bottom: var(--space-xl);
  text-align: center;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-color);
}

.faq-item h3 {
  color: #fff;
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.faq-item p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-secondary);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-xl);
}

.footer-section h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-xs);
}

.footer-section a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: var(--accent-light);
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .hero { padding: var(--space-xl) 0; }
  .hero-icon { font-size: 3.5rem; }
  .generator-section { padding: var(--space-lg); }
  .article-section, .faq-section { padding: var(--space-lg); }
  .names-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .btn-group { flex-direction: column; width: 100%; }
  .toggle-btn { width: 100%; }
  .options-row { flex-direction: column; align-items: center; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
