/* CSS Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color System */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  --secondary-50: #f0fdf4;
  --secondary-500: #22c55e;
  --secondary-600: #16a34a;
  
  --accent-500: #f97316;
  --accent-600: #ea580c;
  
  --success-500: #10b981;
  --warning-500: #f59e0b;
  --error-500: #ef4444;
  
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;
  
  /* Spacing System (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  
  /* Typography */
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;
  --font-size-4xl: 36px;
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* Transitions */
  --transition: all 0.2s ease-in-out;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--leading-normal);
  color: var(--neutral-800);
  background-color: var(--neutral-50);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
  color: var(--neutral-900);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

p {
  margin-bottom: var(--space-3);
  color: var(--neutral-600);
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  padding: var(--space-8) 0;
}

.section-alt {
  background-color: white;
}

/* Header Styles */
.header {
  background-color: white;
  border-bottom: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}

.logo {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
}

.logo:hover {
  color: var(--primary-700);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-item {
  position: relative;
}

.nav-link {
  padding: var(--space-2);
  color: var(--neutral-700);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  background-color: var(--neutral-100);
  color: var(--primary-600);
  text-decoration: none;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--neutral-700);
  border-bottom: 1px solid var(--neutral-100);
  transition: var(--transition);
}

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

.dropdown-item:hover {
  background-color: var(--neutral-50);
  color: var(--primary-600);
  text-decoration: none;
}

/* Mobile Navigation */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  color: var(--neutral-700);
  cursor: pointer;
  padding: var(--space-1);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  text-align: center;
  padding: var(--space-10) 0;
}

.hero h1 {
  color: white;
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-3);
}

.hero p {
  font-size: var(--font-size-lg);
  color: var(--primary-100);
  margin-bottom: var(--space-6);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-500);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--font-size-lg);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.cta-button:hover {
  background-color: var(--accent-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: white;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Card Components */
.card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  color: var(--neutral-900);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

.card-description {
  color: var(--neutral-600);
  margin-bottom: 0;
}

/* Converter Components */
.converter {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin: var(--space-6) 0;
}

.converter-form {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-4);
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0; /* Allow flex items to shrink */
}

.form-label {
  font-weight: 600;
  color: var(--neutral-700);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  padding: var(--space-2);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  transition: var(--transition);
  background-color: white;
  width: 100%;
  min-width: 0; /* Allow inputs to shrink */
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.swap-btn {
  background-color: var(--primary-500);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: var(--font-size-lg);
}

.swap-btn:hover {
  background-color: var(--primary-600);
  transform: rotate(180deg);
}

/* Button Components */
.btn {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-500);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-600);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--neutral-200);
  color: var(--neutral-700);
}

.btn-secondary:hover {
  background-color: var(--neutral-300);
  color: var(--neutral-800);
  text-decoration: none;
}

/* Table Components */
.table-container {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: var(--space-4) 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--neutral-200);
}

.table th {
  background-color: var(--neutral-100);
  font-weight: 600;
  color: var(--neutral-800);
}

.table tr:hover {
  background-color: var(--neutral-50);
}

/* Breadcrumb */
.breadcrumb {
  padding: var(--space-3) 0;
  font-size: var(--font-size-sm);
  color: var(--neutral-500);
}

.breadcrumb a {
  color: var(--neutral-600);
}

.breadcrumb a:hover {
  color: var(--primary-600);
}

/* Ad Space Placeholders */
.ad-space {
  background-color: var(--neutral-100);
  border: 2px dashed var(--neutral-300);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  color: var(--neutral-500);
  font-size: var(--font-size-sm);
  margin: var(--space-6) 0;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-space-horizontal {
  min-height: 90px;
}

/* Footer */
.footer {
  background-color: var(--neutral-900);
  color: var(--neutral-300);
  padding: var(--space-8) 0 var(--space-4);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.footer-section h3 {
  color: white;
  margin-bottom: var(--space-3);
}

.footer-link {
  display: block;
  color: var(--neutral-400);
  padding: var(--space-1) 0;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-400);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid var(--neutral-700);
  padding-top: var(--space-4);
  text-align: center;
  color: var(--neutral-500);
  font-size: var(--font-size-sm);
}

/* FAQ Accordion */
.faq-item {
  background-color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.faq-question {
  background: none;
  border: none;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--neutral-800);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:hover {
  background-color: var(--neutral-50);
}

.faq-answer {
  padding: 0 var(--space-4) var(--space-4);
  color: var(--neutral-600);
  line-height: var(--leading-relaxed);
}

.faq-icon {
  transition: var(--transition);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: var(--space-6);
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  padding-left: var(--space-6);
  border: 2px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--neutral-400);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --font-size-4xl: 28px;
    --font-size-3xl: 24px;
    --font-size-2xl: 20px;
  }
  
  .container {
    padding: 0 var(--space-2);
  }
  
  .header-content {
    padding: var(--space-2) 0;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid var(--neutral-200);
    flex-direction: column;
    padding: var(--space-2);
    box-shadow: var(--shadow-lg);
  }
  
  .nav.active {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--neutral-200);
    margin-top: var(--space-1);
  }
  
  .hero {
    padding: var(--space-8) 0;
  }
  
  .converter-form {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-6) 0;
  }
  
  .hero {
    padding: var(--space-6) 0;
  }
  
  .card,
  .converter {
    padding: var(--space-3);
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}