/**
 * Africa's AI Compass Styling
 * Premium dark mode styling using Kini's brand colors
 */

/* Container & Layout */
.compass-page {
  padding: 60px 0;
  background-color: #1D1D1D;
  color: #FFFFFF;
}

.compass-header {
  margin-bottom: 40px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.compass-title-badge {
  display: inline-block;
  font-family: "Unbounded", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #adebe7;
  margin-bottom: 12px;
}

.compass-title {
  font-family: "Unbounded", sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.compass-tagline {
  font-family: "Rethink Sans", sans-serif;
  font-size: clamp(18px, 2.5vw, 22px);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.compass-intro {
  font-family: "Rethink Sans", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
}

.compass-intro p {
  margin-bottom: 15px;
}

.compass-signoff {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  margin-top: 20px;
  font-style: italic;
}

.compass-read-more-btn {
  background: #adebe7;
  color: #1D1D1D !important;
  border: 2px solid #adebe7;
  border-radius: 30px;
  padding: 12px 28px;
  font-family: "Unbounded", sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-block;
  margin-top: 15px;
  transition: all 0.3s ease;
}

.compass-read-more-btn:hover {
  background: transparent;
  color: #adebe7 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(173, 235, 231, 0.2);
  text-decoration: none;
}


/* Layer Navigation (Switcher) */
.compass-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.compass-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.compass-tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(173, 235, 231, 0.4);
  transform: translateY(-2px);
}

.compass-tab.active {
  background: linear-gradient(135deg, rgba(173, 235, 231, 0.15) 0%, rgba(125, 211, 207, 0.05) 100%);
  border-color: #adebe7;
  box-shadow: 0 0 20px rgba(173, 235, 231, 0.1);
}

.compass-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #adebe7;
}

.tab-label {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.compass-tab.active .tab-label {
  color: #adebe7;
}

.tab-desc {
  display: block;
  font-family: "Rethink Sans", sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.compass-tab:hover .tab-desc {
  color: rgba(255, 255, 255, 0.7);
}

.compass-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}

.soon-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}


/* Active Layer Description Bar */
.layer-description-bar {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  padding: 12px 20px;
  margin-bottom: 30px;
  border-left: 3px solid rgba(173, 235, 231, 0.5);
}

.layer-description-bar p {
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}


/* Main Grid Layout */
.compass-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

@media (min-width: 1024px) {
  .compass-grid {
    grid-template-columns: 1fr 360px;
  }
}


/* Interactive Map Panel */
.compass-map-col {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 450px;
}

.compass-map-wrapper {
  width: 100%;
  max-width: 600px;
  height: auto;
  position: relative;
}

.compass-map-tip {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* SVG Styling */
.compass-map-wrapper svg {
  width: 100%;
  height: auto;
  display: block;
}

.compass-map-wrapper svg path {
  fill: #2C2C2C;
  stroke: #1D1D1D;
  stroke-width: 1.5px;
  cursor: pointer;
  transition: all 0.25s ease;
}

/* Hover State */
.compass-map-wrapper svg path:hover {
  fill: rgba(173, 235, 231, 0.8) !important;
  stroke: #FFFFFF;
  stroke-width: 2px;
  filter: drop-shadow(0 0 10px rgba(173, 235, 231, 0.4));
}

/* Active Selected State */
.compass-map-wrapper svg path.active-country {
  fill: #adebe7 !important;
  stroke: #FFFFFF;
  stroke-width: 2px;
  filter: drop-shadow(0 0 15px rgba(173, 235, 231, 0.6));
}

/* Map hover tooltip */
.map-tooltip {
  position: absolute;
  padding: 8px 12px;
  background: #0D0D0D;
  border: 1px solid rgba(173, 235, 231, 0.3);
  color: #FFFFFF;
  font-family: "Rethink Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  z-index: 100;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}


/* Filters Box Column */
.compass-filters-col {
  position: sticky;
  top: 100px;
}

.compass-filters-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.filters-title {
  font-family: "Unbounded", sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  color: #adebe7;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group label {
  display: block;
  font-family: "Rethink Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

/* Custom Search Input */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 11px 36px 11px 16px;
  border-radius: 6px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
}

.search-input-wrapper input:focus {
  border-color: #adebe7;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.search-clear-btn:hover {
  color: #FFFFFF;
  transform: none;
}

/* Dropdown styling */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '↓';
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 11px 35px 11px 16px;
  border-radius: 6px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  appearance: none;
  cursor: pointer;
}

.filter-group select:focus {
  border-color: #adebe7;
  outline: none;
}

.filter-group select option {
  background: #1D1D1D;
  color: #FFFFFF;
  padding: 10px;
}

/* Direct AI reference toggle switch */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 6px;
}

.switch-label {
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.switch-label strong {
  font-size: 13px;
  color: #ffffff;
}

.switch-label small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: #adebe7;
}

input:focus + .slider {
  box-shadow: 0 0 1px #adebe7;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Reset Button */
.btn-reset {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reset:hover {
  border-color: #adebe7;
  color: #adebe7;
  background: rgba(173, 235, 231, 0.05);
  transform: translateY(-1px);
}


/* Results List Section */
.compass-results-section {
  margin-top: 50px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.results-heading {
  font-family: "Unbounded", sans-serif;
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 600;
}

.results-count {
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

/* Loader spinner */
.compass-loader {
  text-align: center;
  padding: 60px 0;
  color: rgba(255, 255, 255, 0.6);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #adebe7;
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto 15px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results Grid Cards */
.results-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

.compass-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.compass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(173, 235, 231, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Card Badges */
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.card-badge {
  font-family: "Rethink Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.card-badge-focus {
  background: rgba(173, 235, 231, 0.08);
  color: #adebe7;
  border: 1px solid rgba(173, 235, 231, 0.15);
}

.card-badge-verified {
  background: rgba(34, 113, 177, 0.2);
  color: #55b7ff;
  border: 1px solid rgba(34, 113, 177, 0.3);
}

.card-year {
  margin-left: auto;
  font-family: "Unbounded", sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
}

/* Card Header */
.card-title {
  font-family: "Rethink Sans", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #FFFFFF;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: #adebe7;
  transform: none;
}

.card-meta {
  font-family: "Rethink Sans", sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-issuing-body {
  color: rgba(255, 255, 255, 0.6);
}

.card-divider {
  color: rgba(255, 255, 255, 0.15);
}

/* Card Body */
.card-summary {
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  flex: 1;
}

/* Card Action Footer */
.card-footer {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.btn-card-action {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-card-primary {
  background: #adebe7;
  color: #1D1D1D;
  border: 1px solid #adebe7;
}

.btn-card-primary:hover {
  background: #7dd3cf;
  border-color: #7dd3cf;
  color: #000000;
  transform: translateY(-1px);
}

.btn-card-secondary {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-card-secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Empty State */
.compass-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  grid-column: 1 / -1;
}

.compass-empty-state h3 {
  font-family: "Unbounded", sans-serif;
  font-size: 18px;
  margin-bottom: 10px;
}

.compass-empty-state p {
  font-family: "Rethink Sans", sans-serif;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}


/* Pagination UI Controls */
.compass-pagination-nav {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

@media (min-width: 768px) {
  .compass-pagination-nav {
    flex-direction: row;
    justify-content: space-between;
  }
}

.pagination-label {
  font-family: "Rethink Sans", sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.btn-pag {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-radius: 6px;
  font-family: "Rethink Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-pag:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(173, 235, 231, 0.4);
  color: #adebe7;
}

.btn-pag:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Responsive/Mobile updates for categories (pills) & collapsible filters */

/* Collapsible Filter Styles */
.filters-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.filters-title-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.filters-main-title {
  font-family: "Unbounded", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #adebe7;
}

.filters-summary-text {
  font-family: "Rethink Sans", sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: normal;
  transition: opacity 0.3s ease;
}

.compass-filters-box:not(.collapsed) .filters-summary-text {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin-top: 0;
}

.compass-filters-box.collapsed .filters-summary-text {
  opacity: 1;
  height: auto;
  margin-top: 4px;
}

.filters-toggle-arrow {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  margin-right: 4px;
}

.compass-filters-box.collapsed .filters-toggle-arrow {
  transform: rotate(-135deg);
}

.filters-expandable-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
  opacity: 1;
  margin-top: 15px;
}

.compass-filters-box.collapsed .filters-expandable-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-bottom: 0;
}

.compass-filters-box.collapsed .filters-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Desktop single line description styling */
@media (min-width: 1024px) {
  .compass-header {
    max-width: 1200px;
  }
  .compass-intro p {
    white-space: nowrap;
  }
}


@media (max-width: 767px) {
  /* Category tabs as pills on mobile */
  .compass-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    width: 100%;
    scroll-snap-type: x mandatory;
  }
  
  .compass-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
  
  .compass-tab {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 30px; /* pill shape */
    text-align: center;
    scroll-snap-align: start;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
  }
  
  .compass-tab .tab-desc {
    display: none; /* Hide descriptions to keep them pill-sized */
  }
  
  .compass-tab .tab-label {
    margin-bottom: 0;
    font-size: 13px;
  }
  
  .compass-tab.active::before {
    display: none; /* Hide vertical indicator bar on mobile pills */
  }
  
  .compass-tab .soon-badge {
    position: static;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 3px;
  }
}

