@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, #1e3a8a 0%, #3b82f6 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 {
  position: relative;
}

.logo-wrap {
  min-width: 0;
}

.main-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.site-name {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

/* Desktop navigation */

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

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

.desktop-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.desktop-nav a:hover {
  color: #e5e7eb;
  transform: scale(1.1);
}

.desktop-right {
  margin-left: auto;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease;
}

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

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

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

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

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

/* Mobile navigation */

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

.mobile-menu {
  display: none;
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 1rem 1.5rem 1.25rem;
  z-index: 900;
}

.mobile-menu.open {
  display: block;
  animation: slideDown 0.25s ease;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-links a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

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

.mobile-nav-links a:hover {
  color: #ffffff;
}

/* Page header */

.page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 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 {
  position: relative;
  z-index: 1;
  font-size: 56px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  position: relative;
  z-index: 1;
  font-size: 22px;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
  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;
}

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

/* Operation selector */

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

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

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

.operation-btn.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  border-color: #1e3a8a;
  box-shadow: 0 8px 20px rgba(30, 58, 138, 0.4);
}

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

/* Input fields */

.input-group {
  margin-bottom: 24px;
}

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

.input-field {
  width: 100%;
  padding: 16px;
  border: 2px solid #cbd5e0;
  border-radius: 12px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
}

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

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

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

.example-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.example-btn {
  padding: 8px 16px;
  background: #f7fafc;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  transition: all 0.3s ease;
}

.example-btn:hover {
  background: #edf2f7;
  border-color: #3b82f6;
}

/* Calculate button */

.calculate-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 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(30, 58, 138, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 58, 138, 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 #3b82f6;
  display: none;
  animation: fadeIn 0.5s ease;
}

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

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

.result-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  text-align: center;
}

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

.result-hero-value {
  font-size: 48px;
  font-weight: 900;
  font-family: 'Courier New', monospace;
  word-wrap: break-word;
}

.result-hero-sub {
  font-size: 20px;
  opacity: 0.9;
  margin-top: 8px;
}

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

.result-value {
  font-weight: 700;
  color: #3b82f6;
  font-size: 24px;
  font-family: 'Courier New', monospace;
}

.result-input {
  font-family: 'Courier New', monospace;
  color: #4a5568;
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.6;
}

.step-by-step {
  background: #2d3748;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  margin-top: 16px;
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
}

.step-by-step .step {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.step-by-step .step::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

.all-formats-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid #3b82f6;
}

.all-formats-label {
  color: #3b82f6;
}

.all-formats-values {
  font-family: 'Courier New', monospace;
  color: #4a5568;
  margin-top: 12px;
  line-height: 2;
}

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

.error-label {
  color: #ef4444;
}

.error-text {
  color: #ef4444;
  font-size: 16px;
  margin-top: 8px;
}

/* Download buttons */

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

.download-btn {
  flex: 1;
  min-width: 180px;
  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.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 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 #3b82f6;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 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;
}

/* 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, #1e3a8a 0%, #3b82f6 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 {
  color: #4a5568;
  margin-left: 32px;
  margin-bottom: 24px;
}

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

.blog-content a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.blog-content a:hover {
  text-decoration: underline;
}

.formula-box {
  background: #2d3748;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  margin: 24px 0;
  overflow-x: auto;
  line-height: 1.6;
}

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

.faq-section {
  margin-top: 24px;
}

.faq-item {
  margin-bottom: 20px;
}

.faq-item h4 {
  margin-bottom: 6px;
  font-size: 18px;
  color: #1f2937;
}

/* 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 slideDown {
  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 */

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

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

  .page-header {
    padding: 60px 20px;
  }

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

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

  .calculator-card {
    padding: 24px;
  }

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

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

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

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

  .result-hero-value {
    font-size: 32px;
    word-break: break-all;
  }

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

@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
}
