* {
  box-sizing: border-box;
}

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

body {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  min-height: 100%;
  height: 100%;
}

/* Header */

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

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

.brand-link {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.desktop-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
}

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

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

.dropdown {
  position: relative;
}

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

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

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

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

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

/* Mobile nav */

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

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
}

.menu-overlay.active {
  display: block;
}

.mobile-menu {
  display: none;
}

.mobile-menu.open {
  /* handled in media query */
}

/* Page header */

.page-header {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  padding: 96px 20px 80px;
  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 layout */

.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: #14b8a6;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.input-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  padding: 32px;
  border-radius: 16px;
  border: 2px solid #14b8a6;
}

.input-label {
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 12px;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 16px;
  border: 2px solid #14b8a6;
  border-radius: 12px;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s ease;
  color: #1e293b;
}

.input-field:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
  transform: scale(1.02);
}

.unit-label {
  font-size: 24px;
  font-weight: 700;
  color: #14b8a6;
  margin-top: 12px;
  text-align: center;
}

.swap-button {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.swap-button:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.presets-wrapper {
  text-align: center;
  margin-bottom: 24px;
}

.presets-title {
  font-size: 18px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.preset-btn {
  padding: 12px 24px;
  background: #ffffff;
  border: 2px solid #14b8a6;
  border-radius: 10px;
  color: #14b8a6;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-btn:hover {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* Breakdown */

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

.result-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  padding: 24px;
  border-radius: 16px;
  border-left: 5px solid #10b981;
}

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

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

.formula-text {
  font-size: 18px;
}

.small-result {
  font-size: 24px;
}

.result-box-warm {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left-color: #f59e0b;
}

.result-label-warm {
  color: #78350f;
}

.result-box-pink {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-left-color: #ec4899;
}

.result-label-pink {
  color: #831843;
}

.result-box-blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-left-color: #3b82f6;
}

.result-label-blue {
  color: #1e3a8a;
}

.result-box-indigo {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-left-color: #6366f1;
}

.result-label-indigo {
  color: #312e81;
}

.result-box-gold {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left-color: #eab308;
}

.result-label-gold {
  color: #713f12;
}

/* Measurement visual */

.measurement-visual {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 24px;
  border-radius: 16px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

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

.measurement-bar {
  height: 40px;
  background: linear-gradient(90deg, #14b8a6 0%, #0d9488 100%);
  border-radius: 8px;
  position: relative;
  transition: width 0.5s ease;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
}

.measurement-marks {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 14px;
  color: #1e40af;
  font-weight: 600;
}

/* History */

.history-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #14b8a6;
}

.history-main {
  font-weight: 700;
  color: #1e293b;
  font-size: 18px;
}

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

.history-empty {
  text-align: center;
  color: #94a3b8;
  padding: 40px;
}

/* Downloads */

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

.download-btn {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 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(20, 184, 166, 0.3);
}

/* Table */

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

.conversion-table th {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #ffffff;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

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

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

/* Blog content */

.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, #14b8a6 0%, #0d9488 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: #14b8a6;
  font-weight: 700;
}

.blog-content a {
  color: #2563eb;
  text-decoration: none;
  border-bottom: 1px dotted #93c5fd;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

.highlight-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  padding: 24px;
  border-radius: 12px;
  border-left: 4px solid #14b8a6;
  margin: 32px 0;
}

.example-box {
  background: #f0fdfa;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #14b8a6;
  margin: 24px 0;
}

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

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

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

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

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

/* View transitions */

@view-transition {
  navigation: auto;
}

/* Responsive */

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

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

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

  .mobile-menu {
    display: block;
    position: relative;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    padding: 10px 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 950;
  }

  .mobile-menu.open {
    max-height: 420px;
  }

  .mobile-menu a {
    display: block;
    padding: 10px 24px;
    color: #ecfdf5;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(22, 163, 74, 0.35);
  }

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

  .mobile-menu a:hover {
    background: rgba(22, 163, 74, 0.85);
  }

  body.menu-open {
    overflow: hidden;
  }

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

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

  .calculator-card {
    padding: 24px;
  }

  .converter-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .swap-button {
    transform: rotate(90deg);
    margin: 0 auto;
  }

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

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

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

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

  .preset-buttons {
    justify-content: center;
  }
}
