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

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

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

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

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

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

/* Keep desktop nav centered on larger screens only */
.desktop-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 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;
  animation: fadeInDown 0.25s ease;
  z-index: 40;
}

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

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

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

/* Mobile menu */
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
}

.mobile-menu {
  position: relative;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-radius: 0 0 16px 16px;
  margin-top: 8px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 360px; /* enough for all items */
}

.mobile-nav-link {
  display: block;
  padding: 12px 4px;
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.mobile-nav-link:hover {
  background: rgba(4, 120, 87, 0.75);
}

/* Site name truncation on mobile to avoid overlap */
.site-name-link {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Page header */
.page-header {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #ffffff;
  padding: 80px 20px;
  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;
}

.page-header h1 {
  font-size: 56px;
  font-weight: 900;
  margin-bottom: 16px;
  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: 22px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  animation: slideInUp 0.6s ease;
}

/* Calculator container */
.calculator-container {
  max-width: 1200px;
  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;
}

.intro-text {
  color: #4a5568;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
  text-align: justify;
}

/* Method selector */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.method-btn {
  padding: 24px;
  background: #f7fafc;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-weight: 600;
  color: #2d3748;
}

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

.method-btn.active {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #ffffff;
  border-color: #f97316;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.method-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

/* Inputs */
.input-group {
  margin-top: 24px;
  margin-bottom: 12px;
}

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

.input-field {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.12);
}

.input-size-field {
  font-size: 22px;
  font-weight: 600;
}

.input-hint {
  font-size: 13px;
  color: #718096;
  margin-top: 6px;
  font-style: italic;
}

/* Calculate button */
.calculate-btn {
  width: 100%;
  margin-top: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.calculate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

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

/* Results */
.results-section {
  margin-top: 32px;
  padding: 32px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 16px;
  border-left: 4px solid #fb923c;
  display: none;
  animation: fadeIn 0.4s ease;
}

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

.result-title {
  font-size: 22px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

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

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

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

.main-result-number {
  font-size: 24px;
  color: #f97316;
}

.primary-result-banner {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #ffffff;
  padding: 22px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.primary-result-subtitle {
  font-size: 15px;
  opacity: 0.9;
}

.primary-result-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

.soft-highlight {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-left: 4px solid #f97316;
}

.highlight-label {
  color: #f97316;
}

.result-details-text {
  color: #4a5568;
  margin-top: 12px;
  line-height: 1.9;
  font-size: 15px;
}

.result-tips-text {
  color: #4a5568;
  line-height: 1.75;
  margin-top: 10px;
  font-size: 15px;
}

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

.download-btn {
  flex: 1 1 160px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Info cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.info-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  border-left: 4px solid #fb923c;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(251, 146, 60, 0.2);
}

.info-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 12px;
}

.info-card p {
  color: #4a5568;
  line-height: 1.7;
  font-size: 15px;
}

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

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

.blog-content h2 {
  font-size: 40px;
  font-weight: 900;
  color: #1a202c;
  margin-bottom: 26px;
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.blog-content h4 {
  font-size: 20px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 26px;
  margin-bottom: 12px;
}

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

.blog-content ul,
.blog-content ol {
  color: #4a5568;
  margin-left: 24px;
  margin-bottom: 20px;
}

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

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

.highlight-box {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  padding: 22px;
  border-radius: 12px;
  border-left: 4px solid #f97316;
  margin: 28px 0;
}

/* FAQ styling */
.faq-wrapper {
  margin-top: 24px;
}

.faq-item {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 16px;
}

.faq-item:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.faq-item h4 {
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

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

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

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

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

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

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

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

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

/* Animations */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@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 slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive tweaks */
@media (max-width: 1024px) {
  .desktop-nav {
    position: static;
    transform: none;
  }
}

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

  .page-header {
    padding: 64px 18px;
  }

  .page-header h1 {
    font-size: 34px;
  }

  .page-header p {
    font-size: 18px;
  }

  .calculator-card {
    padding: 24px;
  }

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

  .blog-content {
    padding: 32px 24px;
  }

  .blog-content h2 {
    font-size: 30px;
  }

  .blog-content h3 {
    font-size: 22px;
  }

  .site-name-link {
    max-width: 150px;
  }
}
