:root {
  --primary-color: #8b0000;
  --primary-light: #fbecec;
  --primary-hover: #6a0000;
  --bg-color: #f4f5f7;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #4a5568;
  --text-light: #a0aec0;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  --transition: all 0.2s ease-in-out;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.icon-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.header-icon {
  color: var(--primary-color);
}

.app-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.app-header .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.app-header .note {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* Filters */
.filters-container {
  max-width: 36rem;
  margin: 0 auto 2rem;
}

.search-bar {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background-color: var(--card-bg);
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.filter-dropdowns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-dropdowns select {
  flex: 1;
  min-width: 150px;
  padding: 0.625rem 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background-color: var(--card-bg);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 3rem;
  transition: var(--transition);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.filter-dropdowns select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

/* Stats */
.stats-container {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  max-width: fit-content;
}

/* Agency Grid */
.agency-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .agency-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .agency-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.agency-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  border: 1px solid var(--border-color);
}

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

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.agency-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.org-name {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}

.country-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  align-items: flex-start;
}

.info-icon {
  flex-shrink: 0;
  color: var(--text-light);
  margin-right: 0.625rem;
  margin-top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
}

.info-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.4;
}

.info-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.info-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Prefixes */
.prefix-toggle {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.prefix-toggle:hover {
  background-color: var(--primary-hover);
  transform: scale(1.1);
}

.prefix-dropdown {
  position: absolute;
  bottom: 3.5rem;
  right: 1rem;
  z-index: 10;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  width: 16rem;
  border: 1px solid var(--border-color);
}

.prefix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.prefix-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
}

.prefix-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.prefix-close:hover {
  color: var(--text-main);
}

.prefix-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.prefix-item {
  background-color: var(--bg-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-family: monospace;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  margin-top: 2rem;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border: none;
  background-color: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  background-color: var(--border-color);
  color: var(--text-main);
}

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

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-ellipsis {
  padding: 0 0.5rem;
  color: var(--text-light);
}

/* No Results */
.no-results {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-muted);
}

.no-results .sub-message {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* FAQ Section */
.faq-container {
  margin-top: 4rem;
  padding: 2.5rem;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.faq-container h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2rem;
  text-align: center;
}

.faq-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-question {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.faq-answer {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

