/* ========== GLOBAL ==========
   Shared layout & typography
============================== */

html, body {
  height: 100%;
}

body {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  min-height: 100%;
}

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

/* ========== HEADER & NAV ========= */

.header {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15);
}

.header-inner {
  position: relative;
}

.brand {
  text-decoration: none;
  color: #fff;
}

.site-logo {
  height: 40px;
  width: auto;
  border-radius: 8px;
}

.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: #fed7aa;
}

/* Desktop nav */

.main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.nav-link:hover {
  color: #fefce8;
  transform: scale(1.05);
}

/* Dropdown */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.3s ease, transform 0.3s ease;
}

.dropdown-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  margin-top: 8px;
  overflow: hidden;
  z-index: 1100;
}

.dropdown-content a {
  color: #4a5568;
  padding: 12px 18px;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

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

/* Click-open state */
.dropdown.open .dropdown-content {
  display: block;
}

/* Mobile hamburger */

.mobile-menu-btn {
  display: none;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Mobile nav */

.mobile-nav {
  display: none;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 10px 0 16px;
}

.mobile-nav li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav li:last-child {
  border-bottom: none;
}

.mobile-nav a {
  display: block;
  padding: 10px 20px;
  color: #f9fafb;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.mobile-nav a:hover {
  background: rgba(0, 0, 0, 0.12);
}

.mobile-nav.open {
  max-height: 400px;
}

/* Desktop nav visibility */

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

/* ========== HERO / PAGE HEADER ========= */

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

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

.header-emoji {
  font-size: 3.5rem;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
  opacity: 0.95;
  animation: slideInUp 0.6s ease;
}

/* Animations */

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

/* ========== MAIN CALCULATOR LAYOUT ========= */

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

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.6s ease;
  margin-bottom: 24px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.card-title span:first-child {
  font-size: 1.8rem;
}

/* Converter */

.converter-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 26px;
}

.input-group {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #f59e0b;
  transition: all 0.3s ease;
}

.input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
}

.input-label {
  font-weight: 700;
  color: #78350f;
  margin-bottom: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 14px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
  color: #1e293b;
  margin-bottom: 12px;
}

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

.unit-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #78350f;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* Formula */

.formula-wrapper {
  text-align: center;
  margin-bottom: 8px;
}

.formula-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.formula-text {
  color: #f59e0b;
  margin-left: 4px;
}

/* Result grid */

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

.result-box {
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  text-align: center;
  transition: all 0.3s ease;
}

.result-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.result-label {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-value {
  font-weight: 900;
  color: #1e293b;
  font-size: 1.25rem;
}

/* Tables */

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

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

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

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

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

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

/* Ads */

.adsense-container {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #cbd5e0;
}

.adsense-placeholder {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.adsense-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.adsense-title {
  font-weight: 600;
  margin-bottom: 6px;
}

/* History */

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

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

.history-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.history-main {
  font-weight: 700;
  color: #1e293b;
  font-size: 1rem;
}

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

/* Download buttons */

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

.download-btn {
  flex: 1;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ========== BLOG SECTION ========= */

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

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 50px 50px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  line-height: 1.8;
}

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

.blog-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d3748;
  margin-top: 26px;
  margin-bottom: 12px;
}

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

.blog-content ul {
  color: #4a5568;
  margin-left: 1.4rem;
  margin-bottom: 14px;
}

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

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

.blog-content a {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
}

.blog-content a:hover {
  color: #1d4ed8;
  border-bottom-style: solid;
}

/* Highlight / Example boxes */

.highlight-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 18px;
  border-radius: 12px;
  border-left: 4px solid #f59e0b;
  margin: 18px 0;
  font-size: 0.95rem;
}

.example-box {
  background: #fef3c7;
  padding: 18px;
  border-radius: 12px;
  border-left: 4px solid #f59e0b;
  margin: 18px 0;
  font-size: 0.95rem;
}

/* ========== FAQ SECTION ========= */

.faq-section {
  max-width: 900px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.faq-inner {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 40px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.faq-inner h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #1f2933;
}

.faq-item + .faq-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.faq-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.faq-item p {
  font-size: 0.95rem;
  color: #4b5563;
}

/* ========== FOOTER ========= */

.footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #ffffff;
  padding: 60px 0 20px;
  margin-top: 40px;
}

.footer-column h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

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

.footer-column ul li a {
  color: #cbd5e0;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 0.9rem;
}

.footer-column ul li a:hover {
  color: #f59e0b;
  transform: translateX(4px);
}

.footer-about {
  color: #cbd5e0;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 30px;
  padding-top: 20px;
  text-align: center;
  color: #a0aec0;
  font-size: 0.85rem;
}

/* ========== RESPONSIVE ========= */

@media (max-width: 1024px) {
  .main-nav {
    position: static;
    transform: none;
  }
}

@media (max-width: 768px) {
  /* hide desktop nav on mobile */
  .desktop-nav {
    display: none !important;
  }

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

  .mobile-nav {
    display: block;
  }

  .page-header {
    padding: 60px 16px 80px;
  }

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

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

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

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

  .blog-content {
    padding: 26px 22px 24px;
  }

  .faq-inner {
    padding: 26px 20px 22px;
  }

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

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

  .card-title {
    font-size: 1.3rem;
  }

  .input-field {
    font-size: 1.25rem;
  }
}
