/* ===========================
   Global Base Styles
   =========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* ===========================
   Header & Navigation
   =========================== */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.35);
}

.header-inner {
  position: relative;
}

/* Logo */

.logo-link {
  text-decoration: none;
}

.main-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-title {
  white-space: nowrap;
}

/* Desktop nav */

.desktop-nav {
  align-items: center;
}

.nav-item {
  color: #ffffff;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #facc15;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.nav-item:hover {
  color: #e5e7eb;
  transform: translateY(-1px);
}

.nav-item:hover::after {
  width: 100%;
}

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.98rem;
  padding: 4px 0;
}

.dropdown-toggle:focus {
  outline: none;
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  padding: 8px 0;
  display: none;
  z-index: 1001;
}

.dropdown-content a {
  display: block;
  padding: 10px 18px;
  font-size: 0.9rem;
  color: #4b5563;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  padding-left: 24px;
}

.dropdown.dropdown-open .dropdown-content {
  display: block;
}

/* Mobile nav */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Green slide-down menu */

.mobile-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.45);
  z-index: 999;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  padding: 12px 20px 18px;
}

.mobile-menu-inner a {
  color: #ecfdf5;
  text-decoration: none;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.95rem;
  font-weight: 500;
}

.mobile-menu-inner a:last-child {
  border-bottom: none;
}

.mobile-menu-inner a:hover {
  color: #bbf7d0;
}

.mobile-menu.open {
  max-height: 360px; /* Enough to show all links */
}

/* Overlay behind mobile menu */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

.mobile-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===========================
   Page Header / Hero
   =========================== */

.page-header {
  position: relative;
  padding: 80px 20px 70px;
  text-align: center;
  color: #ffffff;
  overflow: hidden;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'%3E%3Cpath d='M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E")
    repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.3;
}

.page-header h1 {
  position: relative;
  z-index: 1;
  font-size: 3.2rem;
  font-weight: 900;
  margin: 0 0 12px;
  text-shadow: 2px 2px 4px rgba(15, 23, 42, 0.4);
}

.page-header p {
  position: relative;
  z-index: 1;
  font-size: 1.2rem;
  opacity: 0.96;
  max-width: 640px;
  margin: 0 auto;
}

.page-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

/* Float animation */

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(4deg);
  }
}

.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* ===========================
   Calculator Layout
   =========================== */

.calculator-container {
  max-width: 1400px;
  margin: -60px auto 70px;
  padding: 0 20px 10px;
  position: relative;
  z-index: 10;
}

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
}

/* Converter controls */

.converter-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 22px;
}

.input-group {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  padding: 22px 20px 20px;
  border-radius: 16px;
  border: 2px solid #f59e0b;
}

.input-label {
  font-weight: 700;
  color: #92400e;
  margin-bottom: 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-field {
  width: 100%;
  padding: 12px 10px;
  border-radius: 10px;
  border: 2px solid #f59e0b;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  color: #111827;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.input-field:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
  transform: scale(1.01);
}

.unit-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid #f59e0b;
  font-size: 0.95rem;
  font-weight: 600;
  color: #92400e;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.unit-select:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

/* Formula */

.formula-row {
  text-align: center;
  margin-top: 4px;
}

.formula-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.formula-value {
  color: #f59e0b;
}

/* All-conversion boxes */

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.result-box {
  padding: 18px 16px;
  border-radius: 14px;
  border-left: 4px solid #10b981;
  text-align: center;
}

.result-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #111827;
}

/* History */

.history-placeholder {
  text-align: center;
  color: #94a3b8;
  padding: 36px 10px;
  font-size: 0.95rem;
}

.history-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 4px solid #f59e0b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-main {
  font-weight: 700;
  color: #111827;
  font-size: 1.05rem;
}

.history-meta {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Download buttons */

.download-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.download-btn {
  flex: 1 1 160px;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.6);
}

/* Tables */

.table-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 4px 0 10px;
}

.table-wrapper {
  overflow-x: auto;
}

.conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.conversion-table th {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}

.conversion-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.conversion-table tr:nth-child(even) td {
  background: #f9fafb;
}

.conversion-table tr:hover td {
  background: #f3f4f6;
}

/* ===========================
   Blog & FAQ
   =========================== */

.blog-section {
  max-width: 900px;
  margin: 10px auto 80px;
  padding: 0 20px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 48px 40px 52px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 2.2rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin-top: 32px;
  margin-bottom: 14px;
}

.blog-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2933;
  margin-top: 18px;
  margin-bottom: 6px;
}

.blog-content p {
  color: #4b5563;
  font-size: 0.98rem;
  margin-bottom: 16px;
}

.blog-content ul {
  color: #4b5563;
  margin: 0 0 16px 24px;
  padding: 0;
}

.blog-content li {
  margin-bottom: 8px;
}

.blog-content a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.blog-content a:hover {
  text-decoration: underline;
}

.blog-content strong {
  color: #f59e0b;
}

.highlight-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  padding: 18px 18px 20px;
  border-radius: 14px;
  border-left: 4px solid #f59e0b;
  margin: 24px 0;
  font-size: 0.96rem;
  color: #78350f;
}

.example-box {
  background: #fffbeb;
  padding: 18px 18px 20px;
  border-radius: 14px;
  border-left: 4px solid #f59e0b;
  margin: 24px 0;
  font-size: 0.96rem;
  color: #78350f;
}

/* FAQ */

.faq-item {
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #e5e7eb;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h4 {
  margin-bottom: 6px;
}

/* ===========================
   Footer
   =========================== */

.footer {
  background: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
  color: #e5e7eb;
  padding: 54px 0 26px;
}

.footer-column h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  color: #9ca3af;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 8px;
}

.footer-column a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, transform 0.15s ease;
  display: inline-block;
}

.footer-column a:hover {
  color: #fbbf24;
  transform: translateX(3px);
}

.footer-text {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.45);
  margin-top: 30px;
  padding-top: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 1024px) {
  .page-header h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 768px) {
  header .desktop-nav {
    display: none !important;
  }

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

  .page-header {
    padding: 64px 16px 54px;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 0.98rem;
  }

  .calculator-card {
    padding: 26px 20px 24px;
  }

  .converter-section {
    grid-template-columns: 1fr;
  }

  .download-buttons {
    flex-direction: column;
  }

  .blog-content {
    padding: 32px 20px 34px;
  }
}


@media (min-width: 769px) {
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }

  .mobile-menu-btn {
    display: none;
  }
}
