/* ================================
   CSS PART 1 — VARIABLES + GLOBAL
================================ */

/* Root Theme Variables */
:root {
  --bg: #f5f7fb;
  --bg-alt: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --border: #e5e7eb;
  --card-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

/* Dark Theme */
html[data-theme="dark"] {
  --bg: #020617;
  --bg-alt: #020617;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --primary: #60a5fa;
  --primary-soft: rgba(96, 165, 250, 0.1);
  --border: #1f2937;
  --card-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
}

/* Reset + Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 60%), var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ================================
   HEADER + LOGO + NAV (ICONS NAV)
================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .site-header {
  background: rgba(2, 6, 23, 0.8);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 10% 0, #60a5fa, #2563eb);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
}

.logo-text span {
  color: var(--primary);
}

/* NAV BAR */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow-x: auto;
  white-space: nowrap;
}

html[data-theme="dark"] .site-nav {
  background: rgba(15, 23, 42, 0.6);
}

/* Scrollbar for nav */
.site-nav::-webkit-scrollbar {
  height: 4px;
}
.site-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

/* Nav Item */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  opacity: 0.85;
}

.nav-icon {
  font-size: 1rem;
}

.nav-link:hover {
  background: rgba(148, 163, 184, 0.15);
  opacity: 1;
}

/* ACTIVE PAGE */
.nav-link.active {
  background: radial-gradient(circle at top, var(--primary), #1d4ed8);
  color: white;
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.6);
  opacity: 1;
}

/* THEME TOGGLE BUTTON */
.theme-toggle {
  padding: 0.45rem 0.75rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--bg-alt);
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--primary-soft);
}
/* ================================
   HERO SECTION
================================ */

.hero {
  padding: 3.5rem 0 2.5rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 3vw + 1rem, 3.1rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-text p {
  color: var(--text-muted);
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* HERO SIDEBAR CARD */
.hero-card {
  background: var(--bg-alt);
  border-radius: 1.5rem;
  padding: 1.7rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--card-shadow);
}

.hero-card h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.mini-loan-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.mini-loan-form input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
}

.mini-result {
  margin-top: 0.7rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ================================
   BUTTONS
================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.35rem;
  font-size: 0.95rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s ease;
  font-weight: 500;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  color: #fff;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.45);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.55);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.ghost:hover {
  background: rgba(148, 163, 184, 0.15);
}

.btn.small {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn.full-width {
  width: 100%;
}

/* ================================
   SECTION LAYOUT
================================ */

.section {
  padding: 2.8rem 0;
}

.section-alt {
  background: linear-gradient(to bottom, rgba(148,163,184,0.08), transparent);
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 40rem;
  font-size: 1rem;
}

/* ================================
   TOOL CARDS GRID
================================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.3rem;
  margin-top: 1.5rem;
}

.tool-card {
  background: var(--bg-alt);
  border-radius: 1.4rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.tool-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.tool-card p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tool-card.disabled {
  opacity: 0.55;
}

/* BLOG CARDS */
.blog-grid .blog-card {
  background: var(--bg-alt);
  border-radius: 1.2rem;
  padding: 1.3rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--card-shadow);
}

.blog-card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.blog-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.text-link {
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* ================================
   TOOL PAGE LAYOUT
================================ */

.tool-hero {
  padding: 2.5rem 0 1.5rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 2rem;
  align-items: flex-start;
}

/* FORM BOX */
.tool-form {
  background: var(--bg-alt);
  padding: 1.6rem 1.4rem;
  border-radius: 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--card-shadow);
}

.tool-form label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.tool-form input,
.tool-form select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-top: 0.25rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
  font-size: 0.95rem;
}

.tool-form input:focus,
.tool-form select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 1px;
}

.disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* RESULTS PANEL */
.tool-results {
  background: var(--bg-alt);
  padding: 1.6rem 1.4rem;
  border-radius: 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: var(--card-shadow);
}

.tool-results h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.result-row span {
  color: var(--text-muted);
}

.result-row strong {
  font-weight: 600;
}

/* SUMMARY BOX */
.summary-box {
  margin-top: 1rem;
  padding: 1rem 1rem;
  background: var(--primary-soft);
  border-radius: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ================================
   FOOTER
================================ */

.site-footer {
  padding: 1.4rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-nav {
  display: flex;
  gap: 0.9rem;
}

.footer-nav a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ================================
   RESPONSIVE LAYOUT
================================ */

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-card {
    margin-top: 1rem;
  }
}

@media (max-width: 900px) {
  .site-nav {
    display: none; /* simplify header on mobile */
  }
}

@media (max-width: 768px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-card,
  .tool-form,
  .tool-results {
    border-radius: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.9rem;
  }

  .tool-form input,
  .tool-form select {
    font-size: 0.88rem;
  }

  .btn {
    font-size: 0.88rem;
  }
}
/* Top Site Navigation */
.primary-nav {
  display: flex;
  gap: 1.2rem;
  font-size: 0.9rem;
  align-items: center;
}

.primary-link {
  color: var(--text-muted);
  text-decoration: none;
}

.primary-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.top-menu {
  justify-content: space-between;
  padding-bottom: 0.4rem;
}

/* ============================
   MOBILE NAV BAR FIXES
============================ */

/* Hide menu button on desktop */
.mobile-menu-btn {
  font-size: 1.6rem;
  border: none;
  background: transparent;
  display: none;
  cursor: pointer;
  color: var(--text);
}

/* Mobile menu container */
#primaryNav {
  display: flex;
  gap: 1rem;
}

@media (max-width: 900px) {

  .mobile-menu-btn {
    display: block;
  }

  /* Collapse primary nav by default */
  #primaryNav {
    display: none;
    flex-direction: column;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    margin-top: 0.5rem;
  }

  /* Show menu when active */
  #primaryNav.active {
    display: flex;
  }

  /* Style links inside mobile menu */
  .primary-nav .primary-link {
    padding: 0.6rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  /* Theme toggle stays right */
  .theme-toggle {
    margin-left: auto;
  }

  /* Tools nav becomes horizontal scroll only */
  .site-nav {
    overflow-x: auto;
    padding: 0.5rem;
  }
}

/* ============================
   MOBILE FIXES FOR TOOLS NAV
============================ */

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: 1rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.6) transparent;
}

/* Chrome/Edge scroll styling */
.site-nav::-webkit-scrollbar {
  height: 6px;
}
.site-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

@media (max-width: 900px) {

  /* Increase spacing between nav items */
  .site-nav .nav-link {
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    border-radius: 1rem;
  }

  /* Make nav float under logo cleanly */
  .header-inner .site-nav {
    margin-top: 0.6rem;
  }

  /* Add soft background for mobile */
  .site-nav {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148,163,184,0.2);
  }

  html[data-theme="dark"] .site-nav {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(148,163,184,0.1);
  }
}

