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

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

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

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.25);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.header-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links > a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links > a:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}

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

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

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

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

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

.mobile-menu {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 10px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.mobile-menu.open {
  max-height: 320px;
  opacity: 1;
}

.mobile-menu a {
  display: block;
  padding: 9px 0;
  text-decoration: none;
  color: #e5f9f4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.92rem;
}

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

/* Page header */
.page-header {
  position: relative;
  color: #ffffff;
  padding: 60px 20px 80px;
  overflow: hidden;
  text-align: center;
}

.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.08)'/%3E%3C/svg%3E")
    repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.5;
}

.page-header-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  z-index: 1;
}

.page-header h1 {
  font-size: 2.7rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.95;
}

/* Calculator container */
.calculator-container {
  max-width: 1120px;
  margin: -40px auto 60px;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.intro-text {
  color: #4a5568;
  font-size: 0.98rem;
  line-height: 1.8;
  margin-bottom: 24px;
  text-align: justify;
}

/* Method selector */
.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.method-btn {
  padding: 18px 14px;
  background: #f7fafc;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  color: #2d3748;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  transition: all 0.22s ease;
}

.method-btn:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  transform: translateY(-1px);
}

.method-btn.active {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #ffffff;
  border-color: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.45);
}

.method-icon {
  font-size: 1.7rem;
}

/* Method intro card */
.method-intro {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: 16px 18px;
  border-radius: 12px;
  border-left: 4px solid #14b8a6;
  margin-bottom: 18px;
}

.method-intro h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: #0f766e;
}

.method-intro p {
  margin: 0;
  font-size: 0.9rem;
  color: #4a5568;
}

/* Input fields */
.input-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #cbd5e0;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.21);
}

.input-hint {
  font-size: 0.8rem;
  color: #718096;
  margin-top: 4px;
  font-style: italic;
}

/* Calculate button */
.calculate-btn {
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #ffffff;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calculate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 118, 110, 0.55);
}

.calculate-btn:active {
  transform: scale(0.98);
}

/* Results */
.results-section {
  margin-top: 28px;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-left: 4px solid #14b8a6;
  display: none;
}

.results-section.show {
  display: block;
}

.result-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

/* Hero result block */
.hero-result {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
  margin-bottom: 18px;
}

.hero-result.growth-negative {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.hero-result-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.hero-result-value {
  font-size: 2.2rem;
  font-weight: 900;
}

.hero-result-sub {
  font-size: 0.95rem;
  opacity: 0.96;
  margin-top: 4px;
}

/* Result boxes */
.result-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 14px;
}

.result-box:last-child {
  margin-bottom: 0;
}

.result-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}

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

.breakdown-label {
  color: #4a5568;
}

.breakdown-value {
  color: #2d3748;
  font-weight: 600;
}

/* Net exports special styling */
.net-exports {
  border-top: 2px solid #14b8a6;
  margin-top: 6px;
  padding-top: 10px;
}

/* Formula / analysis text */
.formula-result {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 4px solid #14b8a6;
}

.formula-text {
  font-family: 'Courier New', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.7;
}

.analysis-text {
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Error box */
.error-box {
  border-left: 4px solid #ef4444;
}

.error-text {
  margin-top: 6px;
  color: #ef4444;
  font-size: 0.9rem;
}

/* Download buttons */
.download-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.download-btn {
  flex: 1 1 150px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.5);
}

.download-btn:active {
  transform: scale(0.98);
}

/* Info cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.info-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 18px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #14b8a6;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(20, 184, 166, 0.26);
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #2d3748;
}

.info-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.7;
}

/* Blog section */
.blog-section {
  max-width: 900px;
  margin: 60px auto 80px;
  padding: 0 16px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 26px 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.blog-content h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 1.25rem;
  margin: 24px 0 10px;
  color: #2d3748;
}

.blog-content h4 {
  font-size: 1.05rem;
  margin: 18px 0 6px;
  color: #2d3748;
}

.blog-content p {
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.9;
  margin-bottom: 12px;
}

.blog-content ul {
  padding-left: 22px;
  margin: 8px 0 14px;
  color: #4a5568;
  font-size: 0.95rem;
}

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

.blog-content a {
  color: #0f766e;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.blog-content a:hover {
  color: #065f46;
}

/* Highlight / formula / FAQ */
.highlight-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 12px;
  padding: 14px 16px;
  border-left: 4px solid #14b8a6;
  margin: 18px 0;
  font-size: 0.93rem;
  color: #065f46;
}

.formula-box {
  background: #2d3748;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'Courier New', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  margin: 12px 0 16px;
  overflow-x: auto;
}

/* FAQ items */
.faq-item {
  margin-top: 14px;
}

.faq-item h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.faq-item p {
  margin-bottom: 4px;
}

/* Footer overrides (keep tailwind layout but align with theme) */
.footer {
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  color: #ffffff;
  padding: 50px 0 24px;
}

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

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

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

.footer-column ul li a {
  font-size: 0.9rem;
  color: #cbd5e0;
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

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

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

/* Responsive */
@media (max-width: 900px) {
  .header-inner {
    padding-inline: 16px;
  }

  .site-title {
    font-size: 0.96rem;
  }

  .nav-links {
    display: none !important;
  }

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

  .method-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .blog-content {
    padding: 26px 18px 30px;
  }

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

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

@media (max-width: 640px) {
  .method-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: 42px 14px 60px;
  }

  .calculator-card {
    border-radius: 18px;
  }

  .blog-section {
    margin: 40px auto 60px;
  }

  .hero-result-value {
    font-size: 1.9rem;
  }
}
