@view-transition {
  navigation: auto;
}

* {
  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, #3b82f6 0%, #2563eb 100%);
}

/* Header & Nav */

.header {
  background: linear-gradient(135deg, #4d8a42 0%, #74ad6a 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.header-inner {
  position: relative;
}

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

/* Dropdown */

.dropdown {
  position: relative;
}

.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.3s ease;
  z-index: 1100;
}

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

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

/* Show dropdown on open class (via JS) */
.dropdown.open .dropdown-content {
  display: block;
}

/* Mobile Menu */

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

.mobile-menu-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform-origin: top;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  padding: 10px 0 16px;
  z-index: 1050;
}

.mobile-menu-panel a {
  display: block;
  padding: 10px 24px;
  color: #ecfdf5;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.mobile-menu-panel a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Open state (JS toggles .open) */
.mobile-menu-panel.open {
  display: block;
  transform: scaleY(1);
  opacity: 1;
}

/* Page Header */

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

.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 {
  font-size: 48px;
  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: 20px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  animation: slideInUp 0.6s ease;
}

/* Container / Cards */

.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;
}

.card-title {
  font-size: 28px;
  font-weight: 800;
  color: #3b82f6;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 3px solid #3b82f6;
}

/* Inputs */

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-label {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-field,
.select-field {
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.input-field:focus,
.select-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Summary */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-box {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 24px;
  border-radius: 16px;
  border-left: 5px solid #3b82f6;
  transition: all 0.3s ease;
}

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

.summary-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-weight: 900;
  color: #1e293b;
  font-size: 32px;
}

.summary-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* Chart */

.chart-container {
  background: #f8fafc;
  padding: 24px;
  border-radius: 16px;
  margin-top: 24px;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.chart-label {
  width: 150px;
  font-weight: 600;
  color: #4a5568;
}

.chart-bar-fill {
  flex: 1;
  height: 32px;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #ffffff;
  font-weight: 600;
}

/* Different colors for interest and down payment bars */
.chart-bar-interest {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.chart-bar-downpayment {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

/* Amortization Table */

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  font-size: 14px;
}

.amortization-table th {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

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

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

/* Download Buttons */

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

.download-btn {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 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: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 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: 42px;
  font-weight: 900;
  color: #1a202c;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 28px;
  font-weight: 700;
  color: #2d3748;
  margin-top: 40px;
  margin-bottom: 20px;
}

.blog-content h4 {
  font-size: 22px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 32px;
  margin-bottom: 16px;
}

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

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

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

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

.blog-content a {
  color: #2563eb;
  text-decoration: underline;
}

.blog-content a:hover {
  color: #1d4ed8;
}

/* FAQ styling */

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

.faq-item h4 {
  font-size: 20px;
  margin-bottom: 8px;
  color: #1f2933;
}

/* 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.3s ease;
  display: inline-block;
}

.footer-column ul li a:hover {
  color: #3b82f6;
  transform: translateX(5px);
}

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

/* 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 float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

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

/* Responsive */

.header-logo {
  height: 28px;
  width: auto;
  display: block;
}

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

@media (max-width: 768px) {
  /* Hide desktop nav completely on tablets & phones */
  .nav-links {
    display: none !important;
  }

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

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

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

  .calculator-card {
    padding: 24px;
  }

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

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

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

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

  .tip-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
/* When mobile menu is open, never show desktop links */
body.mobile-menu-open .nav-links {
  display: none !important;
}

    