:root {
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fbbf24;
  --bg: #fffbeb;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--primary-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* Navigation */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand svg { width: 28px; height: 28px; }

.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--primary-dark); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: 0.3s; }

/* Hero Section */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--text); }
.hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.tool-card p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.tool-card .card-icon { font-size: 2rem; margin-bottom: 1rem; }

.tool-card .btn {
  margin-top: 1.5rem;
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: background 0.2s;
}

.tool-card .btn:hover { background: var(--primary-dark); color: #fff; }

/* Calculator Form Styles */
.calc-container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.calc-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.1);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.btn-calculate {
  width: 100%;
  padding: 0.9rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-calculate:hover { background: var(--primary-dark); }

/* Result Box */
.result-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  display: none;
}

.result-box.show { display: block; }
.result-box h3 { color: #065f46; margin-bottom: 0.75rem; }
.result-box .result-value { font-size: 2rem; font-weight: 700; color: #047857; }
.result-box .result-detail { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9rem; }

/* Blog List */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.blog-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.blog-card p { color: var(--text-muted); font-size: 0.88rem; }

/* Blog Article */
.article { max-width: 750px; margin: 2rem auto; padding: 0 1.5rem; }
.article h1 { font-size: 2rem; margin-bottom: 1rem; }
.article h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; color: var(--primary-dark); }
.article h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.article p { margin-bottom: 1rem; }
.article ul, .article ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.article li { margin-bottom: 0.5rem; }
.article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article th, .article td { padding: 0.75rem; border: 1px solid var(--border); text-align: left; }
.article th { background: var(--bg); font-weight: 600; }

/* Footer */
.footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary-dark); }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
