/* Toolenix Master Stylesheet - Universal Light & Dark High Contrast */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Base Light & Dark Body */
html:not(.dark) body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}
html.dark body {
  background-color: #020617 !important;
  color: #f8fafc !important;
}

/* Light Theme Universal Contrast Rules */
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4,
html:not(.dark) h5,
html:not(.dark) h6 {
  color: #0f172a !important;
}
html:not(.dark) .heading-text {
  color: #0f172a !important;
}

/* Force light mode readability on elements that have dark text classes */
html:not(.dark) .glass-card {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}
html.dark .glass-card {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  color: #f8fafc !important;
}

html:not(.dark) .tool-workspace {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05) !important;
}
html.dark .tool-workspace {
  background-color: #0b0f19 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4) !important;
}

/* Input Fields */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="number"],
html:not(.dark) input[type="email"],
html:not(.dark) input[type="time"],
html:not(.dark) input[type="date"],
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
html.dark input[type="text"],
html.dark input[type="number"],
html.dark input[type="email"],
html.dark input[type="time"],
html.dark input[type="date"],
html.dark select,
html.dark textarea {
  background-color: #0f172a !important;
  border: 1px solid #334155 !important;
  color: #f8fafc !important;
}

/* Header & Navigation */
html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
html.dark header {
  background-color: rgba(2, 6, 23, 0.85) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html:not(.dark) header nav a {
  color: #334155 !important;
}
html:not(.dark) header nav a:hover {
  color: #4f46e5 !important;
}
html:not(.dark) header .brand-text {
  color: #0f172a !important;
}

/* Footer */
html:not(.dark) footer {
  background-color: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #64748b !important;
}
html:not(.dark) footer .brand-text {
  color: #0f172a !important;
}
html:not(.dark) footer a {
  color: #64748b !important;
}
html:not(.dark) footer a:hover {
  color: #0f172a !important;
}

/* Category Accent Utility Classes */
.theme-amber { --accent-color: #d97706; }
.theme-blue { --accent-color: #2563eb; }
.theme-rose { --accent-color: #e11d48; }
.theme-emerald { --accent-color: #059669; }
.theme-teal { --accent-color: #0d9488; }
.theme-cyan { --accent-color: #0891b2; }
.theme-fuchsia { --accent-color: #c026d3; }
.theme-indigo { --accent-color: #4f46e5; }

/* Bulletproof Result Box & Number Overflow Containment */
.tool-workspace .grid > div,
.tool-workspace [class*="rounded-xl"],
.tool-workspace [class*="rounded-2xl"],
.glass-card,
.stat-card {
  min-width: 0 !important;
}

.tool-workspace span[id^="res-"],
.tool-workspace span[id^="smp-"],
.tool-workspace span[id^="sl-"],
.tool-workspace span[id^="ct-"],
.tool-workspace span[id^="cgt-"],
.tool-workspace span[id^="iht-"],
.tool-workspace span[id^="pen-"],
.tool-workspace span[id^="div-"],
.tool-workspace span[id^="corp-"],
.tool-workspace span[id^="ssp-"],
.tool-workspace span[id^="k-"],
.tool-workspace span[id^="ot-"],
.tool-workspace span[id^="se-"],
.tool-workspace span[id^="hsa-"],
.tool-workspace span[id^="dti-"],
.tool-workspace span[id^="lb-"],
.tool-workspace span[id^="tip-"],
.tool-workspace span[id^="cl-"],
.tool-workspace span[id^="usc-"],
.tool-workspace span[id^="gt-"],
.tool-workspace span[id^="fba-"],
.tool-workspace span[id^="et-"],
.tool-workspace span[id^="eb-"],
.tool-workspace span[id^="pm-"],
.tool-workspace span[id^="sp-"],
.tool-workspace span[id^="pod-"],
.tool-workspace span[id^="dc-"],
.tool-workspace span[id^="rc-"],
.tool-workspace span[id^="td-"],
.tool-workspace span[id^="fc-"],
.tool-workspace span[id^="ev-"],
.tool-workspace span[id^="bac-"],
.tool-workspace span[id^="fl-"],
.tool-workspace span[id^="pet-"] {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem) !important;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .tool-workspace span[class*="font-mono"] {
    font-size: 1.15rem !important;
  }
}
/* Toolenix Responsive Mobile & Tablet Layout Engine */

/* No Scrollbar Utility for Category Carousels */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* Mobile Header Safety & Layout */
header.site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
}

/* Fix mobile touch target sizes & padding */
@media (max-width: 640px) {
  .hero-heading {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }
  
  .tool-workspace {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }
  
  .glass-card {
    padding: 1rem !important;
    border-radius: 1rem !important;
  }
  
  /* Mobile table responsiveness */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  th, td {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
}

/* Tablet Optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .hero-heading {
    font-size: 2.75rem !important;
    line-height: 1.2 !important;
  }
  
  .tool-workspace {
    padding: 1.5rem !important;
  }
}

/* ===== Dark Theme Attraction Polish (2026-10-13) ===== */
/* Ambient gradient mesh instead of flat dark */
html.dark body {
  background:
    radial-gradient(1200px 600px at 15% -5%, rgba(99, 102, 241, 0.12), transparent 60%),
    radial-gradient(1000px 500px at 85% 10%, rgba(168, 85, 247, 0.10), transparent 60%),
    radial-gradient(900px 500px at 50% 110%, rgba(16, 185, 129, 0.06), transparent 60%),
    #020617 !important;
  background-attachment: fixed;
}

/* Richer glass cards with depth */
html.dark .glass-card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88)) !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}
html.dark .glass-card:hover {
  box-shadow: 0 12px 32px -8px rgba(99, 102, 241, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* Tool workspace depth */
html.dark .tool-workspace {
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98)) !important;
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Header richness */
html.dark header {
  background: rgba(2, 6, 23, 0.78) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.5) !important;
}

/* Primary buttons glow */
html.dark .btn-primary {
  box-shadow: 0 4px 16px -4px rgba(99, 102, 241, 0.5) !important;
}
html.dark .btn-primary:hover {
  box-shadow: 0 6px 24px -4px rgba(99, 102, 241, 0.7) !important;
}

/* Accent icon tiles pop */
html.dark .glass-card .rounded-xl.bg-rose-500\/10,
html.dark .glass-card .rounded-xl[class*="bg-"][class*="-500/10"] {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
