/*
(c) Spacehubs Africa. All rights reserved.
Licensed under the Proprietary License found in the LICENSE file
in the root directory of this source tree.
*/

.country-tab-nav { display: flex; gap: 0.375rem; overflow-x: auto; white-space: nowrap; padding-bottom: 0.25rem; }
.country-tab-nav::-webkit-scrollbar { height: 4px; }
.country-tab-nav::-webkit-scrollbar-track { background: transparent; }
.country-tab-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9999px; }
.country-tab-nav::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.country-tab-nav .tab-btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: var(--surface-subtle);
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.country-tab-nav .tab-btn:hover:not([data-locked]) { background: var(--border); color: var(--text-primary); }
.country-tab-nav .tab-btn[data-locked] { opacity: 0.8; }
.country-tab-nav .tab-btn[data-locked]:hover { background: var(--color-sha-gold-bg); color: var(--color-sha-gold-text); }

@media (pointer: coarse) {
  .country-tab-nav .tab-btn { min-height: 2.75rem; }
}

.country-analysis-section {
  margin-top: 1rem;
}

.country-analysis-section__header {
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.country-analysis-section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-sha-indigo);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
}

.country-analysis-section__title {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

.country-analysis-section__copy {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
  margin: 0.375rem 0 0;
  max-width: 48rem;
}

.country-analysis-subhead {
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-top: 1.75rem;
  padding-bottom: 0.5rem;
  text-transform: uppercase;
}

.country-analysis-subhead--inline {
  border-bottom: 0;
  margin-top: 0;
  padding-bottom: 0;
}

.country-chart-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1rem;
}

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

@media (min-width: 1280px) {
  .country-chart-grid--signals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.country-chart-card {
  background: var(--surface-raised);
  border-color: var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px var(--shadow-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.country-chart-card .chart-card__body {
  flex: auto;
}

.country-chart-card--full {
  grid-column: 1 / -1;
}

.country-chart-card .chart-card__header {
  margin-bottom: 0.875rem;
}

.country-chart-card .chart-card__title {
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
}

.country-chart-card .chart-card__description {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.country-chart-card .chart-skeleton {
  background-color: var(--surface-muted);
  border-radius: 0.625rem;
}

.country-chart-card .chart-skeleton.loaded {
  background-color: transparent;
}

.country-segment {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.country-segment__button {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0.375rem 0.75rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.country-segment__button:hover {
  background: var(--color-sha-indigo-bg);
  border-color: var(--color-sha-indigo-border);
  color: var(--color-sha-indigo-text);
}

.country-segment__button.is-active {
  background: var(--color-sha-indigo-bg);
  border-color: var(--color-sha-indigo-border);
  color: var(--color-sha-indigo-text);
}

.country-chart-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.country-chart-list__row {
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  background: var(--surface-muted);
  padding: 0.625rem 0.75rem;
}

.country-chart-list__meta {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.country-chart-list__label {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-chart-list__value {
  color: var(--text-primary);
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.country-chart-list__bar {
  background: var(--border);
  border-radius: 999px;
  height: 0.25rem;
  margin-top: 0.5rem;
  overflow: hidden;
}

.country-chart-list__fill {
  background: var(--color-sha-indigo);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 0.25rem;
}

.country-chart-empty {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 0.8125rem;
  height: 100%;
  justify-content: center;
  min-height: 5rem;
  padding: 1rem;
  text-align: center;
}

.country-chart-card .chart-card__body.country-chart-empty-body {
  height: auto !important;
  min-height: 5rem;
}

/* Chart-upsell card (`.premium-teaser*`) now lives in base.css so it is shared
   across country pages and the database overview upsell. */
.country-tab-nav .tab-btn[data-tab="overview"].active    { background: var(--color-sha-sky-bg);    color: var(--color-sha-sky-text);    border-color: var(--color-sha-sky-border);    font-weight: 600; }
.country-tab-nav .tab-btn[data-tab="growth"].active      { background: var(--color-sha-green-bg);  color: var(--color-sha-green-text);  border-color: var(--color-sha-green-border);  font-weight: 600; }
.country-tab-nav .tab-btn[data-tab="industry"].active    { background: var(--color-sha-gold-bg);   color: var(--color-sha-gold-text);   border-color: var(--color-sha-gold-border);   font-weight: 600; }
.country-tab-nav .tab-btn[data-tab="infrastructure"].active { background: var(--color-sha-teal-bg); color: var(--color-sha-teal-text); border-color: var(--color-sha-teal-border);    font-weight: 600; }
.country-tab-nav .tab-btn[data-tab="academia"].active   { background: var(--color-sha-purple-bg); color: var(--color-sha-purple-text); border-color: var(--color-sha-purple-border); font-weight: 600; }

.country-rail-nav .country-tab-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: visible;
  padding-bottom: 0;
  white-space: normal;
}

.country-rail-nav .country-tab-nav .tab-btn {
  min-height: 2.5rem;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.country-entity-bar--default { background: var(--color-sha-indigo); }
.country-entity-bar--companies { background: var(--color-sha-gold); }
.country-entity-bar--satellites { background: var(--color-sha-green); }
.country-entity-bar--ground-stations { background: var(--color-sha-sky); }
.country-entity-bar--agencies { background: var(--color-sha-red); }
.country-entity-bar--universities { background: var(--color-sha-purple); }
.country-entity-bar--clubs { background: var(--color-sha-stone); }
.country-entity-bar--nonprofits { background: var(--color-sha-orange); }

/* Modern ranked-list bars — plain row style matching Ecosystem Mix */
.analytics-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.analytics-ranked-list__item {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  text-align: left;
  transition: background-color 0.15s ease;
}

a.analytics-ranked-list__item:hover,
button.analytics-ranked-list__item:hover {
  background: var(--surface-subtle);
}

.analytics-ranked-list__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.analytics-ranked-list__label {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranked-list__detail {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-overflow: ellipsis;
}

.analytics-ranked-list__value {
  flex-shrink: 0;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
}

.analytics-ranked-list__track {
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--surface-muted);
}

.analytics-ranked-list__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.analytics-ranked-list__empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}
