/* Underline current page */
header .header-inner .menu-container .menu .documentation:after {
  transform: translateX(-50%) scaleX(1);
}

.reference-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.reference-header {
  text-align: center;
  margin-bottom: 40px;
}

.reference-header h1 {
  margin: 30px 0 10px;
}

.reference-category {
  background: var(--whiteBackground, #f9fafb);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Grid layout for most common items */
.reference-category:first-of-type {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.reference-category:first-of-type h3 {
  grid-column: 1 / -1;
}

.reference-category:first-of-type .item-group {
  margin-bottom: 0;
}

.reference-category h3 {
  margin-bottom: 20px;
  padding-bottom: 5px;
  color: var(--primary-blue, #2563eb);
  border-bottom: 2px solid var(--primary-blue, #2563eb);
}

/* Main groups for featured/common items */
.item-group {
  margin-bottom: 25px;
  background: #ffffff;
  border-radius: 6px;
  padding: 15px;
  border: 1px solid #e5e7eb;
}

.item-group:last-child {
  margin-bottom: 0;
}

.item-group h4 {
  margin-bottom: 10px;
  color: #374151;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Small groups for alphabetical sections */
.item-group-small {
  margin-bottom: 15px;
  background: #ffffff;
  border-radius: 6px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  width: 100%;
}

.item-group-small h5 {
  margin-bottom: 8px;
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
}

/* Info sections for additional details */
.item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

/* Currency-specific styles */
.currency-symbol {
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--primary-blue, #2563eb);
  min-width: 40px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.currency-region,
.language-region {
  color: #6b7280;
  font-style: italic;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Countries list - grid layout for variants */
.items-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.items-list li {
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  transition: background-color 0.2s;
}

.primary-name {
  font-weight: 600;
  color: var(--primary-blue, #2563eb);
}

/* Alphabetical grid layout */
.alphabetical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.alphabet-section {
  background: #ffffff;
  border-radius: 6px;
  padding: 15px;
  border: 1px solid #e5e7eb;
  min-height: 180px;
}

.alphabet-section h4 {
  margin-bottom: 12px;
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  padding-bottom: 5px;
  border-bottom: 1px solid #e5e7eb;
}

/* Countries page specific - single column layout for alphabetical items */
.alphabet-section .items-list {
  grid-template-columns: 1fr;
  gap: 4px;
}

.alphabet-section .items-list li {
  background: #f8fafc;
  padding: 4px 8px;
  font-size: 13px;
}

/* Search functionality */
.search-box {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  margin: 20px auto;
  display: block;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.search-box:focus {
  outline: none;
  border-color: var(--primary-blue, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* No results message */
.no-results {
  background: var(--whiteBackground, #f9fafb);
  border-radius: 8px;
  padding: 40px 20px;
  margin: 20px 0 40px;
  text-align: center;
  border: 2px dashed #d1d5db;
}

.no-results-content h3 {
  color: #6b7280;
  margin-bottom: 15px;
  font-size: 1.25rem;
}

.no-results-content p {
  color: #6b7280;
  margin-bottom: 15px;
  font-size: 1rem;
}

.no-results-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 400px;
  margin: 0 auto;
}

.no-results-content ul li {
  background: #ffffff;
  padding: 8px 16px;
  margin: 8px 0;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  color: #374151;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary-blue, #2563eb);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

/* Info boxes and notes */
.pattern-note {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.pattern-note h3 {
  margin-bottom: 15px;
  color: var(--primary-blue, #2563eb);
}

.steps-list {
  list-style: none;
  counter-reset: step;
  margin: 15px 0;
  padding-left: 0;
}

.steps-list li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1rem;
  counter-increment: step;
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--primary-blue, #2563eb);
  color: white;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.info-box {
  background: #dbeafe;
  border-left: 4px solid var(--primary-blue, #2563eb);
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
}

.warning-box {
  background: var(--yellow-50, #fefce8);
  border: 1px solid #fbbf24;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
  font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
  .reference-container {
    padding: 15px;
  }

  .items-list {
    grid-template-columns: 1fr;
  }

  .alphabetical-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .search-box {
    max-width: 100%;
    margin: 15px 0;
  }

  .item-group,
  .item-group-small {
    padding: 12px;
  }

  .alphabet-section {
    padding: 12px;
  }

  .item-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .reference-header h1 {
    font-size: 1.5rem;
  }

  .reference-category {
    padding: 15px;
    margin-bottom: 20px;
  }

  .item-group {
    margin-bottom: 15px;
  }
}
