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

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

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

/* Header */
.header {
  background: linear-gradient(135deg, #0f172a 0%, #111827 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.4);
}

/* Logo & brand */
.brand-link {
  text-decoration: none;
}

.site-logo {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: contain;
  background: #111827;
  padding: 4px;
}

.site-name {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
}

/* Desktop nav */
.desktop-nav .nav-item {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: inline-block;
}

.desktop-nav .nav-item:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  margin-top: 8px;
  overflow: hidden;
  z-index: 1200;
}

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

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

.dropdown-content a:hover {
  background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  padding-left: 24px;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(148, 163, 184, 0.2);
}

.mobile-menu {
  display: none;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #ecfdf5;
  box-shadow: 0 16px 40px rgba(22, 163, 74, 0.5);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease-out;
}

.mobile-menu.open {
  display: block;
  max-height: 320px;
}

.mobile-menu-inner {
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-item {
  color: #ecfdf5;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(22, 163, 74, 0.4);
}

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

.mobile-nav-item:hover {
  text-decoration: underline;
}

/* Hero / Page header */
.page-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.emoji-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.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: 3.1rem;
  font-weight: 900;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.28);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  font-size: 1.25rem;
  opacity: 0.98;
  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) rotate(0);
  }
  50% {
    transform: translateY(-12px) rotate(3deg);
  }
}

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

@keyframes energyPulse {
  0%, 100% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
  }
  50% {
    box-shadow: 0 0 38px rgba(245, 158, 11, 0.9);
  }
}

.energy-animation {
  animation: energyPulse 2.4s ease-in-out infinite;
}

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

/* Cards */
.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.6s ease;
  margin-bottom: 24px;
}

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

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

.card-subtitle {
  font-size: 0.98rem;
  color: #4b5563;
  margin-bottom: 22px;
}

/* Converter section */
.converter-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.input-group {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #f59e0b;
  transition: all 0.25s ease;
}

.input-group:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
}

.input-label {
  font-weight: 700;
  color: #78350f;
  margin-bottom: 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 14px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #111827;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
  transform: scale(1.02);
}

.unit-select {
  width: 100%;
  padding: 12px;
  border: 2px solid #f59e0b;
  border-radius: 10px;
  font-size: 0.96rem;
  font-weight: 600;
  color: #78350f;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Formula line */
.formula-wrapper {
  text-align: center;
  margin-bottom: 6px;
}

.formula-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.formula-value {
  color: #f59e0b;
}

.formula-note {
  font-size: 0.86rem;
  color: #4b5563;
}

/* Results grid */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.result-box {
  padding: 18px;
  border-radius: 12px;
  border-left: 4px solid #f59e0b;
  text-align: center;
  transition: all 0.2s ease;
}

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

.result-label {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.result-value {
  font-weight: 900;
  color: #111827;
  font-size: 1.1rem;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

.conversion-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 0.88rem;
}

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

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

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

.table-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  margin: 26px 0 10px;
}

/* History */
.history-empty {
  text-align: center;
  color: #92400e;
  padding: 32px;
  font-size: 0.95rem;
}

.history-item {
  background: #fef3c7;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #f59e0b;
  transition: all 0.2s ease;
}

.history-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}

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

.history-meta {
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 4px;
}

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

.download-btn {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 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(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Ads */
.adsense-container {
  background: #fef3c7;
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #fbbf24;
}

.adsense-placeholder {
  text-align: center;
  color: #92400e;
  font-size: 0.9rem;
}

.adsense-emoji {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.adsense-title {
  font-weight: 600;
  margin-bottom: 6px;
}

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

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

.blog-content h2 {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1f2933;
  margin-bottom: 26px;
  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: 1.4rem;
  font-weight: 700;
  color: #111827;
  margin-top: 34px;
  margin-bottom: 16px;
}

.blog-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-top: 22px;
  margin-bottom: 8px;
}

.blog-content p {
  color: #4b5563;
  font-size: 0.98rem;
  margin-bottom: 16px;
}

.blog-content ul {
  color: #4b5563;
  margin-left: 1.3rem;
  margin-bottom: 18px;
}

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

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

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

/* Highlight / Example boxes */
.highlight-box,
.example-box {
  padding: 20px;
  border-radius: 12px;
  margin: 22px 0;
  border-left: 4px solid #f59e0b;
}

.highlight-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.example-box {
  background: #fef3c7;
}

/* FAQ */
.faq-item {
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
  margin-top: 14px;
}

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

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

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

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

.footer-column ul li a {
  color: #cbd5e0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 36px;
  padding-top: 22px;
  text-align: center;
  color: #a0aec0;
  font-size: 0.86rem;
}

/* Responsive */
/* Responsive */
@media (max-width: 1024px) {
  .calculator-card {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  /* ❗ Hide top-level desktop navigation on mobile */
  .desktop-nav {
    display: none !important;
  }

  /* Show hamburger on mobile */
  .mobile-menu-btn {
    display: block;
  }

  .page-header {
    padding: 60px 16px 52px;
  }

  .page-header h1 {
    font-size: 2.15rem;
  }

  .page-header p {
    font-size: 1rem;
  }

  .calculator-card {
    padding: 24px 20px 26px;
  }

  .converter-section {
    grid-template-columns: 1fr;
  }

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

  .blog-content {
    padding: 28px 20px 32px;
  }

  .blog-content h2 {
    font-size: 1.7rem;
  }

  .blog-content h3 {
    font-size: 1.2rem;
  }
}
