/* ============================================
   Job Article Generator - Main Stylesheet
   Modern SaaS UI | Clean & Professional
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-glow: rgba(37, 99, 235, 0.15);
  --secondary: #6366f1;
  --accent: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;
  --bg-dark-input: #0f172a;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-dark-primary: #f1f5f9;
  --text-dark-secondary: #94a3b8;

  --border: #e2e8f0;
  --border-dark: #334155;
  --border-focus: #2563eb;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
}

/* --- Dark Mode Variables --- */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #0f172a;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.6);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  transition: var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.85);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dark Mode Toggle */
.dark-toggle {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
  color: var(--text-secondary);
}

.dark-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
}

/* Hero background blobs */
.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-glow);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeInDown 0.6s ease;
}

.hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: fadeInUp 0.7s ease 0.2s both;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 48px;
  animation: fadeInUp 0.7s ease 0.3s both;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

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

/* ============================================
   GENERATOR CARD
   ============================================ */
.generator-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: var(--transition);
}

.card-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Input Area */
.input-wrapper {
  padding: 24px 28px;
  position: relative;
}

.textarea-container {
  position: relative;
}

#jobInput {
  width: 100%;
  min-height: 180px;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  resize: vertical;
  transition: var(--transition);
  outline: none;
  line-height: 1.7;
}

#jobInput::placeholder {
  color: var(--text-muted);
}

#jobInput:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: var(--bg-primary);
}

[data-theme="dark"] #jobInput {
  background: #0f172a;
  color: var(--text-dark-primary);
}

[data-theme="dark"] #jobInput:focus {
  background: #1e293b;
}

/* Character Counter */
.textarea-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 0 2px;
}

.char-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.char-counter.warning {
  color: #f59e0b;
}

.char-counter.danger {
  color: #ef4444;
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Action Buttons Row */
.action-row {
  padding: 0 28px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition-fast);
}

.btn:hover::after {
  background: rgba(255,255,255,0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  flex: 1;
  min-width: 200px;
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  min-width: unset;
  flex: unset;
}

/* ============================================
   LOADING STATE
   ============================================ */
.loading-overlay {
  display: none;
  padding: 48px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.loading-overlay.active {
  display: block;
}

.loader-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  animation: spin 1.4s linear infinite;
}

.loader-ring:nth-child(1) {
  border-top-color: var(--primary);
  animation-duration: 1.4s;
}

.loader-ring:nth-child(2) {
  border-right-color: var(--secondary);
  animation-duration: 1.8s;
  animation-direction: reverse;
  inset: 8px;
}

.loader-ring:nth-child(3) {
  border-bottom-color: var(--accent);
  animation-duration: 2.2s;
  inset: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.loading-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Progress bar */
.progress-bar-wrapper {
  max-width: 320px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  background-size: 200% 100%;
  border-radius: var(--radius-full);
  animation: progressShimmer 2s infinite;
  width: 0%;
  transition: width 0.5s ease;
}

@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-steps {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.loading-step.active {
  color: var(--primary);
}

.loading-step .step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}

.loading-step.active .step-dot {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

/* ============================================
   OUTPUT SECTION
   ============================================ */
.output-section {
  display: none;
  border-top: 1px solid var(--border);
  animation: fadeInUp 0.5s ease;
}

.output-section.visible {
  display: block;
}

.output-toolbar {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  flex-wrap: wrap;
  gap: 12px;
}

.output-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.meta-badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.meta-badge.blue {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.meta-badge.purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.output-content {
  padding: 28px;
  max-height: 700px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.output-content::-webkit-scrollbar {
  width: 6px;
}

.output-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.output-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.output-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Article content styling */
#articleOutput {
  font-family: var(--font-main);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

#articleOutput h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  line-height: 1.3;
}

#articleOutput h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#articleOutput h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  border-radius: 2px;
  flex-shrink: 0;
}

#articleOutput h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 8px;
}

#articleOutput p {
  margin-bottom: 14px;
  color: var(--text-secondary);
}

#articleOutput ul, #articleOutput ol {
  margin: 10px 0 16px 20px;
}

#articleOutput li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

#articleOutput table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
}

#articleOutput table th {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

#articleOutput table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

#articleOutput table tr:nth-child(even) td {
  background: var(--bg-secondary);
}

#articleOutput table tr:last-child td {
  border-bottom: none;
}

#articleOutput strong {
  color: var(--text-primary);
  font-weight: 600;
}

#articleOutput a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

#articleOutput a:hover {
  text-decoration: underline;
}

#articleOutput blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--primary-glow);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* SEO Score Card */
.seo-score-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.seo-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--secondary) var(--score-pct, 85%), var(--border) var(--score-pct, 85%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.seo-score-circle::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--bg-card);
  border-radius: 50%;
}

.seo-score-value {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
}

.seo-score-info h4 {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.seo-score-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================
   ERROR STATE
   ============================================ */
.error-state {
  display: none;
  padding: 32px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.error-state.visible {
  display: block;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.error-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ef4444;
  margin-bottom: 8px;
}

.error-message {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 20px;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.features-section {
  padding: 60px 24px 80px;
  background: var(--bg-secondary);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.2);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
  transition: var(--transition);
}

.feature-card:hover .feature-icon-wrap {
  transform: scale(1.1) rotate(-5deg);
}

.feature-card:nth-child(1) .feature-icon-wrap { background: rgba(37, 99, 235, 0.1); }
.feature-card:nth-child(2) .feature-icon-wrap { background: rgba(99, 102, 241, 0.1); }
.feature-card:nth-child(3) .feature-icon-wrap { background: rgba(16, 185, 129, 0.1); }
.feature-card:nth-child(4) .feature-icon-wrap { background: rgba(139, 92, 246, 0.1); }

.feature-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  position: relative;
  margin-top: 48px;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  z-index: 0;
}

.step-item {
  text-align: center;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: var(--transition);
}

.step-item:hover .step-number {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.step-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  max-width: 360px;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: var(--transition);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  to { transform: translateX(100px); opacity: 0; }
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--primary); }

/* ============================================
   FOOTER
   ============================================ */
footer {
  background: var(--bg-dark);
  color: #94a3b8;
  text-align: center;
  padding: 40px 24px;
}

[data-theme="dark"] footer {
  background: #020617;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 16px;
}

.footer-note {
  font-size: 0.78rem;
  color: #475569;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing cursor animation */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--primary);
  font-weight: 300;
}

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

/* ============================================
   SCROLLBAR (Global)
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .hero { padding: 48px 16px 40px; }
  .hero-stats { gap: 20px; }
  .generator-section { padding: 0 16px 60px; }
  .input-wrapper, .action-row, .card-header { padding-left: 18px; padding-right: 18px; }
  .output-toolbar { padding: 14px 18px; }
  .output-content { padding: 18px; }
  .btn-primary { min-width: 100%; }
  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; }
  .steps-grid::before { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .output-actions { width: 100%; }
  .output-actions .btn { flex: 1; font-size: 0.78rem; padding: 8px 10px; }
  .output-toolbar { flex-direction: column; align-items: flex-start; }
  .seo-score-card { flex-direction: column; text-align: center; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: unset; max-width: 100%; }
}

@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 1.8rem; }
  #articleOutput h1 { font-size: 1.3rem; }
  #articleOutput h2 { font-size: 1.05rem; }
  #articleOutput table { font-size: 0.78rem; }
  #articleOutput table th, #articleOutput table td { padding: 8px 10px; }
}
