@view-transition {
  navigation: auto;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 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);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.site-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.site-tagline {
  font-size: 0.75rem;
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

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

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

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.dropdown-toggle:hover {
  color: #e5e7eb;
}

.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.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: 28px;
}

/* Mobile hamburger */

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

/* Mobile overlay */

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

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

/* Hero */

.page-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  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;
}

/* 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);
  }
  50% {
    transform: translateY(-20px);
  }
}

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

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

/* Layout */

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

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Cards */

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

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

/* Tabs */

.tab-container {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  background: #f3f4f6;
  padding: 6px;
  border-radius: 12px;
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.tab-btn:hover:not(.active) {
  background: #e5e7eb;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Inputs */

.input-section {
  margin-bottom: 28px;
}

.input-label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-wrapper {
  position: relative;
}

.input-field {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  font-size: 18px;
  transition: all 0.3s ease;
  font-weight: 600;
}

.input-field:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.input-prefix,
.input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #4a5568;
  font-weight: 600;
  font-size: 18px;
  pointer-events: none;
}

.input-prefix {
  left: 20px;
}

.input-suffix {
  right: 20px;
}

.input-field.with-prefix {
  padding-left: 50px;
}

.input-field.with-suffix {
  padding-right: 80px;
}

/* Slider */

.slider-container {
  margin-top: 12px;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, #f59e0b 0%, #d97706 100%);
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.slider:hover {
  opacity: 1;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Select */

.select-field {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

/* Button */

.calculate-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

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

/* Results */

.results-section {
  display: none;
}

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

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

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

.result-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}

.result-box.highlight {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  grid-column: 1 / -1;
}

.result-box.highlight .result-label {
  color: rgba(255, 255, 255, 0.9);
}

.result-box.highlight .result-value {
  color: #ffffff;
  font-size: 48px;
}

.result-box.highlight .result-subtext {
  color: rgba(255, 255, 255, 0.8);
}

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

.result-value {
  font-weight: 800;
  color: #f59e0b;
  font-size: 32px;
}

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

/* Charts */

.chart-container {
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

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

.bar-chart {
  display: flex;
  gap: 40px;
  align-items: flex-end;
  justify-content: center;
  height: 280px;
  margin: 32px 0;
}

.bar-item {
  flex: 1;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.bar {
  width: 100%;
  background: linear-gradient(to top, #f59e0b 0%, #fbbf24 100%);
  border-radius: 12px 12px 0 0;
  position: relative;
  transition: all 0.5s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.bar-interest {
  background: linear-gradient(to top, #ef4444 0%, #f87171 100%);
}

.bar-total {
  background: linear-gradient(to top, #10b981 0%, #34d399 100%);
}

.bar:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.bar-value {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: #f59e0b;
  font-size: 16px;
  white-space: nowrap;
}

.bar-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
  text-align: center;
}

/* Stats */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #f59e0b;
}

/* Formula box */

.formula-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  padding: 24px;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  margin: 24px 0;
}

.formula-title {
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 12px;
  font-size: 16px;
}

.formula-text {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  color: #1e3a8a;
  font-weight: 600;
  margin-bottom: 12px;
}

.formula-description {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

/* 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);
}

/* Info cards */

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

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

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2);
}

.info-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.info-card a {
  color: #2563eb;
  text-decoration: underline;
}

.info-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 12px;
}

/* 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: 38px;
  font-weight: 900;
  color: #1a202c;
  margin-bottom: 32px;
  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: 26px;
  font-weight: 700;
  color: #2d3748;
  margin-top: 36px;
  margin-bottom: 18px;
}

.blog-content h4 {
  font-size: 21px;
  font-weight: 600;
  color: #4a5568;
  margin-top: 28px;
  margin-bottom: 14px;
}

.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: 32px;
  margin-bottom: 18px;
}

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

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

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

.example-box {
  background: #eff6ff;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
  margin: 24px 0;
}

.warning-box {
  background: #fee2e2;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #ef4444;
  margin: 24px 0;
}

/* FAQ */

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

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

.faq-container h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 24px;
  color: #1f2933;
}

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

.faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 0;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: #4b5563;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 12px;
}

/* 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: #14b8a6;
  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;
}

/* Responsive */

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

  .result-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .blog-content {
    padding: 40px 24px;
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.25rem;
    gap: 0.75rem;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  body.mobile-menu-open .nav-links {
    display: flex;
  }

  .nav-link,
  .dropdown-toggle {
    width: 100%;
    text-align: left;
  }

  .dropdown-content {
    position: static;
    margin-top: 8px;
    box-shadow: none;
    border-radius: 8px;
    width: 100%;
  }

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

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

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

  .calculator-card {
    padding: 24px;
  }

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

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

  .bar-chart {
    gap: 20px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 10px 12px;
  }

  .blog-section {
    margin-top: 60px;
  }
}
