:root {
    /* Light theme (default) */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --text-color: #1f2937;
    --text-light: #4b5563;
    --background-color: #ffffff;
    --card-background: #f9fafb;
    --card-hover: #f3f4f6;
    --border-color: #e5e7eb;
    --hero-gradient-start: #dbeafe;
    --hero-gradient-end: #f0f9ff;
    --input-background: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --footer-background: #1f2937;
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-text-light: rgba(255, 255, 255, 0.5);
    --cta-background: #3b82f6;
    --cta-text: #ffffff;
  
    /* Spacing and other variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
    /* Transition for theme switching */
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }
  
  /* Dark theme variables */
  [data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #1e3a8a;
    --secondary-color: #34d399;
    --secondary-hover: #10b981;
    --text-color: #f9fafb;
    --text-light: #d1d5db;
    --background-color: #111827;
    --card-background: #1f2937;
    --card-hover: #374151;
    --border-color: #374151;
    --hero-gradient-start: #1e3a8a;
    --hero-gradient-end: #111827;
    --input-background: #1f2937;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --footer-background: #0f172a;
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-text-light: rgba(255, 255, 255, 0.5);
    --cta-background: #2563eb;
    --cta-text: #ffffff;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--theme-transition);
  }
  
  body {
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
  }
  
  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
  }
  
  /* Typography */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
  }
  
  h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
  }
  
  h2 {
    font-size: 2.25rem;
    margin-bottom: var(--spacing-sm);
  }
  
  h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
  }
  
  h4 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
  }
  
  p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
  }
  
  a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
  }
  
  a:hover {
    color: var(--primary-hover);
  }
  
  .highlight {
    color: var(--primary-color);
  }
  
  /* Buttons */
  .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
  }
  
  .btn-primary {
    background-color: var(--primary-color);
    color: white;
  }
  
  .btn-primary:hover {
    background-color: var(--primary-hover);
    color: white;
  }
  
  .btn-secondary {
    background-color: var(--background-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
  }
  
  .btn-secondary:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
  }
  
  /* Header & Navigation */
  header {
    background-color: var(--background-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
  }
  
  .logo i {
    margin-right: 0.5rem;
  }
  
  .nav-links {
    display: flex;
    gap: var(--spacing-md);
  }
  
  .nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
  }
  
  .nav-links a:hover,
  .nav-links a.active {
    color: var(--primary-color);
  }
  
  .nav-links a.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
  }
  
/* Nav Actions (Language Switcher + Theme Toggle) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
}
  
  #theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    background-color: var(--card-background);
    position: relative;
    overflow: hidden;
  }
  
  #theme-toggle-btn:hover {
    background-color: var(--card-hover);
  }
  
  #theme-toggle-btn i {
    font-size: 1.2rem;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  #theme-toggle-btn .fa-sun {
    opacity: 1;
    transform: translateY(0);
  }
  
  #theme-toggle-btn .fa-moon {
    opacity: 0;
    transform: translateY(20px);
  }
  
  [data-theme="dark"] #theme-toggle-btn .fa-sun {
    opacity: 0;
    transform: translateY(-20px);
  }
  
  [data-theme="dark"] #theme-toggle-btn .fa-moon {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Hero Section */
  .hero {
    padding: var(--spacing-xl) 0;
    background-color: var(--primary-light);
    background-image: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
  }
  
  .hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
  }
  
  .hero-content {
    max-width: 600px;
  }
  
  .hero-content h1 {
    margin-bottom: var(--spacing-sm);
  }
  
  .hero-content p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
  }
  
  .hero-cta {
    display: flex;
    gap: var(--spacing-sm);
  }
  
  .hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
  }
  
  /* Quick Convert Section */
  .quick-convert {
    padding: var(--spacing-lg) 0;
    margin-top: -3rem;
  }
  
  .converter-widget {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
  }
  
  .converter-widget h2 {
    text-align: center;
    margin-bottom: var(--spacing-md);
  }
  
  .converter-form {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .input-group {
    display: flex;
    flex: 1;
    min-width: 0;
  }
  
  .input-group input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1rem;
    background-color: var(--input-background);
    color: var(--text-color);
  }
  
  .input-group select {
    min-width: 120px;
    max-width: 180px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    background-color: var(--card-background);
    font-size: 1rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .swap-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
  }
  
  .swap-icon:hover {
    background-color: var(--primary-color);
    color: white;
  }
  
  /* History Section */
  .history-section {
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-md);
  }
  
  .history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
  }
  
  .history-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0;
  }
  
  .btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
  }
  
  .btn-text:hover {
    color: var(--primary-hover);
    background-color: var(--primary-light);
  }
  
  .history-list {
    max-height: 200px;
    overflow-y: auto;
    border-radius: var(--border-radius);
    background-color: var(--card-background);
  }
  
  .history-item {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
  }
  
  .history-item:last-child {
    border-bottom: none;
  }
  
  .history-item:hover {
    background-color: var(--card-hover);
  }
  
  .history-conversion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
  }
  
  .history-value {
    font-weight: 500;
  }
  
  .history-unit {
    color: var(--text-light);
  }
  
  .history-arrow {
    color: var(--primary-color);
    margin: 0 0.25rem;
  }
  
  .history-actions {
    display: flex;
    gap: 0.5rem;
  }
  
  .history-action {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
  }
  
  .history-action:hover {
    background-color: var(--primary-light);
  }
  
  .empty-history {
    padding: var(--spacing-sm);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
  }
  
  /* Section Headers */
  .section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
  }
  
  .section-header h2 {
    margin-bottom: var(--spacing-xs);
  }
  
  /* Conversion Tools */
  .conversion-tools {
    padding: var(--spacing-xl) 0;
  }
  
  .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
  }
  
  .tool-card {
    display: flex;
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
  }
  
  .tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background-color: var(--card-hover);
  }
  
  .tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    border-radius: 50%;
    margin-right: var(--spacing-sm);
  }
  
  .tool-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
  }
  
  .tool-content {
    flex: 1;
  }
  
  .tool-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
  }
  
  .tool-content p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
  }
  
  .tool-cta {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
  }
  
  .tool-cta i {
    margin-left: 0.25rem;
    transition: transform 0.2s;
  }
  
  .tool-card:hover .tool-cta i {
    transform: translateX(4px);
  }
  
  /* Popular Conversions */
  .popular-conversions {
    padding: var(--spacing-xl) 0;
    background-color: var(--card-background);
  }
  
  .popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
  }
  
  .popular-item {
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
  }
  
  .popular-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  
  .popular-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
  }
  
  .popular-item p {
    font-size: 0.875rem;
    margin-bottom: 0;
  }
  
  /* Features Section */
  .features {
    padding: var(--spacing-xl) 0;
  }
  
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
  }
  
  .feature-card {
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all 0.2s;
  }
  
  .feature-card:hover {
    background-color: var(--card-background);
  }
  
  .feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background-color: var(--primary-light);
    border-radius: 50%;
    margin: 0 auto var(--spacing-sm);
  }
  
  .feature-icon i {
    font-size: 1.75rem;
    color: var(--primary-color);
  }
  
  .feature-card h3 {
    margin-bottom: 0.5rem;
  }
  
  .feature-card p {
    font-size: 0.875rem;
  }
  
  /* CTA Section */
  .cta-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--cta-background);
    color: var(--cta-text);
    text-align: center;
  }
  
  .cta-section h2 {
    color: white;
    margin-bottom: var(--spacing-xs);
  }
  
  .cta-section p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-section .btn-primary {
    background-color: white;
    color: var(--primary-color);
  }
  
  .cta-section .btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
  }
  
  /* Footer */
  footer {
    background-color: var(--footer-background);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-sm);
  }
  
  .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }
  
  .footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-sm);
  }
  
  .footer-logo i {
    margin-right: 0.5rem;
  }
  
  .footer-col h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
    font-size: 1.125rem;
  }
  
  .footer-col ul {
    list-style: none;
  }
  
  .footer-col ul li {
    margin-bottom: 0.5rem;
  }
  
  .footer-col ul li a {
    color: var(--footer-text);
    transition: color 0.2s;
  }
  
  .footer-col ul li a:hover {
    color: white;
  }
  
  .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
  }
  
  .footer-bottom p {
    color: var(--footer-text-light);
    font-size: 0.875rem;
    margin-bottom: 0;
  }
  
  /* Responsive Styles */
  @media (max-width: 992px) {
    h1 {
      font-size: 2.5rem;
    }
  
    h2 {
      font-size: 2rem;
    }
  
    .hero-container {
      grid-template-columns: 1fr;
    }
  
    .hero-image {
      order: -1;
    }
  
    .converter-form {
      flex-direction: column;
      align-items: stretch;
    }
  
    .input-group {
      width: 100%;
    }
  
    .input-group select {
      max-width: none;
    }
  
    .swap-icon {
      align-self: center;
      transform: rotate(90deg);
      margin: var(--spacing-xs) 0;
    }
  }
  
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    flex-direction: column;
    padding: var(--spacing-sm);
    box-shadow: var(--shadow-md);
    gap: 0;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links a {
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .tools-grid,
  .popular-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .logo-text {
    display: none;
  }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.menu-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  nav {
    position: relative;
  }
}

/* Compact Hero for Landing Page */
.hero-compact {
  padding: var(--spacing-lg) 0 var(--spacing-md);
  text-align: center;
}

.hero-compact h1 {
  font-size: 2rem;
  margin-bottom: 0;
  color: var(--text-color);
}

/* Large Tools Grid for Landing Page */
.tools-grid-large {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.tools-grid-large .tool-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-md);
}

.tools-grid-large .tool-icon {
  width: 80px;
  height: 80px;
  margin-right: 0;
  margin-bottom: var(--spacing-sm);
}

.tools-grid-large .tool-icon i {
  font-size: 2rem;
}

.tools-grid-large .tool-content h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.tools-grid-large .tool-content p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

@media (max-width: 992px) {
  .tools-grid-large {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .tools-grid-large {
    grid-template-columns: 1fr;
  }

  .tools-grid-large .tool-card {
    flex-direction: row;
    text-align: left;
    padding: var(--spacing-md);
  }

  .tools-grid-large .tool-icon {
    width: 60px;
    height: 60px;
    margin-right: var(--spacing-sm);
    margin-bottom: 0;
  }

  .tools-grid-large .tool-content h2 {
    font-size: 1.25rem;
  }
}

/* Quick Reference Styling */
.popular-conversions h2 {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.popular-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popular-label {
  font-weight: 600;
  color: var(--text-color);
}

.popular-value {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9rem;
  color: var(--primary-color);
  background-color: var(--primary-light);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Simple Footer */
.footer-simple {
  text-align: center;
  padding: var(--spacing-md) 0;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.footer-links a {
  color: var(--footer-text);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: white;
}

.footer-simple p {
  color: var(--footer-text-light);
  font-size: 0.875rem;
  margin-bottom: 0;
}
