/* =========================================================
   CalculatorFox Global Stylesheet
   Shared across all pages (calculators, legal, homepage)
   ========================================================= */

:root {
  --bg: #ffffff;
  --panel: #f8fafc;
  --accent: #DB8121;        /* primary fox orange */
  --accent-light: #F2A24A;  /* lighter fox orange (generated highlight) */
  --text: #111827;
  --muted: #6b7280;
  --radius: 16px;
}

/* ---------------------------
   Base Layout & Typography
---------------------------- */
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.7;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--text);
}

h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

h3 {
  font-size: 20px;
  margin-top: 30px;
  margin-bottom: 8px;
}

p, ul, li {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
  color: var(--accent-light);
}

/* ---------------------------
   Header & Navbar
---------------------------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px auto;
  max-width: 1100px;
  padding: 0 20px;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px !important;
  text-decoration: none;
  color: var(--text);
}

.brand-link {
  text-decoration: none !important;
  color: inherit;
}

.brand-link:hover,
.brand-link:focus,
.brand-link:active {
  text-decoration: none !important;
}

/* Clean logo box */
.logo {
  width: 64px !important;
  height: 64px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: none;
  flex-shrink: 0;
}

.logo img,
.logo svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text h1 {
  font-size: 22px;
  margin: 0 0 2px 0;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.brand-text small {
  font-size: 13px;
  color: var(--muted);
  margin-top: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: 40px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
nav a:hover {
  color: var(--accent);
}

/* --------------------------------------------------------
   🔥 NEW — Navbar Search Bar Styles
--------------------------------------------------------- */
.nav-search {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.nav-search input {
  width: 100%;
  max-width: 350px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 15px;
  transition: all .2s ease;
}

.nav-search input:focus {
  border-color: #DB8121;
  box-shadow: 0 0 0 3px rgba(219,129,33,0.25);
}

@media (max-width: 768px) {
  .nav-search {
    order: 3;
    width: 100%;
    padding: 10px 0 0 0;
  }

  .nav-search input {
    max-width: none;
    width: 100%;
  }
}

/* ---------------------------
   Global Containers
---------------------------- */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

/* ---------------------------
   Panels & Cards
---------------------------- */
.panel, .info-section, .related-box {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-bottom: 12px;
}

.info-section {
  padding-top: 20px;
}

.info-section *:not(h1):not(h2):not(h3):not(pre):not(code) {
  color: var(--muted) !important;
}

.related-box h3 {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-top: 0;
}

.related-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-links a {
  font-weight: 500;
}

/* ---------------------------
   Buttons
---------------------------- */
.btn {
  border: none;
  border-radius: 50px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 0px;
  margin-bottom: 16px;
}

/* ---------------------------
   Inputs / Textareas
---------------------------- */
textarea {
  width: 100%;
  min-height: 200px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 14px;
  margin-bottom: 20px;
  resize: vertical;
  box-sizing: border-box;
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-sizing: border-box;
  margin-bottom: 16px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(218, 128, 32, 0.45);
  outline: none;
}

label {
  display: block;
  font-weight: 600;
  color: #111827 !important;
  margin-bottom: 6px;
  font-size: 15px;
  letter-spacing: 0.2px;
}

label + input {
  margin-top: 2px;
  margin-bottom: 12px;
}

/* ---------------------------
   KPI Grid
---------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.kpi {
  background: #f1f5f9;
  padding: 18px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.kpi:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

.kpi .label {
  font-size: 14px;
  color: var(--muted);
}

.kpi .value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

/* ---------------------------
   Ad Spaces
---------------------------- */
.ad-space {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  height: 250px;
}

/* ---------------------------
   Footer
---------------------------- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
}

/* ---------------------------
   HERO Section
---------------------------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border-radius: 16px;
  padding: 60px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 20px;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #f8b567, #DB8121);
}

.hero h1 {
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 14px;
}

.hero p {
  font-size: 17px;
  color: #4b5563;
  max-width: 650px;
  margin: 0;
}

@media (max-width: 768px) {
  .hero {
    padding: 40px 24px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 15px;
  }
}

/* ---------------------------
   Grid Cards
---------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}

.card-link:hover .card {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 17px;
}

.card-link:hover .card-text {
  color: var(--accent-light);
}

.home h3 {
  padding-bottom: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid #F2B875;
}

/* ---------------------------
   Responsive Layout
---------------------------- */
@media (max-width: 800px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    gap: 20px;
    padding: 0 20px;
  }
  nav {
    gap: 20px;
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  .hero {
    padding: 30px 20px;
  }
}

/* ---------------------------
   Code Blocks
---------------------------- */
pre {
  background: #f8fafc;
  color: var(--text);
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  margin: 16px 0;
  white-space: pre-wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  position: relative;
}

pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 10px 0 0 10px;
}

pre strong {
  color: var(--accent);
}

/* ---------------------------
   Homepage Search
---------------------------- */
.search-container {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#searchInput {
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 0 0 3px transparent;
  transition: .2s;
}

#searchInput:focus {
  border-color: #DB8121;
  box-shadow: 0 0 0 3px rgba(219,129,33,.25);
}

#searchInput::placeholder {
  transition: .15s;
}

#searchInput:focus::placeholder {
  color: transparent;
}

#noResults {
  display: none;
  color: var(--muted);
  font-size: 15px;
  margin-top: 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.ad-space {
  height: 90px;
  line-height: 90px;
  font-size: 14px;
  margin: 30px 0;
}

/* ---------------------------
   Styled Dropdowns
---------------------------- */
.dropdown-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.dropdown-wrapper select {
  appearance: none;
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  border-radius: 12px;
  transition: .2s;
  cursor: pointer;
}

.dropdown-wrapper select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.dropdown-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* ---------------------------
   Mobile — center sidebar cards
---------------------------- */
@media (max-width: 800px) {
  .wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .wrap > *:first-child {
    width: 100% !important;
  }
  .ad-space,
  .related-box {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
  .related-links a {
    text-align: left !important;
    width: 100% !important;
  }
}
