/**
 * WritexNova — Premium UI Enhancement v1.0
 * A) Glassmorphism  B) Animated gradient  C) Micro animations
 * D) Typography     E) Dark mode polish
 * Loads AFTER style.css — safe to add, never overwrites
 */

/* ═══════════════════════════════════════════════════════════════
   A) GLASSMORPHISM — Cards & Nav
═══════════════════════════════════════════════════════════════ */

/* Nav glassmorphism — original style */
.nav {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255,255,255,0.88) !important;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
[data-theme="dark"] .nav {
  background: rgba(12,10,9,0.88) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Card subtle enhancement — no glass blur to keep content clear */
.card {
  box-shadow: 0 4px 24px rgba(79,70,229,0.06), 0 1px 4px rgba(0,0,0,0.04) !important;
}
[data-theme="dark"] .card {
  box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
}

/* Tool cards — smooth hover only, no blur */
.tool-card, .dash-tool-card, .pricing-card {
  transition: transform 0.22s cubic-bezier(.4,0,.2,1),
              box-shadow 0.22s cubic-bezier(.4,0,.2,1),
              border-color 0.18s ease !important;
  opacity: 1 !important;
}
.tool-card:hover, .dash-tool-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(79,70,229,0.14) !important;
  border-color: var(--primary) !important;
}

/* ═══════════════════════════════════════════════════════════════
   B) ANIMATED GRADIENT HERO
═══════════════════════════════════════════════════════════════ */

.lp-hero, .hero, [class*="hero"] {
  position: relative;
  overflow: hidden;
}

/* Animated gradient overlay */
.lp-hero::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #4f46e5 0deg,
    #7c3aed 60deg,
    #6d28d9 120deg,
    #4338ca 180deg,
    #7c3aed 240deg,
    #4f46e5 360deg
  );
  opacity: 0.08;
  animation: hero-spin 18s linear infinite;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes hero-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Floating blobs animation */
.lp-blob {
  animation: blob-float 8s ease-in-out infinite !important;
}
.lp-blob-2 {
  animation-delay: -4s !important;
  animation-duration: 10s !important;
}
@keyframes blob-float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(20px,-15px) scale(1.05); }
  66%       { transform: translate(-10px,10px) scale(0.97); }
}

/* ═══════════════════════════════════════════════════════════════
   C) MICRO ANIMATIONS
═══════════════════════════════════════════════════════════════ */

/* Button press effect */
.btn {
  transition: all 0.18s cubic-bezier(.4,0,.2,1) !important;
  position: relative;
  overflow: hidden;
}

/* Ripple on click */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
}
.btn:active::after { opacity: 1; }

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.35) !important;
}
.btn-primary:active { transform: translateY(0) !important; }

/* Input focus animation */
.form-input, .form-select, textarea {
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}
.form-input:focus, .form-select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12) !important;
}

/* Nav links hover underline animation */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.22s ease;
  border-radius: 2px;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { text-decoration: none !important; }

/* Page fade-in — subtle */
body {
  animation: page-fadein 0.25s ease;
}
@keyframes page-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Badge pulse */
.badge-primary, .lp-hero-badge {
  animation: badge-pulse 3s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,70,229,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(79,70,229,0); }
}

/* Stat number count animation — adds class on load */
.stat-number-anim {
  animation: num-pop 0.5s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes num-pop {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Card entrance animation */
/* Card entrance - only for main cards, not tool cards */
.card {
  animation: card-in 0.4s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner glow */
.spinner {
  box-shadow: 0 0 8px rgba(79,70,229,0.3);
}

/* ═══════════════════════════════════════════════════════════════
   D) TYPOGRAPHY — Better hierarchy
═══════════════════════════════════════════════════════════════ */

/* Headings */
h1, h2, h3, h4 {
  letter-spacing: -0.025em;
  line-height: 1.2;
}
h1 { font-weight: 800; }
h2 { font-weight: 750; }
h3 { font-weight: 700; }

/* Hero headline */
/* Only hero section headline gets gradient — not all h1s */
.lp-hero-headline {
  background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.85) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

/* Output text better readability */
#outputBox, #humanOutputBox, #paraphraseOutputBox,
#grammarOutputBox, #summaryOutputBox {
  font-size: 0.96rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* Better placeholder text */
::placeholder {
  color: var(--text-muted);
  opacity: 0.65;
}

/* Section titles */
.u-page-title, .dash-section-title {
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   E) DARK MODE POLISH
═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --bg:        #0a0908;
  --bg-card:   #161412;
  --bg-2:      #1e1c1a;
  --bg-3:      #2a2826;
  --border:    rgba(255,255,255,0.07);
  --text-muted:#9ca3af;
}

/* Dark mode card subtle glow */
[data-theme="dark"] .card {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04),
              0 4px 24px rgba(0,0,0,0.4) !important;
}

/* Dark mode inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea {
  background: #1a1816;
  border-color: rgba(255,255,255,0.08);
  color: #f5f5f4;
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.18) !important;
}

/* Dark mode nav links */
[data-theme="dark"] .nav-links a {
  color: #d6d3d1;
}
[data-theme="dark"] .nav-links a:hover {
  color: #fff;
}

/* Dark mode buttons */
[data-theme="dark"] .btn-outline {
  border-color: rgba(255,255,255,0.15);
  color: #e7e5e4;
}
[data-theme="dark"] .btn-outline:hover {
  background: rgba(79,70,229,0.12);
  border-color: var(--primary);
  color: #a5b4fc;
}

/* Dark mode tool cards */
[data-theme="dark"] .tool-card,
[data-theme="dark"] .dash-tool-card {
  background: rgba(22,20,18,0.9) !important;
  border-color: rgba(255,255,255,0.07) !important;
}
[data-theme="dark"] .tool-card:hover,
[data-theme="dark"] .dash-tool-card:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 8px 32px rgba(79,70,229,0.2) !important;
}

/* Dark mode scrollbar */
[data-theme="dark"] ::-webkit-scrollbar { width: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #0a0908; }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3a3835;
  border-radius: 99px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4f46e5; }

/* Light mode scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f5f4f3; }
::-webkit-scrollbar-thumb { background: #d6d3d1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Dark mode selection */
[data-theme="dark"] ::selection {
  background: rgba(79,70,229,0.4);
  color: #fff;
}
::selection {
  background: rgba(79,70,229,0.15);
  color: var(--primary);
}

/* Dark mode toast */
[data-theme="dark"] .toast {
  background: #1e1c1a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM GLOW EFFECTS
═══════════════════════════════════════════════════════════════ */

/* Primary button glow */
.btn-primary {
  box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(79,70,229,0.4) !important;
}

/* Pricing card featured glow */
.pricing-card.featured, .pricing-card[class*="featured"] {
  box-shadow: 0 0 0 1px var(--primary),
              0 20px 60px rgba(79,70,229,0.2) !important;
}

/* Profile avatar glow */
.avatar-big, .nav-avatar {
  box-shadow: 0 0 0 3px var(--primary), 0 4px 16px rgba(79,70,229,0.3);
  transition: box-shadow 0.22s ease;
}

/* Focus ring global */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Smooth theme transition */
*, *::before, *::after {
  transition: background-color 0.2s ease, border-color 0.2s ease,
              color 0.15s ease !important;
}
/* But not animations */
.spinner, .lp-blob, [class*="anim"],
.btn, .btn::after, .nav-links a::after {
  transition: revert !important;
}
.btn {
  transition: all 0.18s cubic-bezier(.4,0,.2,1) !important;
}