/* MiniToolsFactory Global Technical Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html {
  color-scheme: light dark;
}

html.dark {
  color-scheme: dark;
}

html:not(.dark) {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* ==========================================================================
   THEME TOGGLE ICON CONTROLS
   ========================================================================== */
html.dark #theme-icon-sun,
html.dark .theme-icon-sun {
  display: block !important;
}
html.dark #theme-icon-moon,
html.dark .theme-icon-moon {
  display: none !important;
}

html:not(.dark) #theme-icon-sun,
html:not(.dark) .theme-icon-sun {
  display: none !important;
}
html:not(.dark) #theme-icon-moon,
html:not(.dark) .theme-icon-moon {
  display: block !important;
}

/* ==========================================================================
   DARK MODE STYLING (Default / .dark)
   ========================================================================== */
html.dark body {
  background-color: #020617;
  color: #f8fafc;
}

html.dark .bg-tech-grid,
html.dark body.bg-tech-grid {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

html.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ==========================================================================
   LIGHT MODE STYLING (Active when .dark is removed)
   ========================================================================== */
html:not(.dark) body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html:not(.dark) .bg-tech-grid,
html:not(.dark) body.bg-tech-grid {
  background-color: #f8fafc !important;
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.05) 1px, transparent 1px) !important;
}

/* Header in Light Mode */
html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) header nav a,
html:not(.dark) header a {
  color: #334155 !important;
}

html:not(.dark) header nav a:hover,
html:not(.dark) header a:hover {
  color: #059669 !important;
}

html:not(.dark) #theme-toggle-btn,
html:not(.dark) .theme-toggle-btn {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html:not(.dark) #theme-toggle-btn:hover,
html:not(.dark) .theme-toggle-btn:hover {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Primary Containers, Cards & Workspace in Light Mode */
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) #interactive-tool-card,
html:not(.dark) .tool-card-crafted {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .bg-slate-950\/80,
html:not(.dark) .bg-slate-950\/60,
html:not(.dark) .bg-slate-950\/40,
html:not(.dark) .bg-slate-900\/40,
html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-slate-800\/80,
html:not(.dark) .bg-slate-800\/50 {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Typography in Light Mode */
html:not(.dark) .text-white,
html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200 {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-300,
html:not(.dark) .text-slate-400 {
  color: #475569 !important;
}

html:not(.dark) .text-slate-500 {
  color: #64748b !important;
}

/* Borders in Light Mode */
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .border-slate-700\/50 {
  border-color: #e2e8f0 !important;
}

/* Form Controls & Inputs in Light Mode */
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

/* FAQ Details / Accordion in Light Mode */
html:not(.dark) details.faq-item,
html:not(.dark) details {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) details summary {
  color: #0f172a !important;
}

html:not(.dark) details p {
  color: #475569 !important;
}

/* Quick Answer BLUF Box in Light Mode */
html:not(.dark) #quick-answer,
html:not(.dark) .quick-answer-card,
html:not(.dark) .bluf-definition {
  background-color: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #0f172a !important;
}

html:not(.dark) #quick-answer p,
html:not(.dark) .quick-answer-card p {
  color: #1e293b !important;
}

/* Tables in Light Mode */
html:not(.dark) table {
  border-color: #e2e8f0 !important;
}

html:not(.dark) table th {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) table td {
  background-color: #ffffff !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) table tr:hover td {
  background-color: #f8fafc !important;
}

/* Footer in Light Mode */
html:not(.dark) footer {
  background-color: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
}

html:not(.dark) footer a {
  color: #475569 !important;
}

html:not(.dark) footer a:hover {
  color: #059669 !important;
}

html:not(.dark) ::-webkit-scrollbar-track {
  background: #f1f5f9;
}
html:not(.dark) ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
html:not(.dark) ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Focus and Accessible Outlines */
:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
