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

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f4f7fb;
  color: #1e293b;
  line-height: 1.6;
}

/* ===== CONTAINER ===== */
.container {
  width: 92%;
  max-width: 1100px;
  margin: auto;
}

/* ===== NAVBAR ===== */
.navbar {
  background: #0f172a;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  gap: 12px;
}

.logo {
  color: white;
  font-size: 20px;
  font-weight: bold;
  flex-shrink: 0;
  line-height: 0;
}

/* ✅ FIX: Limit logo image size on mobile so Menu button is never pushed out */
.logo img {
  height: 44px;
  width: auto;
  max-width: 220px;
  display: block;
}

/* Desktop nav links */
nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  transition: 0.2s;
  white-space: nowrap;
}

nav a.active,
nav a:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  width: auto;
  margin-top: 0;
  color: white;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}

/* Hamburger animation when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  display: none;
  background: #1e293b;
  padding: 8px 0 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  transition: 0.2s;
  border-left: 3px solid transparent;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: white;
  background: rgba(255,255,255,0.06);
  border-left-color: #3b82f6;
}

.mobile-menu.open {
  display: block;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1.3;
}

.hero p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== CALCULATOR CARD ===== */
.calculator-card {
  background: white;
  margin-top: -36px;
  padding: 36px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.input-side,
.result-side {
  flex: 1 1 260px;
  width: 100%;
  min-width: 0;
}

/* ===== LABELS ===== */
label {
  font-weight: 600;
  display: block;
  margin-top: 15px;
  margin-bottom: 6px;
  font-size: 14px;
  color: #374151;
}

/* ===== INPUTS ===== */
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  background: #f9fafb;
  font-size: 16px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  display: block;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: #1e3a8a;
  background: #fff;
}

/* Remove number input spinner arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* ===== BUTTON ===== */
button {
  width: 100%;
  padding: 13px;
  background: #1e3a8a;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  margin-top: 18px;
  transition: background 0.2s;
}

button:hover {
  background: #0f172a;
}

/* ===== RESULT BOX ===== */
.result-box {
  background: #f1f5f9;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  text-align: center;
}

.result-box p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}

.result-box h2 {
  font-size: 32px;
  color: #1e3a8a;
  font-weight: 700;
}

.result-side > p {
  font-size: 15px;
  color: #475569;
  margin-bottom: 8px;
}

canvas {
  max-width: 100%;
  margin-top: 16px;
}

/* ===== SEO CONTENT SECTION ===== */
.seo-content {
  margin: 60px auto;
  max-width: 850px;
  padding: 0 20px;
}

.seo-content h2 {
  font-size: 24px;
  margin-top: 48px;
  margin-bottom: 14px;
  color: #0f172a;
  font-weight: 700;
}

.seo-content h3 {
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 8px;
  color: #1e3a8a;
}

.seo-content p {
  margin-bottom: 16px;
  font-size: 15px;
  color: #475569;
  line-height: 1.8;
}

.seo-content ul {
  margin-left: 20px;
  margin-bottom: 20px;
}

.seo-content li {
  margin-bottom: 10px;
  color: #475569;
  font-size: 15px;
  line-height: 1.7;
}

.seo-content a {
  color: #1e3a8a;
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

  /* Hide desktop nav, show hamburger */
  nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* ✅ FIX: Shrink logo on mobile so Menu button fits */
  .logo img {
    height: 36px;
    max-width: 160px;
  }

  /* ✅ FIX: Ensure nav-flex doesn't overflow on mobile */
  .nav-flex {
    padding: 10px 0;
    gap: 8px;
    overflow: hidden;
  }

  .hero {
    padding: 48px 16px 56px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .calculator-card {
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
    margin-top: -28px;
    border-radius: 14px;
  }

  .input-side,
  .result-side {
    width: 100%;
    flex: none;
    min-width: 0;
  }

  input[type="number"],
  input[type="text"],
  select {
    width: 100%;
    font-size: 16px;
  }

  button {
    font-size: 15px;
    padding: 12px;
  }

  .result-box h2 {
    font-size: 26px;
  }

  .seo-content {
    margin: 40px auto;
    padding: 0 16px;
  }

  .seo-content h2 {
    font-size: 20px;
    margin-top: 36px;
  }

  .seo-content h3 {
    font-size: 16px;
  }

  .seo-content p,
  .seo-content li {
    font-size: 14px;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 19px;
  }

  .calculator-card {
    padding: 20px 12px;
  }

  .result-box h2 {
    font-size: 22px;
  }

  /* ✅ FIX: Extra small screens — shrink logo further */
  .logo img {
    height: 30px;
    max-width: 140px;
  }
}
