@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--primary);
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 1.5rem;
}

nav a:hover {
  color: var(--primary);
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

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

a:hover {
  text-decoration: underline;
}

#tool {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
  margin: 2rem 0;
}

.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

button:hover {
  background: var(--primary-dark);
}

button:active {
  transform: translateY(1px);
}

.result {
  background: white;
  border: 2px solid var(--primary);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.result-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  font-weight: 600;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.result-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 1rem;
}

.result-item-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.result-item-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
}

details {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-secondary);
}

summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

summary:hover {
  color: var(--primary);
}

details p {
  margin-top: 0.75rem;
  padding-left: 0.5rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s;
}

.tool-card:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.tool-card h3 {
  color: var(--text);
  margin: 0 0 0.5rem;
}

.tool-card p {
  color: var(--text-light);
  margin: 0;
}

.category-section {
  margin: 3rem 0;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.affiliate-list {
  margin: 1.5rem 0;
}

.affiliate-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.affiliate-info strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.affiliate-info span {
  color: var(--text-light);
  font-size: 0.875rem;
}

.affiliate-link {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.related-tools {
  margin: 1.5rem 0;
}

.related-tools a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.related-tools a:last-child {
  border-bottom: none;
}

.ad-slot {
  margin: 2rem 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

footer a {
  color: var(--text-light);
  margin: 0 1rem;
}

footer span {
  display: block;
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

@media (max-width: 640px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  #tool {
    padding: 1.5rem;
  }

  .result-value {
    font-size: 2rem;
  }

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

  nav a {
    margin-left: 1rem;
  }

  footer a {
    display: block;
    margin: 0.5rem 0;
  }
}
