/* ============================================================
   TradeWithAI — enhancements.css
   Premium visual upgrades: animations, gradients, stats, etc.
   ============================================================ */

/* ── CSS Custom Properties Extensions ── */
:root {
  --glow-cyan-strong:  0 0 40px rgba(0,212,255,0.3), 0 0 80px rgba(0,212,255,0.1), 0 4px 24px rgba(0,0,0,0.5);
  --glow-purple-strong:0 0 40px rgba(123,97,255,0.3), 0 0 80px rgba(123,97,255,0.1), 0 4px 24px rgba(0,0,0,0.5);
  --shine-gradient: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
}

/* ════════════════════════════════════════
   HERO — Animated Gradient Mesh Background
   ════════════════════════════════════════ */

@keyframes blob1 {
  0%,100% { transform: translate(0px, 0px) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.1); }
  66%      { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes blob2 {
  0%,100% { transform: translate(0px, 0px) scale(1); }
  33%      { transform: translate(-35px, 25px) scale(1.05); }
  66%      { transform: translate(30px, -15px) scale(1.1); }
}

@keyframes blob3 {
  0%,100% { transform: translate(0px, 0px) scale(1); }
  50%      { transform: translate(20px, 30px) scale(1.08); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Replace static hero::before with animated mesh */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,212,255,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 5%,  rgba(123,97,255,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 50% 90%, rgba(0,212,255,0.06) 0%, transparent 50%);
  pointer-events: none;
  animation: gradientShift 12s ease infinite;
  background-size: 200% 200%;
}

/* Floating blobs inside hero */
.hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, rgba(0,212,255,0.06) 0%, transparent 70%);
  animation: blob1 18s ease-in-out infinite;
  pointer-events: none;
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
}

.hero__blob--1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  background: radial-gradient(circle, rgba(123,97,255,0.1) 0%, transparent 70%);
  animation: blob2 22s ease-in-out infinite;
}

.hero__blob--2 {
  width: 350px;
  height: 350px;
  bottom: -50px;
  left: 20%;
  background: radial-gradient(circle, rgba(0,212,255,0.07) 0%, transparent 70%);
  animation: blob3 16s ease-in-out infinite;
}

/* ── Glowing Animated Border on Hero ── */
@keyframes borderGlow {
  0%,100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.hero__glow-border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
  animation: borderGlow 3s ease-in-out infinite;
}

/* ════════════════════════════════════════
   HERO TITLE — Gradient Text
   ════════════════════════════════════════ */

.hero__title {
  background: linear-gradient(135deg, #ffffff 0%, #c8f7ff 40%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__title .highlight {
  background: linear-gradient(135deg, var(--cyan) 0%, #a78bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Section headers gradient text ── */
.section-header__title,
.category-header h2 {
  background: linear-gradient(135deg, #ffffff 30%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ════════════════════════════════════════
   PULSING DOT — "Updated for 2026" badge
   ════════════════════════════════════════ */

@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(0,212,255,0.7); }
  50%      { transform: scale(1.15); opacity: 0.9; box-shadow: 0 0 0 6px rgba(0,212,255,0); }
}

.hero__badge::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  margin-right: 0.4rem;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ════════════════════════════════════════
   CTA BUTTON — Gradient + Shine Sweep
   ════════════════════════════════════════ */

@keyframes shine-sweep {
  0%   { left: -100%; }
  100% { left: 200%; }
}

.btn--primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.btn--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: var(--shine-gradient);
  transform: skewX(-20deg);
  transition: none;
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,212,255,0.35), 0 0 60px rgba(123,97,255,0.2);
}

.btn--primary:hover::before {
  animation: shine-sweep 0.65s ease forwards;
}

/* ════════════════════════════════════════
   STATS BAR
   ════════════════════════════════════════ */

.stats-bar {
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.04) 0%, rgba(123,97,255,0.04) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.stats-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 40% 80% at 10% 50%, rgba(0,212,255,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 80% at 90% 50%, rgba(123,97,255,0.05) 0%, transparent 60%);
  pointer-events: none;
}

.stats-bar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
}

.stat-item {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.stat-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-item:hover {
  border-color: var(--border-cyan);
  background: rgba(0,212,255,0.04);
  transform: translateY(-4px);
  box-shadow: var(--glow-cyan);
}

.stat-item__number {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.4rem;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.stat-item__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ════════════════════════════════════════
   TOOL EMOJI BADGES in comparison table
   ════════════════════════════════════════ */

.tool-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ════════════════════════════════════════
   TOOL RATING BARS
   ════════════════════════════════════════ */

.rating-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rating-bar {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}

.rating-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  width: 0%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.rating-bar__fill.animated {
  /* width set via JS */
}

/* ════════════════════════════════════════
   FLOATING CARD EFFECT (enhanced)
   ════════════════════════════════════════ */

.card,
.tool-card,
.article-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.card:hover,
.tool-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 60px rgba(0,212,255,0.12),
              0 0 0 1px rgba(0,212,255,0.2),
              0 4px 24px rgba(0,0,0,0.5);
  border-color: rgba(0,212,255,0.3) !important;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(0,212,255,0.1),
              0 0 0 1px rgba(0,212,255,0.15),
              0 4px 24px rgba(0,0,0,0.5);
  border-color: rgba(0,212,255,0.25) !important;
}

/* ════════════════════════════════════════
   SCROLL FADE-IN ANIMATION
   ════════════════════════════════════════ */

.card,
.tool-card,
.article-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease,
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.card.visible,
.tool-card.visible,
.article-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card.visible:hover,
.tool-card.visible:hover {
  transform: translateY(-8px) scale(1.01);
}

.article-card.visible:hover {
  transform: translateY(-6px);
}

/* Stagger delays for grid children */
.cards-grid .card:nth-child(1),
.cards-grid .tool-card:nth-child(1) { transition-delay: 0.05s; }
.cards-grid .card:nth-child(2),
.cards-grid .tool-card:nth-child(2) { transition-delay: 0.12s; }
.cards-grid .card:nth-child(3),
.cards-grid .tool-card:nth-child(3) { transition-delay: 0.19s; }

/* ════════════════════════════════════════
   WHY TRADERS SECTION
   ════════════════════════════════════════ */

.why-section {
  padding: 5rem 0;
  background: var(--bg);
}

.benefit-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(20,24,40,0.8) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.benefit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.benefit-card:hover::before { opacity: 1; }

.benefit-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(123,97,255,0.15));
  border: 1px solid rgba(0,212,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.benefit-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.benefit-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ════════════════════════════════════════
   FEATURED REVIEW HIGHLIGHT BOX
   ════════════════════════════════════════ */

.featured-review-box {
  background: linear-gradient(135deg, rgba(0,212,255,0.06) 0%, rgba(123,97,255,0.06) 100%);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
}

.featured-review-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
}

.featured-review-box__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.featured-review-box__label::before {
  content: '⭐';
}

.featured-review-box__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.featured-review-box__excerpt {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.featured-review-box__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.featured-review-box__score {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.featured-score-num {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.featured-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ════════════════════════════════════════
   NAV — Hamburger X animation
   ════════════════════════════════════════ */

.nav__hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__hamburger span {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ════════════════════════════════════════
   MISC POLISH
   ════════════════════════════════════════ */

/* Nav logo glow on hover */
.nav__logo:hover span {
  filter: drop-shadow(0 0 8px rgba(0,212,255,0.4));
}

/* Trust bar subtle gradient */
.trust-bar {
  background: linear-gradient(135deg, rgba(26,31,53,0.9), rgba(20,24,40,0.9));
}

/* Category section headers */
.category-section .category-label {
  text-shadow: 0 0 20px rgba(0,212,255,0.4);
}

/* Table hover row glow */
.compare-table tbody tr:hover {
  background: rgba(0,212,255,0.03) !important;
  box-shadow: inset 0 0 0 1px rgba(0,212,255,0.08);
}

/* Disclosure box subtle pulse border */
@keyframes border-pulse {
  0%,100% { border-color: rgba(123,97,255,0.2); }
  50%      { border-color: rgba(123,97,255,0.4); }
}

.disclosure-box {
  animation: border-pulse 4s ease-in-out infinite;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .stats-bar__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .stats-bar__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .stat-item__number {
    font-size: 2rem;
  }
}
