/* ============================================
   MULTICALCWISE — BOLD ANIMATION SYSTEM
   ============================================ */

/* ---- PAGE LOAD ANIMATIONS ---- */

@keyframes heroTitleEntrance {
  0% {
    opacity: 0;
    transform: translateY(60px) skewY(3deg);
    filter: blur(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) skewY(0deg);
    filter: blur(0px);
  }
}

@keyframes heroSubtitleEntrance {
  0% {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInDown {
  0% {
    opacity: 0;
    transform: translateY(-40px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- HERO SECTION ---- */

.hero-title {
  animation: heroTitleEntrance 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.hero-subtitle {
  animation: heroSubtitleEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.35s;
  opacity: 0;
}

.hero-cta {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.55s;
  opacity: 0;
}

.hero-stats {
  animation: fadeInUp 0.7s ease forwards;
  animation-delay: 0.75s;
  opacity: 0;
}

/* ---- FLOATING ORBS ---- */

@keyframes orbFloat1 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -40px) scale(1.05);
  }

  66% {
    transform: translate(-20px, -20px) scale(0.97);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes orbFloat2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-40px, 30px) scale(1.08);
  }

  66% {
    transform: translate(20px, 40px) scale(0.95);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes orbPulse {
  0%,
  100% {
    opacity: 0.15;
  }

  50% {
    opacity: 0.25;
  }
}

.orb-1 {
  animation: orbFloat1 8s ease-in-out infinite, orbPulse 4s ease-in-out infinite;
}

.orb-2 {
  animation: orbFloat2 10s ease-in-out infinite, orbPulse 6s ease-in-out infinite;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #f59e0b, transparent 70%);
  filter: blur(60px);
  position: absolute;
  bottom: -50px;
  left: 40%;
  opacity: 0.12;
  animation: orbFloat2 12s ease-in-out infinite reverse;
  pointer-events: none;
}

/* ---- CATEGORY HERO ---- */

.category-hero {
  background-image:
    radial-gradient(circle, rgba(0, 212, 170, 0.15) 1px, transparent 1px),
    linear-gradient(135deg, rgba(11, 17, 32, 0.04), rgba(0, 212, 170, 0.04));
  background-size: 28px 28px, auto;
  position: relative;
  overflow: hidden;
}

html.dark .category-hero {
  background-image:
    radial-gradient(circle, rgba(0, 212, 170, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, rgba(148, 163, 184, 0.06), rgba(0, 212, 170, 0.08));
}

.category-hero .orb-1 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, var(--orb-color, #00d4aa), transparent 70%);
  filter: blur(70px);
  position: absolute;
  top: -90px;
  right: -70px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.category-hero .orb-2 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--orb-color, #00d4aa), transparent 70%);
  filter: blur(55px);
  position: absolute;
  bottom: -60px;
  left: -40px;
  opacity: 0.13;
  pointer-events: none;
  z-index: 0;
}

.category-hero > *:not(.orb-1):not(.orb-2) {
  position: relative;
  z-index: 1;
}

.category-hero--finance      { --orb-color: #00d4aa; }
.category-hero--health       { --orb-color: #10b981; }
.category-hero--productivity { --orb-color: #f59e0b; }
.category-hero--math         { --orb-color: #8b5cf6; }

/* ---- SCROLL REVEAL SYSTEM ---- */

.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

.reveal:nth-child(1),
.reveal-scale:nth-child(1) {
  transition-delay: 0s;
}

.reveal:nth-child(2),
.reveal-scale:nth-child(2) {
  transition-delay: 0.1s;
}

.reveal:nth-child(3),
.reveal-scale:nth-child(3) {
  transition-delay: 0.2s;
}

.reveal:nth-child(4),
.reveal-scale:nth-child(4) {
  transition-delay: 0.3s;
}

.reveal:nth-child(5),
.reveal-scale:nth-child(5) {
  transition-delay: 0.4s;
}

.reveal:nth-child(6),
.reveal-scale:nth-child(6) {
  transition-delay: 0.5s;
}

/* ---- NAVIGATION HOVER EFFECTS ---- */

.nav-link {
  position: relative;
  overflow: hidden;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-teal);
  transform: translateX(-101%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(0);
}

.nav-link:hover {
  color: var(--color-teal);
  transition: color 0.2s ease;
}

nav {
  animation: slideInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- BUTTON HOVER EFFECTS ---- */

.btn-primary {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 150%;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 212, 170, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  border-color: var(--color-teal);
  color: var(--color-teal);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- CALCULATOR CARD HOVER EFFECTS ---- */

.calc-card-link {
  display: block;
  text-decoration: none;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease;
  border-radius: var(--radius-lg);
}

.calc-card-link:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.calc-card-link:hover .calc-card {
  border-color: var(--color-teal);
  transition: border-color 0.3s ease;
}

.calc-card-link .card-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-card-link:hover .card-arrow {
  transform: translateX(6px);
}

.calc-card-link .card-icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-card-link:hover .card-icon {
  transform: scale(1.3) rotate(-5deg);
}

/* ---- CATEGORY CARD HOVER (homepage) ---- */

.category-card {
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease,
    background 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(245, 158, 11, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

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

.category-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  border-color: var(--color-teal);
}

.category-card .category-emoji {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 3rem;
}

.category-card:hover .category-emoji {
  transform: scale(1.4) translateY(-4px) rotate(8deg);
}

/* ---- CALCULATOR INPUT EFFECTS ---- */

.calc-input {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.calc-input:focus {
  border-color: var(--color-teal);
  box-shadow:
    0 0 0 4px rgba(0, 212, 170, 0.18),
    0 4px 12px rgba(0, 212, 170, 0.1);
  transform: scale(1.01);
  outline: none;
}

@keyframes inputShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-5px);
  }

  80% {
    transform: translateX(5px);
  }
}

.calc-input.invalid {
  animation: inputShake 0.4s ease;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.calc-field {
  position: relative;
}

/* ---- RESULT BOX ANIMATIONS ---- */

@keyframes resultPop {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.08);
  }

  60% {
    transform: scale(0.97);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes resultGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0);
  }

  50% {
    box-shadow: 0 0 30px 8px rgba(0, 212, 170, 0.3);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 170, 0);
  }
}

@keyframes numberFlip {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  30% {
    transform: translateY(-20px);
    opacity: 0;
  }

  31% {
    transform: translateY(20px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.calc-result-value.updated {
  animation:
    resultPop 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    resultGlow 0.6s ease;
}

.calc-result-box.updated {
  animation: resultGlow 0.6s ease;
}

@keyframes rowSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-15px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.calc-result-breakdown .breakdown-row {
  animation: rowSlideIn 0.4s ease forwards;
}

.calc-result-breakdown .breakdown-row:nth-child(1) {
  animation-delay: 0.05s;
}

.calc-result-breakdown .breakdown-row:nth-child(2) {
  animation-delay: 0.1s;
}

.calc-result-breakdown .breakdown-row:nth-child(3) {
  animation-delay: 0.15s;
}

.calc-result-breakdown .breakdown-row:nth-child(4) {
  animation-delay: 0.2s;
}

.calc-result-breakdown .breakdown-row:nth-child(5) {
  animation-delay: 0.25s;
}

/* ---- NUMBER COUNTER ---- */

@keyframes countUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.counter.is-counting {
  animation: countUp 0.3s ease forwards;
}

/* ---- STAT CARDS (homepage) ---- */

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

.stat-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.stat-number {
  background: linear-gradient(135deg, var(--color-teal), #00b894);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- BADGE HOVER ---- */

.badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.badge:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ---- RELATED TOOLS CARDS ---- */

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

.related-tool-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
  border-color: var(--color-teal);
}

/* ---- FAQ ACCORDION ---- */

.faq-question {
  transition: color 0.2s ease, background 0.2s ease;
}

.faq-question:hover {
  color: var(--color-teal);
  background: rgba(0, 212, 170, 0.04);
  padding-left: 0.5rem;
  transition: all 0.2s ease;
}

.faq-item.open .faq-question {
  color: var(--color-teal);
}

.faq-chevron {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* ---- DARK MODE TOGGLE ---- */

.dark-toggle {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s ease;
}

.dark-toggle:hover {
  transform: rotate(20deg) scale(1.15);
}

/* ---- FOOTER LINKS ---- */

.footer-link {
  position: relative;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: var(--color-teal);
  transform: translateX(4px);
}

/* ---- PROGRESS BAR ANIMATION ---- */

@keyframes progressFill {
  0% {
    width: 0%;
  }

  100% {
    width: var(--progress-width);
  }
}

.progress-bar-fill {
  animation: progressFill 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.3s;
  width: 0%;
}

/* ---- AMORTIZATION TABLE ROWS ---- */

.amortization-row {
  transition: background 0.15s ease, transform 0.15s ease;
}

.amortization-row:hover {
  background: rgba(0, 212, 170, 0.06);
  transform: scaleX(1.005);
}

/* ---- PAGE TRANSITION ---- */

@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-content {
  padding-bottom: var(--space-2xl);
  animation: pageEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- MOBILE MENU ---- */

@keyframes menuSlideIn {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes menuSlideOut {
  0% {
    transform: translateX(0);
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.mobile-menu.open {
  animation: menuSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mobile-menu.closing {
  animation: menuSlideOut 0.3s ease forwards;
}

.mobile-nav-link {
  opacity: 0;
  transform: translateX(30px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    color 0.2s ease;
}

.mobile-menu.open .mobile-nav-link:nth-child(1) {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.1s;
}

.mobile-menu.open .mobile-nav-link:nth-child(2) {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.15s;
}

.mobile-menu.open .mobile-nav-link:nth-child(3) {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.2s;
}

.mobile-menu.open .mobile-nav-link:nth-child(4) {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.25s;
}

.mobile-nav-link:hover {
  color: var(--color-teal);
  transform: translateX(8px) !important;
}

/* ---- CURSOR GLOW (desktop only) ---- */

.cursor-glow {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.06), transparent 70%);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.08s ease, top 0.08s ease;
  z-index: 0;
}

/* ---- SCROLL PROGRESS INDICATOR ---- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}

.scroll-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--color-teal);
  box-shadow: 0 0 14px rgba(0, 212, 170, 0.45);
  transform-origin: left center;
  transition: width 0.08s linear;
}

/* ---- TOOLTIP ---- */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--color-navy);
  color: white;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- REDUCE MOTION ACCESSIBILITY ---- */

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