﻿:root {
  color-scheme: light dark;
}

body {
  background: linear-gradient(130deg, #f8fbff 0%, #eaf4ff 45%, #f8f5ff 100%);
}

.dark body,
html.dark body {
  background: linear-gradient(130deg, #050a12 0%, #0a1424 45%, #0f1b2e 100%);
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 125, 184, 0.18), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(48, 88, 218, 0.12), transparent 30%),
    radial-gradient(circle at 30% 90%, rgba(12, 76, 122, 0.1), transparent 35%);
}

.card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

html.dark .card {
  border-color: rgba(71, 85, 105, 0.5);
  background: rgba(2, 6, 23, 0.8);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.4);
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border-radius: 0.75rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.nav-tab {
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  transition: all 0.18s ease;
}

html.dark .nav-tab {
  border-color: rgba(100, 116, 139, 0.7);
  background: rgba(30, 41, 59, 0.68);
  color: #e2e8f0;
}

.nav-tab:hover,
.nav-tab.active {
  border-color: rgba(15, 125, 184, 0.8);
  background: rgba(15, 125, 184, 0.12);
}

html.dark .nav-tab:hover,
html.dark .nav-tab.active {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.22);
  color: #f8fafc;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  width: 2.25rem;
  height: 2.25rem;
  color: inherit;
  transition: all 0.18s ease;
}

.icon-link:hover {
  border-color: rgba(15, 125, 184, 0.8);
  color: #0f7db8;
}

html.dark .icon-link {
  border-color: rgba(148, 163, 184, 0.75);
  color: #e2e8f0;
}

html.dark .icon-link:hover {
  border-color: rgba(56, 189, 248, 0.9);
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.18);
}

@media (max-width: 1023px) {
  .mobile-tool-panel {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 360px);
    max-width: 360px;
    z-index: 45;
    border-radius: 0;
    overflow-y: auto;
    margin: 0;
  }

  .mobile-tool-panel.open {
    display: block;
  }

  .mobile-tool-overlay {
    display: none;
    position: fixed;
    inset: 0;
    border: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.48);
  }

  .mobile-tool-overlay.open {
    display: block;
  }
}

.btn-primary {
  background: #0f7db8;
  color: #fff;
}

.btn-primary:hover {
  background: #0b638f;
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
}

html.dark .btn-secondary {
  border-color: rgba(100, 116, 139, 0.7);
  background: rgba(51, 65, 85, 0.92);
  color: #f8fafc;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 0.75rem;
  padding: 0.7rem 0.9rem;
  text-align: left;
  width: 100%;
  transition: all 0.18s ease;
}

.tool-link:hover,
.tool-link.active {
  border-color: rgba(15, 125, 184, 0.75);
  background: rgba(15, 125, 184, 0.1);
}

html.dark .tool-link {
  border-color: rgba(100, 116, 139, 0.72);
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
}

html.dark .tool-link:hover,
html.dark .tool-link.active {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.2);
  color: #f8fafc;
}

.field,
textarea,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.9);
}

html.dark textarea,
html.dark select,
html.dark input,
html.dark .field {
  border-color: rgba(100, 116, 139, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
}

textarea {
  min-height: 190px;
}

.tool-fade {
  animation: fadeIn 0.25s ease;
}

.footer-link {
  color: #0b638f;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.footer-link:hover {
  color: #0f7db8;
  text-decoration-thickness: 2px;
}

html.dark .footer-link {
  color: #7dd3fc;
}

html.dark .footer-link:hover {
  color: #bae6fd;
}

.stats-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-box {
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 0.75rem;
  padding: 0.8rem;
  background: rgba(248, 250, 252, 0.75);
}

html.dark .stat-box {
  border-color: rgba(100, 116, 139, 0.55);
  background: rgba(15, 23, 42, 0.8);
}

/* Accessibility: enforce readable dark-theme text contrast for utility classes */
html.dark .text-slate-900 {
  color: #f8fafc !important;
}

html.dark .text-slate-700 {
  color: #dbeafe !important;
}

html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-500 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-400 {
  color: #d1d5db !important;
}

html.dark .text-slate-300 {
  color: #e2e8f0 !important;
}

/* Accessibility hardening for dark-mode surfaces */
html.dark header {
  background: rgba(2, 6, 23, 0.94) !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
}

html.dark footer {
  background: rgba(2, 6, 23, 0.94) !important;
  border-color: rgba(51, 65, 85, 0.9) !important;
}

html.dark footer p,
html.dark footer a {
  color: #dbeafe !important;
}

html.dark footer a:hover {
  color: #e0f2fe !important;
}

html.dark .tool-card {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(100, 116, 139, 0.85) !important;
  color: #f8fafc !important;
}

html.dark .tool-card:hover {
  border-color: rgba(56, 189, 248, 0.9) !important;
  background: rgba(30, 41, 59, 0.95) !important;
}

html.dark .tool-card .text-slate-600,
html.dark .tool-card .text-slate-300 {
  color: #cbd5e1 !important;
}

html.dark #tool-panel .text-slate-600,
html.dark #tool-panel .text-slate-300,
html.dark #tool-panel .text-slate-500 {
  color: #cbd5e1 !important;
}

html.dark #tool-panel {
  background: rgba(2, 6, 23, 0.92) !important;
  border-color: rgba(71, 85, 105, 0.75) !important;
}

.hero-badge {
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(241, 245, 249, 0.96);
  color: #1e293b;
}

html.dark .hero-badge {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(51, 65, 85, 0.96);
  color: #f8fafc;
}

/* Accessibility: visible focus styles for keyboard users */
:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.95);
  outline-offset: 2px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

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