/* =========================
RESET & BASE (optimized)
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  }

html {
-webkit-text-size-adjust: 100%;
}

img {
max-width: 100%;
height: auto;
display: block;
}

body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: #f4f7fb;
color: #333;
scroll-behavior: smooth;
transition: background 0.25s ease, color 0.25s ease;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

/* =========================
NAVBAR (performance tuned)
========================= */

.navbar {
background: #111827;
min-height: 90px;
padding: 12px 40px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 12px;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: 0 4px 10px rgba(0,0,0,0.08);
backdrop-filter: saturate(140%) blur(6px);
}

.logo {
display: flex;
align-items: center;
}

.logo img {
height: 80px;
width: auto;
object-fit: contain;
}

.nav-links {
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

.nav-links a {
color: #fff;
text-decoration: none;
font-weight: 500;
transition: color 0.2s ease;
}

.nav-links a:hover {
color: #60a5fa;
}

.theme-btn {
background: #fff;
border: none;
padding: 8px 14px;
border-radius: 20px;
cursor: pointer;
font-size: 14px;
transition: transform 0.2s ease;
}

.theme-btn:hover {
transform: scale(1.06);
}

/* =========================
HERO SECTION (LCP optimized)
========================= */

.hero {
text-align: center;
padding: 90px 20px;
background: linear-gradient(135deg, #2563eb, #1e3a8a);
color: #fff;
min-height: 260px;
}

.hero h1 {
font-size: clamp(28px, 5vw, 42px);
margin-bottom: 14px;
letter-spacing: -0.3px;
}

.hero p {
font-size: clamp(15px, 2.5vw, 18px);
opacity: 0.92;
}

.hero button {
margin-top: 24px;
padding: 12px 28px;
border: none;
border-radius: 30px;
background: #fff;
color: #1e3a8a;
font-weight: 700;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero button:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* =========================
PAGE CONTAINER
========================= */

.page-container {
padding: 50px 20px;
display: flex;
justify-content: center;
}

.about-card {
width: 100%;
max-width: 900px;
background: #fff;
padding: 40px 36px;
border-radius: 18px;
box-shadow: 0 10px 30px rgba(0,0,0,0.07);
line-height: 1.75;
}

.about-card h1 {
margin-bottom: 18px;
}

.about-card h2 {
margin-top: 28px;
margin-bottom: 10px;
}

.about-card p {
margin-bottom: 16px;
}

.about-card ul {
margin: 12px 0 20px 20px;
}

/* =========================
SEARCH BOX
========================= */

.search-box {
text-align: center;
margin-top: 50px;
padding: 0 16px;
}

.search-box input {
width: min(420px, 100%);
padding: 12px 18px;
border-radius: 30px;
border: 1px solid #ccc;
outline: none;
font-size: 14px;
transition: all 0.2s ease;
}

.search-box input:focus {
border-color: #2563eb;
box-shadow: 0 0 10px rgba(37,99,235,0.22);
}

/* =========================
TOOL GRID (paint optimized)
========================= */

.tool-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 24px;
padding: 56px 24px;
max-width: 1200px;
margin: auto;
}

.tool-card {
background: #fff;
padding: 28px;
border-radius: 16px;
text-align: center;
text-decoration: none;
color: #111;
font-weight: 600;
transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
box-shadow: 0 10px 22px rgba(0,0,0,0.07);
border: 1px solid rgba(0,0,0,0.05);
position: relative;
overflow: hidden;
will-change: transform;
}

.tool-card:hover {
transform: translateY(-5px);
box-shadow: 0 18px 38px rgba(0,0,0,0.14);
background: #eff6ff;
}

/* =========================
FORM ELEMENTS
========================= */

.tool-desc {
color: #6b7280;
margin-bottom: 25px;
font-weight: 400;
}

.tool-card input,
.tool-card select {
width: 100%;
padding: 13px;
border-radius: 10px;
border: 1px solid #e5e7eb;
font-size: 15px;
transition: border 0.2s ease, box-shadow 0.2s ease;
margin-bottom: 12px;
}

.tool-card input:focus,
.tool-card select:focus {
outline: none;
border-color: #6366f1;
box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Button */

.primary-btn {
width: 100%;
padding: 14px;
margin-top: 8px;
background: linear-gradient(135deg, #6366f1, #4f46e5);
color: #fff;
border: none;
border-radius: 12px;
font-weight: 600;
cursor: pointer;
letter-spacing: 0.3px;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
transform: translateY(-1px);
box-shadow: 0 8px 18px rgba(79,70,229,0.25);
}

.primary-btn:active {
transform: scale(0.97);
}

/* =========================
RESULT ANIMATION — ALPHA+
========================= */

.result-box {
margin-top: 22px;
font-weight: 700;
font-size: 20px;
color: #111827;
opacity: 0;
transform: translateY(10px) scale(0.98);
transition: all 0.3s ease;

/* visual polish */
background: linear-gradient(135deg, #eef2ff, #f8fafc);
border-radius: 14px;
padding: 18px 20px;
border: 1px solid #e5e7eb;
}

.result-box.show {
opacity: 1;
transform: translateY(0) scale(1);
}

.result-box.success {
animation: resultGlow 0.6s ease;
}

.result-box div {
margin-bottom: 6px;
font-weight: 600;
font-size: 17px;
}

.result-box .tax-highlight {
color: #dc2626;
font-size: 22px;
font-weight: 800;
}

.result-box .takehome-highlight {
color: #059669;
font-size: 20px;
font-weight: 800;
}

@keyframes resultGlow {
0% { box-shadow: 0 0 0 rgba(79,70,229,0); }
50% { box-shadow: 0 0 20px rgba(79,70,229,0.25); }
100% { box-shadow: 0 0 0 rgba(79,70,229,0); }
}

/* =========================
EXEMPTION BOX
========================= */

.exemption-box {
margin-top: 16px;
padding: 14px 16px;
border-radius: 12px;
background: #f9fafb;
border: 1px dashed #c7d2fe;
font-size: 14px;
line-height: 1.6;
}

.exemption-box strong {
color: #4f46e5;
display: block;
margin-bottom: 6px;
}

/* =========================
FOOTER
========================= */

footer {
text-align: center;
padding: 25px;
background: #111827;
color: #fff;
margin-top: 40px;
font-size: 14px;
}

/* =========================
DARK MODE
========================= */

.dark-mode {
background: #0f172a;
color: #e2e8f0;
}

.dark-mode .navbar,
.dark-mode footer {
background: #020617;
}

.dark-mode .tool-card,
.dark-mode .about-card {
background: #1e293b;
color: #f1f5f9;
border-color: rgba(255,255,255,0.06);
}

.dark-mode .tool-card:hover {
background: #334155;
}

.dark-mode .result-box {
background: linear-gradient(135deg, #1e293b, #0f172a);
border-color: rgba(255,255,255,0.08);
}

.dark-mode .exemption-box {
background: #0f172a;
border-color: rgba(99,102,241,0.4);
}

/* =========================
CODE ALPHA ANIMATIONS
========================= */

.fade-in-up {
opacity: 0;
transform: translateY(30px);
animation: fadeUp 0.65s ease forwards;
}

@keyframes fadeUp {
to {
opacity: 1;
transform: translateY(0);
}
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

/* =========================
MOBILE — MAJOR FIX
========================= */

@media (max-width: 768px) {

.navbar {
min-height: auto;
padding: 10px 16px;
}

.logo img {
height: 56px;
}

.hero {
padding: 60px 16px;
}

.tool-list {
padding: 36px 16px;
gap: 18px;
}

.tool-card {
padding: 22px;
}

.about-card {
padding: 26px 20px;
}

.page-container {
padding: 28px 14px;
}
}
/* =========================
   DARK MODE — RESULT VISIBILITY FIX
========================= */

/* Make result text bright in dark mode */
.dark-mode .result-box {
  color: #f1f5f9; /* light text */
}

/* Labels inside result */
.dark-mode .result-box div {
  color: #e2e8f0;
}

/* Tax highlight stays visible */
.dark-mode .tax-highlight {
  color: #f87171; /* softer red for dark bg */
}

/* Take home highlight */
.dark-mode .takehome-highlight {
  color: #34d399; /* bright green */
}

/* Exemption box readability */
.dark-mode .exemption-box {
  color: #e2e8f0;
}

/* Optional: slightly stronger background contrast */
.dark-mode .result-box {
  background: linear-gradient(135deg, #1e293b, #020617);
}
/* ===== AI BLOG ===== */

.loader {
  margin-top: 16px;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-color),
    transparent
  );
  animation: loadingBar 1.2s infinite;
  border-radius: 10px;
}

@keyframes loadingBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.result-card {
  margin-top: 20px;
  padding: 22px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  line-height: 1.8;
  white-space: pre-line;
  font-size: 15px;
}

/* Dark mode visibility fix */
[data-theme="dark"] .result-card {
  background: #1e293b;
  color: #e5e7eb;
}

/* =========================
   AI INSIGHT BOX
========================= */

.ai-insight {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f7ff, #f8fbff);
  border: 1px solid rgba(0, 123, 255, 0.15);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeInUp 0.4s ease;
}

.ai-icon {
  font-size: 1.2rem;
}

.ai-text {
  flex: 1;
  color: var(--text-color);
}

/* Dark mode fix */
.dark-mode .ai-insight {
  background: linear-gradient(135deg, #1e293b, #020617);
  border-color: rgba(255,255,255,0.08);
}

.dark-mode .ai-text {
  color: #e2e8f0;
}

.hidden {
  display: none;
}

