/* Modern minimalist black-and-white CSS - Enhanced alignment, hierarchy, and separation */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5; /* Tightened from 1.65 for denser text */
  color: #000;
  background-color: #fff;
}

/* Header and navigation - Aligned with main content */
header {
  border-bottom: 1px solid #000;
  padding: 20px; /* Reduced from 24px/20px for tighter look */
  margin-bottom: 24px; /* Reduced from 32px */
  max-width: 800px; /* Unified with main for consistent left alignment */
  margin-left: auto;
  margin-right: auto;
  background-color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

h1 {
  font-size: 24px;
  margin: 0 0 12px 0; /* Tighter margin for compactness */
  font-weight: 700; /* Bolder for hierarchy */
  letter-spacing: -0.3px;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px; /* Reduced from 16px for denser nav */
  row-gap: 6px;
}

nav ul li {
  margin: 0;
  white-space: nowrap;
}

nav ul li a {
  color: #000;
  text-decoration: none;
  font-size: 14px; /* Smaller for cleaner look */
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.2s, color 0.2s;
}

nav ul li a:hover {
  border-bottom: 1px solid #000;
  color: #333; /* Subtle hover contrast */
}

/* Main content - Aligned with header */
main {
  max-width: 800px; /* Matches header for left alignment */
  margin: 0 auto;
  padding: 0 20px 40px 20px; /* Reduced bottom padding from 48px */
}

/* Section spacing - Tighter with clearer separation */
section {
  margin-bottom: 32px; /* Reduced from 40px */
  padding-bottom: 20px; /* Reduced from 24px */
  border-bottom: 1px solid #e0e0e0; /* Lighter for subtlety */
}

section:last-child {
  border-bottom: none;
}

.blog-post {
  margin-bottom: 24px; /* Reduced from 32px */
}

/* Typography - Stronger hierarchy */
h2 {
  font-size: 24px;
  margin: 24px 0 12px 0; /* Tighter margins */
  font-weight: 700; /* Bolder for emphasis */
  letter-spacing: -0.3px;
  line-height: 1.2; /* Tighter for visual pop */
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 18px; /* Smaller for hierarchy */
  margin: 20px 0 8px 0; /* Tighter */
  font-weight: 600;
  letter-spacing: -0.2px;
}

h4 {
  font-size: 16px; /* Smaller */
  margin: 16px 0 6px 0;
  font-weight: 600;
}

/* Paragraphs - Tighter, better flow */
p {
  margin: 0 0 8px 0; /* Reduced from 10px */
  max-width: 100%;
}

p + p {
  margin-top: 0;
}

a {
  color: #000;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-thickness 0.15s, color 0.2s;
}

a:hover {
  text-decoration-thickness: 2px;
  color: #333; /* Subtle contrast */
}

strong {
  font-weight: 700; /* Bolder for emphasis */
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 24px 0; /* Reduced from 32px */
}

/* Code blocks - More distinct */
pre {
  background-color: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-left: 3px solid #000; /* Bolder left border */
  padding: 12px; /* Reduced from 16px */
  overflow-x: auto;
  margin: 16px 0; /* Reduced from 20px */
  font-size: 14px;
  line-height: 1.4;
}

code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Courier New', monospace;
  font-size: 14px;
}

p code, li code {
  background-color: #f8f8f8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px; /* Matches pre */
}

/* Callout boxes - Stronger separation */
.grey-bg {
  background-color: #f8f8f8;
  padding: 16px; /* Reduced from 20px */
  border-left: 3px solid #000; /* Bolder */
  margin: 20px 0; /* Reduced from 24px */
}

.card-subtle {
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  padding: 16px; /* Reduced from 20px */
  margin: 16px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
}

/* AI Tabs - Cleaner, more distinct */
.ai-tabs-container {
  margin: 20px 0; /* Reduced from 24px */
}

.simulation-note {
  background-color: #f8f8f8;
  border-left: 3px solid #000; /* Bolder */
  padding: 10px 14px; /* Tighter */
  margin: 0 0 12px 0; /* Reduced */
  font-size: 14px; /* Smaller */
}

.ai-tabs-header {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #000;
  margin-bottom: 16px; /* Reduced from 20px */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-tabs-header::-webkit-scrollbar {
  display: none;
}

.ai-tab-btn {
  background: none;
  border: none;
  padding: 10px 16px; /* Tighter */
  font-size: 14px; /* Smaller */
  font-weight: 600;
  cursor: pointer;
  color: #666;
  border-bottom: 2px solid transparent; /* Thinner */
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-tab-btn:hover {
  color: #000;
  background-color: #f8f8f8;
}

.ai-tab-btn.active {
  color: #000;
  border-bottom-color: #000;
}

.ai-tab-panel {
  display: none;
}

.ai-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Card layouts - More distinct */
.results-grid, .regions-grid, .pricing-grid, .blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* Tighter cards */
  gap: 20px; /* Reduced from 24px */
  margin: 16px 0; /* Unified */
}

.result-card, .region-card, .pricing-card, .blog-card {
  border: 1px solid #e0e0e0; /* Lighter border */
  padding: 20px; /* Reduced from 24px */
  background-color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover, .region-card:hover, .pricing-card:hover, .blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Stronger shadow */
}

.result-card h3, .region-card h3, .pricing-card h3, .blog-card h3 {
  margin: 0 0 10px 0; /* Tighter */
  font-size: 18px; /* Smaller */
  font-weight: 600;
}

.result-card h4, .region-card h4, .pricing-card h4, .blog-card h4 {
  margin: 12px 0 6px 0; /* Tighter */
  font-size: 16px;
}

.result-card p, .region-card p, .pricing-card p, .blog-card p {
  margin: 0 0 10px 0; /* Tighter */
  font-size: 15px; /* Smaller */
  line-height: 1.4;
}

.result-card p:last-child, .region-card p:last-child, .pricing-card p:last-child, .blog-card p:last-child {
  margin-bottom: 0;
}

.blog-date {
  color: #666;
  font-size: 13px; /* Smaller */
  margin-bottom: 6px;
}

/* Blog content */
.blog-content {
  max-width: 100%;
}

.blog-content h2 {
  margin-top: 32px; /* Reduced from 40px */
}

.blog-content h3 {
  margin-top: 24px; /* Reduced from 28px */
}

/* Lists */
ul, ol {
  margin: 12px 0; /* Reduced from 16px */
  padding-left: 20px; /* Reduced from 24px */
}

li {
  margin-bottom: 8px; /* Reduced from 10px */
  line-height: 1.5;
}

/* Tables - Cleaner, compact */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 16px 0; /* Reduced from 20px */
  border: 1px solid #e0e0e0; /* Lighter */
  font-size: 15px; /* Smaller */
}

table th, table td {
  border: 1px solid #e0e0e0;
  padding: 10px 12px; /* Reduced */
  text-align: left;
}

table th {
  background-color: #000;
  color: #fff;
  font-weight: 600;
  border-color: #000;
}

table td a {
  color: #000;
  text-decoration: underline;
}

/* Forms - More distinct */
form {
  max-width: 600px;
  margin: 16px 0; /* Reduced */
}

form label {
  display: block;
  margin-bottom: 16px; /* Reduced */
  font-weight: 600;
  font-size: 15px; /* Smaller */
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="url"],
form select,
form textarea {
  display: block;
  width: 100%;
  padding: 8px 10px; /* Reduced */
  margin-top: 4px; /* Reduced */
  border: 1px solid #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px; /* Smaller */
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15); /* Thinner */
}

form textarea {
  resize: vertical;
  line-height: 1.5;
}

form button {
  background-color: #000;
  color: #fff;
  border: none;
  padding: 10px 20px; /* Reduced */
  font-size: 15px; /* Smaller */
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  margin-top: 6px; /* Reduced */
}

form button:hover {
  background-color: #333;
}

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

/* Footer - Tighter, aligned */
footer {
  border-top: 1px solid #000;
  padding: 24px 20px; /* Reduced */
  text-align: left;
  font-size: 13px; /* Smaller */
  line-height: 1.5;
  margin-top: 40px; /* Reduced */
  max-width: 800px; /* Matches header/main */
  margin-left: auto;
  margin-right: auto;
  color: #333;
}

footer p {
  margin: 6px 0; /* Reduced */
}

footer a {
  color: #000;
}

/* Responsive design - Tighter for mobile */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  header {
    padding: 16px;
    margin-bottom: 20px; /* Reduced */
    position: relative;
  }

  h1 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 20px;
    margin: 20px 0 10px 0;
  }

  h3 {
    font-size: 17px;
    margin: 16px 0 6px 0;
  }

  nav {
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav ul {
    gap: 12px; /* Reduced */
    padding-bottom: 6px;
  }

  nav ul li a {
    font-size: 13px;
  }

  main {
    padding: 0 16px 32px 16px; /* Reduced */
  }

  section {
    margin-bottom: 24px; /* Reduced */
  }

  .results-grid, .regions-grid, .pricing-grid, .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px; /* Reduced */
  }

  .ai-tab-btn {
    padding: 8px 14px; /* Tighter */
    font-size: 13px;
  }

  footer {
    padding: 20px 16px; /* Reduced */
    margin-top: 32px; /* Reduced */
  }

  table {
    font-size: 14px;
    overflow-x: auto;
    display: block;
  }

  table th, table td {
    padding: 8px 10px;
  }

  pre {
    font-size: 13px;
    padding: 10px;
    margin: 12px -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  form {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  header {
    padding: 12px;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  nav {
    margin: 0 -12px;
    padding: 0 12px;
  }

  nav ul {
    gap: 10px;
  }

  nav ul li a {
    font-size: 12px;
  }

  main {
    padding: 0 12px 32px 12px;
  }
}

@media print {
  header {
    position: relative;
    border-bottom: 1px solid #000;
  }

  nav {
    display: none;
  }

  main {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .result-card, .region-card, .pricing-card, .blog-card {
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .ai-tabs-header {
    display: none;
  }

  .ai-tab-panel {
    display: block !important;
    page-break-inside: avoid;
  }
}