/* =========================================
   1. VARIABLES & RESET (CRITICAL SECTION)
   ========================================= */
:root {
  /* This defines the variables. If this is missing, colors break. */
  --primary: #2c3e50;  /* Dark Blue */
  --accent: #27ae60;   /* Green */
  --bg: #f4f7f6;       /* Light Grey Background */
  --white: #ffffff;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  margin: 0;
  padding: 0;
  color: #333;
}

/* =========================================
   2. NAVIGATION BAR
   ========================================= */
.navbar {
  background: var(--white);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo {
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary); /* Uses the variable here */
  font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--accent);
}

/* =========================================
   3. SHARED LAYOUT (Calculator Pages)
   ========================================= */
.main-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 40px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.calculator-card, .chart-card {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  flex: 1;
  min-width: 300px;
}

/* Inputs */
.input-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

button {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 15px;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s;
}
button:hover { background: #219150; }

/* Results */
.results-area {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.result-box h2 { margin: 5px 0 0 0; }

/* Content Article (SEO Text) */
.content-article {
  max-width: 800px;
  margin: 0 auto 50px auto;
  padding: 0 5%;
  line-height: 1.8;
}

.ad-placeholder {
  background: #eee;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: #999;
  border: 1px dashed #ccc;
}

/* =========================================
   4. HUB PAGE STYLES (calculators.html)
   ========================================= */
.hub-header {
  background: white;
  text-align: center;
  padding: 60px 20px;
  border-bottom: 1px solid #eee;
  margin-bottom: 40px;
}
.hub-header h1 { margin: 0; color: var(--primary); font-size: 2.5rem; }
.hub-header p { color: #666; margin-top: 10px; font-size: 1.1rem; }

.category-title {
  width: 100%;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin: 40px 0 20px 0;
  color: var(--primary);
  font-size: 1.4rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  width: 100%;
}

.tool-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.04);
  text-decoration: none;
  color: #333;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border-color: var(--accent);
}

.tool-card .icon { font-size: 3rem; margin-bottom: 15px; }
.tool-card h3 { margin: 0 0 10px 0; color: var(--primary); }
.tool-card p { font-size: 0.95rem; color: #666; line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }

.btn-text {
  font-weight: bold;
  color: var(--accent);
  margin-top: auto;
}

/* =========================================
   5. FOOTER & MOBILE
   ========================================= */
footer {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 40px 20px;
  margin-top: 50px;
}
.footer-links a { color: #fff; text-decoration: none; margin: 0 10px; }
.disclaimer { font-size: 0.8rem; opacity: 0.7; margin-top: 20px; }

@media (max-width: 768px) {
  .main-container { flex-direction: column; }
  .nav-links { display: none; } /* In a real site, you'd add a hamburger menu */
}