/* ============================================
   TOOLPIXA — Global Design System
   ============================================ */

/* --- Google Fonts --- */
/* Google Fonts imported parallelly in HTML head to prevent render blocking */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Primary Colors - Electric Indigo */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;

  /* Accent - Sunset Rose */
  --accent: #f43f5e;
  --accent-light: #fb7185;
  --accent-dark: #e11d48;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --black: #020617;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Theme Colors (light mode defaults) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #27272a;
  --text-tertiary: #4b5563;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-color: rgba(99, 102, 241, 0.04);
  --shadow-heavy: rgba(99, 102, 241, 0.08);
  --header-bg: rgba(255, 255, 255, 0.85);
  --header-blur: blur(20px);
  --overlay: rgba(2, 6, 23, 0.4);

  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;
  --font-5xl: 3rem;
  --line-height: 1.6;
  --line-height-tight: 1.25;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Borders */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px var(--shadow-color);
  --shadow-sm: 0 2px 4px var(--shadow-color);
  --shadow-md: 0 4px 12px var(--shadow-color);
  --shadow-lg: 0 8px 24px var(--shadow-color);
  --shadow-xl: 0 16px 48px var(--shadow-heavy);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
  --sidebar-width: 300px;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --bg-primary: #030712;
  --bg-secondary: #0b0f19;
  --bg-tertiary: #1e293b;
  --bg-card: #0b0f19;
  --bg-input: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #f1f5f9;
  --text-tertiary: #cbd5e1;
  --text-inverse: #030712;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  --shadow-color: rgba(0, 0, 0, 0.4);
  --shadow-heavy: rgba(0, 0, 0, 0.6);
  --header-bg: rgba(3, 7, 18, 0.8);
  --overlay: rgba(2, 6, 23, 0.75);
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  animation: pageFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Global theme transition helper */
header, footer, .calculator, .result-card, .tool-card, .category-card, .faq-item, .input-group .input-value input, .btn, .btn-option, .toggle-option {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform var(--transition-base), box-shadow var(--transition-base);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

::selection {
  background-color: var(--primary);
  color: var(--white);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  font-weight: 700;
}

h1 { font-size: var(--font-4xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--font-2xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--font-xl); margin-bottom: var(--space-2); }
h4 { font-size: var(--font-lg); margin-bottom: var(--space-2); }

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.text-accent { color: var(--accent); }
.text-primary-color { color: var(--primary); }
.text-center { text-align: center; }

@media (max-width: 768px) {
  h1 { font-size: var(--font-3xl); }
  h2 { font-size: var(--font-xl); }
  h3 { font-size: var(--font-lg); }
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-16) 0;
}

.how-to-use, .faq-section, .related-tools, .footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-10) 0;
  }
  .section-header {
    margin-bottom: var(--space-8);
  }
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: var(--header-blur);
  -webkit-backdrop-filter: var(--header-blur);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-4);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: var(--font-lg);
}

.logo-text {
  font-size: var(--font-xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent);
}

/* Search */
.header-search {
  position: relative;
  flex: 1;
  max-width: 460px;
}

.header-search input {
  width: 100%;
  height: 42px;
  padding: 0 var(--space-4) 0 var(--space-10);
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
}

.header-search input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .header-search input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.header-search input::placeholder {
  color: var(--text-tertiary);
}

.header-search .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.active {
  display: block;
  animation: fadeInDown 0.2s ease;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-result-item .result-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

[data-theme="dark"] .search-result-item .result-icon {
  background: var(--bg-tertiary);
}

.search-result-item .result-info h4 {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: 2px;
}

.search-result-item .result-info p {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin: 0;
}

.search-no-results {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--font-sm);
}

/* Dark Mode Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover svg {
  transform: rotate(30deg) scale(1.1);
}

.theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-sun {
  display: block;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Mobile header */
@media (max-width: 640px) {
  .header-search {
    display: none;
  }
  .header-inner {
    gap: var(--space-2);
  }
  .logo-text {
    font-size: var(--font-lg);
  }
  .mobile-search-toggle {
    display: flex !important;
  }
}

.mobile-search-toggle {
  display: none !important;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-search-toggle:hover {
  background: var(--bg-tertiary);
  transform: scale(1.08);
}

.mobile-search-toggle:active {
  transform: scale(0.92);
}

.mobile-search-toggle svg {
  width: 22px;
  height: 22px;
}

/* Mobile search overlay */
.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 2000;
  padding: var(--space-4);
}

.mobile-search-overlay.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.mobile-search-overlay .search-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.mobile-search-overlay .search-header input {
  flex: 1;
  height: 48px;
  padding: 0 var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-base);
}

.mobile-search-overlay .search-header input:focus {
  border-color: var(--primary);
}

.mobile-search-close {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.mobile-search-results {
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

.mobile-search-results .search-result-item {
  padding: var(--space-4);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  text-align: center;
  padding: var(--space-20) 0 var(--space-16);
  background: radial-gradient(100% 100% at 50% 0%, rgba(99, 102, 241, 0.08) 0%, rgba(244, 63, 94, 0.02) 50%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .hero {
  background: radial-gradient(100% 100% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, rgba(244, 63, 94, 0.04) 50%, var(--bg-primary) 100%);
}

.hero-glow-1, .hero-glow-2 {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  z-index: 1;
  pointer-events: none;
  transition: all 1s ease;
}

.hero-glow-1 {
  width: 320px;
  height: 320px;
  background: rgba(99, 102, 241, 0.18);
  top: -100px;
  left: 15%;
  animation: floatOrb1 25s infinite alternate ease-in-out;
}

.hero-glow-2 {
  width: 280px;
  height: 280px;
  background: rgba(244, 63, 94, 0.12);
  top: 40px;
  right: 15%;
  animation: floatOrb2 20s infinite alternate ease-in-out;
}

[data-theme="dark"] .hero-glow-1 {
  background: rgba(99, 102, 241, 0.28);
}
[data-theme="dark"] .hero-glow-2 {
  background: rgba(244, 63, 94, 0.18);
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-30px, 80px) scale(0.9); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -60px) scale(0.85); }
  100% { transform: translate(70px, 30px) scale(1.15); }
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: var(--font-5xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-8);
}

.hero-search {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-6) 0 var(--space-12);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--font-base);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-200), var(--shadow-md);
}

[data-theme="dark"] .hero-search input:focus {
  box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.3), var(--shadow-md);
}

.hero-search .search-icon {
  position: absolute;
  left: var(--space-5);
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  color: var(--text-tertiary);
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-12) 0 var(--space-10);
  }
  .hero h1 {
    font-size: var(--font-3xl);
  }
  .hero p {
    font-size: var(--font-base);
  }
  .hero-search input {
    height: 50px;
    font-size: var(--font-sm);
  }
}

/* ============================================
   CATEGORY GRID
   ============================================ */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  flex: 1 1 180px;
  max-width: 220px;
}

.category-card:hover {
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 20px 40px var(--shadow-heavy), 0 0 0 1px var(--primary-light);
  border-color: var(--primary-light);
  color: var(--text-primary);
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  font-size: 1.6rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .category-icon {
  transform: scale(1.15) rotate(3deg);
}

.category-icon.finance { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.category-icon.student { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.category-icon.converter { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.category-icon.health { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }
.category-icon.developer { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

[data-theme="dark"] .category-icon.finance { background: rgba(99, 102, 241, 0.2); }
[data-theme="dark"] .category-icon.student { background: rgba(16, 185, 129, 0.2); }
[data-theme="dark"] .category-icon.converter { background: rgba(245, 158, 11, 0.2); }
[data-theme="dark"] .category-icon.health { background: rgba(244, 63, 94, 0.2); }
[data-theme="dark"] .category-icon.developer { background: rgba(139, 92, 246, 0.2); }

.category-card h3 {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.category-card p {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin: 0;
}

@media (max-width: 768px) {
  .category-card {
    padding: var(--space-4) var(--space-3);
    flex: 1 1 calc(33.333% - var(--space-3));
    max-width: 220px;
  }
  .category-icon {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .category-card {
    flex: 1 1 calc(50% - var(--space-2));
    max-width: none;
  }
}

/* ============================================
   TOOL CARDS
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-decoration: none;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.25);
  border-color: var(--primary-light);
  color: var(--text-primary);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--primary-50);
  color: var(--primary);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.15) rotate(-3deg);
  background: var(--primary);
  color: var(--white);
}

[data-theme="dark"] .tool-card-icon {
  background: rgba(26, 86, 219, 0.15);
}

.tool-card-header h3 {
  font-size: var(--font-base);
  font-weight: 600;
  margin: 0;
}

.tool-card p {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-4);
  flex: 1;
}

.tool-card-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-tertiary);
}

@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .tool-card {
    padding: var(--space-5);
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--font-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  min-height: 48px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
  pointer-events: none;
}

.btn:active::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  transition: 0s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.btn-primary:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--white);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.25);
}

.btn-accent:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 4px 10px rgba(244, 63, 94, 0.15);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.btn-outline:active {
  transform: translateY(0) scale(0.96);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.02);
}

.btn-ghost:active {
  transform: scale(0.96);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  min-height: 36px;
  font-size: var(--font-xs);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  height: 50px;
  padding: 0 var(--space-4);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-base);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
  transform: scale(1.01);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

textarea.form-input {
  height: auto;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  min-height: 120px;
}

.form-select {
  width: 100%;
  height: 50px;
  padding: 0 var(--space-10) 0 var(--space-4);
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-base);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%236b7280'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-200);
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 36px; /* High touch target area */
  background: transparent;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  display: block;
  cursor: pointer;
}

.range-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary-light) var(--value-percent, 0%), var(--border-color) var(--value-percent, 0%), var(--border-color) 100%);
  border-radius: var(--radius-full);
  transition: background 0.05s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.range-slider::-moz-range-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary-light) var(--value-percent, 0%), var(--border-color) var(--value-percent, 0%), var(--border-color) 100%);
  border-radius: var(--radius-full);
  transition: background 0.05s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  border: 5px solid var(--primary);
  box-shadow: 0 0 0 1px var(--primary-light), 0 3px 8px rgba(99, 102, 241, 0.35);
  margin-top: -7px; /* Centering: (8px / 2) - (22px / 2) = -7px */
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--white);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(99, 102, 241, 0.45);
}

.range-slider::-webkit-slider-thumb:active {
  transform: scale(1.22);
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 9px rgba(99, 102, 241, 0.25), 0 6px 16px rgba(99, 102, 241, 0.55);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  border: 5px solid var(--primary);
  box-shadow: 0 0 0 1px var(--primary-light), 0 3px 8px rgba(99, 102, 241, 0.35);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  background: var(--white);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(99, 102, 241, 0.45);
}

.range-slider::-moz-range-thumb:active {
  transform: scale(1.22);
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 9px rgba(99, 102, 241, 0.25), 0 6px 16px rgba(99, 102, 241, 0.55);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin-top: -2px; /* Pull it slightly up since range slider has height 36px */
}

/* Button Group (for GST rates etc) */
.btn-group {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.btn-group .btn-option {
  flex: 1;
  min-width: 60px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 48px;
}

.btn-group .btn-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.btn-group .btn-option:active {
  transform: translateY(0) scale(0.96);
}

.btn-group .btn-option.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Toggle Switch */
.toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-color);
}

.toggle-group .toggle-option {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-group .toggle-option:hover {
  color: var(--primary);
  transform: scale(1.02);
}

.toggle-group .toggle-option:active {
  transform: scale(0.96);
}

.toggle-group .toggle-option.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-size: var(--font-sm);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .separator {
  color: var(--text-tertiary);
  font-size: var(--font-xs);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer-brand .logo {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  max-width: 280px;
}

.footer-col h4 {
  font-size: var(--font-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-col a {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-color);
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-free-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  color: var(--success);
  font-weight: 600;
  font-size: var(--font-xs);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ============================================
   AD SLOTS
   ============================================ */
.ad-slot {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--font-sm);
  margin: var(--space-8) 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-sidebar {
  margin: 0;
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

@media (max-width: 1024px) {
  .ad-slot-sidebar {
    display: none;
  }
}

/* ============================================
   PAGE LAYOUT WITH SIDEBAR
   ============================================ */
.page-with-sidebar {
  display: block;
  max-width: 960px;
  margin: 0 auto;
}

.page-main {
  min-width: 0;
  width: 100%;
}

.page-sidebar {
  display: none !important;
}

/* ============================================
   STATIC PAGE CONTENT
   ============================================ */
.page-hero {
  text-align: center;
  padding: var(--space-12) 0;
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg-primary) 100%);
}

[data-theme="dark"] .page-hero {
  background: linear-gradient(180deg, rgba(26, 86, 219, 0.08) 0%, var(--bg-primary) 100%);
}

.page-hero h1 {
  margin-bottom: var(--space-3);
}

.page-hero p {
  font-size: var(--font-lg);
  max-width: 600px;
  margin: 0 auto;
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-4);
}

.page-content h2 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-color);
}

.page-content h3 {
  margin-top: var(--space-6);
}

.page-content p {
  margin-bottom: var(--space-4);
  line-height: 1.8;
}

.page-content ul, .page-content ol {
  list-style: disc;
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.page-content li {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   ERROR PAGE (404)
   ============================================ */
.error-page {
  text-align: center;
  padding: var(--space-20) var(--space-4);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
}

.error-page h1 {
  font-size: var(--font-3xl);
  margin-bottom: var(--space-4);
}

.error-page p {
  font-size: var(--font-lg);
  max-width: 480px;
  margin: 0 auto var(--space-8);
}

@media (max-width: 768px) {
  .error-code {
    font-size: 5rem;
  }
}

/* ============================================
   CATEGORY PAGE
   ============================================ */
.category-hero {
  text-align: center;
  padding: var(--space-12) 0;
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg-primary) 100%);
}

[data-theme="dark"] .category-hero {
  background: linear-gradient(180deg, rgba(26, 86, 219, 0.08) 0%, var(--bg-primary) 100%);
}

.category-hero .category-icon {
  margin: 0 auto var(--space-4);
  width: 72px;
  height: 72px;
  font-size: 2rem;
}

.category-hero h1 {
  margin-bottom: var(--space-3);
}

.category-hero p {
  font-size: var(--font-lg);
  max-width: 600px;
  margin: 0 auto;
}

.category-tools-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--primary-50);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-weight: 600;
  font-size: var(--font-sm);
  margin-top: var(--space-4);
}

[data-theme="dark"] .category-tools-count {
  background: rgba(26, 86, 219, 0.15);
}

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

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

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

@keyframes valuePulse {
  0% {
    transform: scale(1.05);
    filter: brightness(1.25);
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
    text-shadow: none;
  }
}

.pulse-active {
  animation: valuePulse 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease forwards;
}

/* Staggered animations for grids */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

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

/* ============================================
   TOAST / NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-800);
  color: var(--white);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 5000;
  transition: transform var(--transition-base);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .toast {
  background: var(--gray-200);
  color: var(--gray-900);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* ============================================
   LANGUAGE TOGGLING
   ============================================ */
/* Hide all language content by default */
[class^="lang-"]:not(.lang-toggle) {
  display: none !important;
}

/* Show only the active language content */
html[data-lang="en"] .lang-en,
html[data-lang="hi"] .lang-hi,
html[data-lang="de"] .lang-de,
html[data-lang="es"] .lang-es,
html[data-lang="fr"] .lang-fr,
html[data-lang="ar"] .lang-ar,
html[data-lang="pt"] .lang-pt,
html[data-lang="id"] .lang-id,
html[data-lang="bn"] .lang-bn,
html[data-lang="tr"] .lang-tr,
html.fallback-lang-en .lang-en {
  display: inline !important;
}

/* Ensure block-level elements display correctly instead of inline */
html[data-lang="en"] div.lang-en, html[data-lang="hi"] div.lang-hi, html[data-lang="de"] div.lang-de, html[data-lang="es"] div.lang-es, html[data-lang="fr"] div.lang-fr, html[data-lang="ar"] div.lang-ar, html[data-lang="pt"] div.lang-pt, html[data-lang="id"] div.lang-id, html[data-lang="bn"] div.lang-bn, html[data-lang="tr"] div.lang-tr, html.fallback-lang-en div.lang-en,
html[data-lang="en"] p.lang-en, html[data-lang="hi"] p.lang-hi, html[data-lang="de"] p.lang-de, html[data-lang="es"] p.lang-es, html[data-lang="fr"] p.lang-fr, html[data-lang="ar"] p.lang-ar, html[data-lang="pt"] p.lang-pt, html[data-lang="id"] p.lang-id, html[data-lang="bn"] p.lang-bn, html[data-lang="tr"] p.lang-tr, html.fallback-lang-en p.lang-en {
  display: block !important;
}

/* RTL Support for Arabic */
html[dir="rtl"] {
  text-align: right;
}
html[dir="rtl"] .header-search .search-icon {
  left: auto;
  right: 12px;
}
html[dir="rtl"] #header-search {
  padding-left: var(--space-4);
  padding-right: 40px;
}
html[dir="rtl"] .input-group .unit {
  left: auto;
  right: var(--space-4);
}
html[dir="rtl"] input[type="number"] {
  text-align: right;
}
html[dir="rtl"] .faq-question {
  flex-direction: row-reverse;
}
html[dir="rtl"] .faq-icon {
  margin-left: 0;
  margin-right: auto;
}

.currency-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-right: var(--space-2);
  outline: none;
  font-family: var(--font-family);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bg-secondary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 28px;
}

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

.currency-select:active {
  transform: scale(0.95);
}

[data-theme="dark"] .currency-select {
  border-color: var(--gray-700);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}


/* Scroll To Top Button */
.scroll-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  border: 1px solid rgba(255,255,255,0.1);
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.scroll-to-top:active {
  transform: translateY(0) scale(0.95);
}

.scroll-to-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   INTERACTIVE ENHANCEMENTS & ANIMATIONS
   ============================================ */

/* Sleek Glassmorphic Slider Tooltip / Value Bubble */
.slider-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.92); /* slate-900 with glass opacity */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(99, 102, 241, 0.4); /* soft glowing indigo border */
  color: #f8fafc;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -24px) scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.1s ease, top 0.1s ease;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.slider-tooltip.show {
  opacity: 1;
  transform: translate(-50%, -36px) scale(1);
}

.slider-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4.5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.92) transparent;
  display: block;
  width: 0;
}

[data-theme="dark"] .slider-tooltip {
  background: rgba(3, 7, 18, 0.95);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .slider-tooltip::after {
  border-color: rgba(3, 7, 18, 0.95) transparent;
}

/* Active Legend Hover Accent Alignment */
.legend-item {
  position: relative;
  padding-left: 14px;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-left: -14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.legend-item.active-legend-hover {
  border-left-color: var(--primary);
  padding-left: 18px;
  color: var(--primary);
  font-weight: 700;
  background: rgba(99, 102, 241, 0.04);
  transform: translateX(4px);
}

[data-theme="dark"] .legend-item.active-legend-hover {
  background: rgba(129, 140, 248, 0.08);
}

/* Focused Input Label Shift and Glows */
.input-group label {
  transition: all 0.25s ease;
}

.input-group:focus-within label {
  color: var(--primary);
  transform: translateX(4px);
}

.input-group .input-value input {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.input-group .input-value input:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(99, 102, 241, 0.06);
  border-color: var(--primary);
  transform: scale(1.02);
}

/* Bouncy Value Pulse on Count-up */
@keyframes valuePulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.06); filter: brightness(1.15); }
  100% { transform: scale(1); }
}

.pulse-active {
  animation: valuePulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}

/* Premium Card Overlays */
.result-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

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

.result-card.primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.result-card.primary:hover {
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
}

/* Ripple Click Effect */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.15;
  transform: scale(0);
  animation: rippleAnimation 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
  pointer-events: none;
}

.btn:not(.btn-outline):not(.btn-ghost) .ripple-effect,
.result-card.primary .ripple-effect,
.result-card.accent .ripple-effect {
  background: var(--white);
  opacity: 0.35;
}

@keyframes rippleAnimation {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Skeleton Loaders (Shimmering Placeholders) */
.skeleton {
  background: var(--bg-tertiary) !important;
  color: transparent !important;
  border-color: var(--border-light) !important;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  pointer-events: none;
}

.skeleton * {
  visibility: hidden !important;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 1.5s infinite;
  transform: translateX(-100%);
  visibility: visible !important;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Toast Spring Animation */
.toast {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease !important;
}

/* Page Glows and Premium Details */
.tool-card, .category-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--gray-700);
  border: 2px solid var(--bg-primary);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--gray-600);
}

/* ============================================
   TOP 1% ELITE VISUAL UX UPGRADES
   ============================================ */

/* Premium Slate/Grid Dotted Background Pattern */
body {
  background-image: radial-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

[data-theme="dark"] body {
  background-image: radial-gradient(rgba(129, 140, 248, 0.05) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}

/* Keyboard Shortcut Keycap Badge in Search Inputs */
.search-shortcut-key {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  font-family: monospace;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  transition: opacity 0.15s ease;
  z-index: 5;
}

/* Hide shortcut key badge on focus or input content */
.header-search input:focus ~ .search-shortcut-key,
.header-search input:not(:placeholder-shown) ~ .search-shortcut-key,
.hero-search input:focus ~ .search-shortcut-key,
.hero-search input:not(:placeholder-shown) ~ .search-shortcut-key {
  opacity: 0;
}

/* Haptic drag shadow pulse ring on Range Slider thumbs */
@keyframes thumbDragPulse {
  0% {
    box-shadow: 0 0 0 0px rgba(99, 102, 241, 0.35), 0 3px 8px rgba(99, 102, 241, 0.3);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(99, 102, 241, 0), 0 3px 8px rgba(99, 102, 241, 0.3);
  }
}

.range-slider.active-dragging::-webkit-slider-thumb {
  animation: thumbDragPulse 0.8s infinite linear;
}

.range-slider.active-dragging::-moz-range-thumb {
  animation: thumbDragPulse 0.8s infinite linear;
}

/* Fintech-grade Glossy reflection beam hover sweep on primary buttons */
@keyframes hoverShine {
  0% { transform: translateX(-100%) rotate(25deg); }
  100% { transform: translateX(200%) rotate(25deg); }
}

.btn-primary::before, .btn-accent::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: rgba(255, 255, 255, 0.13);
  transform: translateX(-100%) rotate(25deg);
  transition: none;
  pointer-events: none;
}

.btn-primary:hover::before, .btn-accent:hover::before {
  animation: hoverShine 0.85s ease-out;
}

/* Particle explosion on success copy click */
.particle-burst-container {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  width: 0;
  height: 0;
}

.burst-particle {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: particleExplode 0.75s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
}

@keyframes particleExplode {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.6));
  }
  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
    opacity: 0;
  }
}

/* ============================================
   PREMIUM ENTRANCE ANIMATIONS
   ============================================ */

/* Calculator slide-up entrance */
@keyframes calcSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.calculator {
  animation: calcSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered result card entrance */
@keyframes resultCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-card {
  animation: resultCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.18s; }
.result-card:nth-child(3) { animation-delay: 0.26s; }
.result-card:nth-child(4) { animation-delay: 0.34s; }

/* Tool hero text entrance */
@keyframes heroTextIn {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.tool-hero h1 {
  animation: heroTextIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.tool-hero .tool-description {
  animation: heroTextIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* Breadcrumb slide-in */
.breadcrumb {
  animation: heroTextIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0s both;
}

/* Input group stagger */
.input-group {
  animation: resultCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.input-group:nth-child(1) { animation-delay: 0.15s; }
.input-group:nth-child(2) { animation-delay: 0.22s; }
.input-group:nth-child(3) { animation-delay: 0.29s; }
.input-group:nth-child(4) { animation-delay: 0.36s; }

/* FAQ item stagger */
.faq-item {
  animation: resultCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.15s; }
.faq-item:nth-child(4) { animation-delay: 0.2s; }
.faq-item:nth-child(5) { animation-delay: 0.25s; }

/* Step card stagger */
.step-card {
  animation: resultCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.step-card:nth-child(1) { animation-delay: 0.1s; }
.step-card:nth-child(2) { animation-delay: 0.2s; }
.step-card:nth-child(3) { animation-delay: 0.3s; }

/* ============================================
   PRINT AND PDF STYLESHEET
   ============================================ */
@media print {
  /* Hide unnecessary layout components */
  .header,
  .footer,
  .sidebar,
  .ad-slot,
  .intro-section,
  .how-to-use,
  .faq-section,
  .related-tools,
  .result-actions,
  .mobile-search-overlay,
  .scroll-to-top,
  .search-shortcut-key,
  .breadcrumb,
  #export-pdf-btn,
  .range-slider,
  .slider-labels,
  .slider-tooltip {
    display: none !important;
  }

  /* Reset layout structure for full page width */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    margin: 0;
    padding: 0;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .page-with-sidebar {
    display: block !important;
  }

  .page-main {
    width: 100% !important;
    padding: 0 !important;
  }

  /* Style the tool header for a formal report */
  .tool-hero {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
  }

  .tool-hero h1 {
    color: #1e293b !important;
    font-size: 22pt !important;
    margin-bottom: 0.5rem;
  }

  .tool-hero .tool-description {
    color: #64748b !important;
    font-size: 10pt !important;
  }

  /* Calculator grid side-by-side or stacked layout */
  .calculator {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    animation: none !important;
  }

  .calculator-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
  }

  /* Format inputs side to look like a summary list */
  .calculator-inputs {
    gap: 1.2rem !important;
  }

  .input-group {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 0.5rem;
    animation: none !important;
  }

  .input-group .input-header {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .input-group .input-header label {
    font-weight: 600;
    color: #334155;
    font-size: 10pt;
  }

  .input-value {
    display: flex;
    align-items: center;
    border: none !important;
    background: none !important;
    padding: 0 !important;
  }

  .input-value input[type="number"] {
    border: none !important;
    background: none !important;
    color: #000000 !important;
    font-weight: 700;
    font-size: 11pt;
    text-align: right;
    width: auto !important;
    max-width: 120px;
    padding: 0 !important;
    box-shadow: none !important;
  }

  /* Hide input arrow controls in print */
  .input-value input[type="number"]::-webkit-outer-spin-button,
  .input-value input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .input-value input[type="number"] {
    -moz-appearance: textfield;
  }

  .input-value .unit {
    font-weight: 700;
    color: #334155;
    margin-left: 4px;
    font-size: 10pt;
  }

  /* Format results cards */
  .calculator-results {
    gap: 0.75rem !important;
  }

  .result-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    animation: none !important;
  }

  .result-card.primary {
    background: #f1f5f9 !important;
    border: 2px solid #cbd5e1 !important;
  }

  .result-card .result-label {
    color: #475569 !important;
    font-weight: 600;
    font-size: 9pt;
  }

  .result-card .result-value {
    color: #0f172a !important;
    font-size: 16pt !important;
    font-weight: 800;
  }

  /* Format charts */
  .chart-container {
    max-width: 160px;
    max-height: 160px;
    margin: 0.5rem auto;
    page-break-inside: avoid;
  }
  
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Format Amortization tables if they exist */
  .amortization-section, .faq-section {
    margin-top: 2rem;
    page-break-before: auto;
  }
  
  .faq-section {
    display: none !important; /* hide FAQs in print */
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 1rem;
  }

  th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 6px 8px !important;
    font-size: 8.5pt !important;
    text-align: left;
  }

  td {
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 5px 8px !important;
    font-size: 8.5pt !important;
    color: #334155 !important;
  }

  tr:nth-child(even) {
    background: #f8fafc !important;
  }

  /* Add a formal report footer for print only */
  body::after {
    content: "Generated dynamically via ToolPixa (https://toolpixa.space). All calculations are illustrative and subject to terms.";
    display: block;
    text-align: center;
    font-size: 7.5pt;
    color: #94a3b8;
    margin-top: 2.5rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
  }
}


