/* ============================================================
   blog-topic-generator.css
   Scoped styles for /blog-topic-generator.php
   Does NOT override global.css
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────────── */
.btg-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 60%, #6366f1 100%);
  padding: 72px 0 80px;
  text-align: center;
  color: #fff;
}

.btg-hero__orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.btg-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: orbFloat 8s ease-in-out infinite alternate;
}

.btg-orb--1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #a78bfa, transparent 70%);
  top: -120px;
  left: -80px;
}

.btg-orb--2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #f472b6, transparent 70%);
  bottom: -100px;
  right: -60px;
  animation-delay: -4s;
}

@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, -20px) scale(1.06); }
}

.btg-hero__inner {
  position: relative;
  z-index: 1;
}

.btg-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-5);
}

.btg-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: var(--weight-black);
  color: #fff;
  line-height: 1.1;
  margin-bottom: var(--space-5);
}

.btg-hero__title .highlight {
  background: linear-gradient(90deg, #fde68a, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btg-hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.88);
  max-width: 600px;
  margin: 0 auto var(--space-6);
  line-height: 1.65;
}

/* Usage badge */
.btg-usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  padding: 7px 18px;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.92);
  font-weight: var(--weight-medium);
}

.btg-usage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fcd34d;
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

.btg-usage-dot--green { background: #34d399; }

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

/* ── Tool Card ──────────────────────────────────────────────── */
.btg-tool {
  padding: 60px 0 48px;
  background: var(--color-bg);
}

.btg-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-light);
  padding: 40px;
  max-width: 860px;
  margin: 0 auto;
}

/* Input area */
.btg-input-area {
  margin-bottom: var(--space-6);
}

.btg-label {
  display: block;
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.btg-input-row {
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
}

.btg-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.btg-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
  color: var(--color-text-muted);
}

.btg-input {
  width: 100%;
  height: 54px;
  padding: 0 var(--space-5) 0 44px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-surface);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
}

.btg-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}

.btg-input::placeholder { color: var(--color-text-muted); }

.btg-generate-btn {
  height: 54px;
  padding: 0 28px;
  flex-shrink: 0;
  white-space: nowrap;
}

.btg-btn-text,
.btg-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Ensure [hidden] always hides — overrides any display rule above */
.btg-generate-btn [hidden] {
  display: none !important;
}

.btg-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.75s linear infinite;
}

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

.btg-input-hint {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── Error / alerts ────────────────────────────────────────── */
.btg-error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: #dc2626;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-5);
}

/* ── Signup CTA (limit reached) ────────────────────────────── */
.btg-signup-cta {
  text-align: center;
  padding: 40px var(--space-6);
  background: linear-gradient(135deg, #f0f4ff 0%, #faf0ff 100%);
  border-radius: var(--radius-lg);
  border: 2px dashed #c7d2fe;
  margin-top: var(--space-6);
}

.btg-signup-cta__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.btg-signup-cta h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.btg-signup-cta p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  max-width: 420px;
  margin-inline: auto;
}

.btg-login-link {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: underline;
}

.btg-login-link:hover { color: var(--color-primary); }

/* ── Results ───────────────────────────────────────────────── */
.btg-results {
  margin-top: var(--space-8);
  animation: fadeUp 0.4s ease both;
}

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

.btg-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-6);
}

.btg-results__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

.btg-results__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.1);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* Topics grid */
.btg-topics-grid {
  display: grid;
  gap: var(--space-4);
}

/* Topic card */
.btg-topic-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  animation: fadeUp 0.35s ease both;
}

.btg-topic-card:hover {
  border-color: rgba(99,102,241,0.35);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.btg-topic-card__num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: #fff;
  margin-top: 2px;
}

.btg-topic-card__text {
  flex: 1;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  line-height: 1.5;
}

.btg-topic-card__copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btg-topic-card__copy:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(99,102,241,0.06);
}

.btg-topic-card__copy.copied {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(16,185,129,0.08);
}

/* Staggered animation delay */
.btg-topic-card:nth-child(1)  { animation-delay: 0.02s; }
.btg-topic-card:nth-child(2)  { animation-delay: 0.05s; }
.btg-topic-card:nth-child(3)  { animation-delay: 0.08s; }
.btg-topic-card:nth-child(4)  { animation-delay: 0.11s; }
.btg-topic-card:nth-child(5)  { animation-delay: 0.14s; }
.btg-topic-card:nth-child(6)  { animation-delay: 0.17s; }
.btg-topic-card:nth-child(7)  { animation-delay: 0.20s; }
.btg-topic-card:nth-child(8)  { animation-delay: 0.23s; }
.btg-topic-card:nth-child(9)  { animation-delay: 0.26s; }
.btg-topic-card:nth-child(10) { animation-delay: 0.29s; }

/* ── Info row ───────────────────────────────────────────────── */
.btg-info-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  max-width: 860px;
  margin: var(--space-10) auto 0;
}

.btg-info-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.btg-info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.btg-info-card__icon {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

.btg-info-card h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.btg-info-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ── How it works ──────────────────────────────────────────── */
.btg-how {
  padding: 60px 0 80px;
  background: var(--color-surface-alt);
  text-align: center;
}

.btg-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-10);
  flex-wrap: wrap;
}

.btg-step {
  flex: 1;
  min-width: 180px;
  max-width: 240px;
}

.btg-step__num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.btg-step h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}

.btg-step p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.btg-step__arrow {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .btg-card { padding: 28px 20px; }

  .btg-input-row {
    flex-direction: column;
  }

  .btg-generate-btn {
    width: 100%;
    height: 50px;
  }

  .btg-info-row {
    grid-template-columns: 1fr;
  }

  .btg-step__arrow { display: none; }

  .btg-results__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .btg-hero { padding: 52px 0 60px; }
  .btg-topic-card { flex-wrap: wrap; }
  .btg-topic-card__copy { width: 100%; justify-content: center; }
}
