@font-face {
  src: url("../assets/WorkSans-Regular.ttf");
  font-family: "Work Sans";
}

body {
  font-family: "Work Sans";
  margin: 0;
  padding: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Navigation Bar */
#navigation {
  background-color: #40b36e;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 10px 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px;
  position: relative;
}

.nav-title {
  margin: 0;
  font-size: 1.5em;
}

.nav-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-button {
  background-color: transparent;
  border: 1px solid white;
  color: white;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-family: "Work Sans";
  font-size: 14px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.nav-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-button.active {
  background-color: white;
  color: #40b36e;
}

.nav-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
  transition: all 0.3s ease;
}

.nav-button.active .nav-icon {
  filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2476%) hue-rotate(142deg) brightness(119%)
    contrast(119%);
}

/* Map Page */
#map-container {
  position: relative;
}

#map-fullscreen {
  width: 100%;
  height: 100%;
  text-align: left;
}

/* Stats Page */
#stats-content {
  padding: 20px;
}

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

#charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
}

/* Home Page */
#content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

#map span {
  display: inline-block;
  width: 30%;
  text-align: center;
}

/* make sure chart colors are similar to the ones used in js */

#charts figcaption ul li:nth-child(1) span {
  color: #59a14f;
}

#charts figcaption ul li:nth-child(2) span {
  color: #f28e2c;
}

#charts figcaption ul li:nth-child(3) span {
  color: #e15759;
}

#charts figcaption ul li:nth-child(4) span {
  color: #4e79a7;
}

#charts figcaption ul li:nth-child(5) span {
  color: #edc949;
}

a.link {
  color: #fff;
  text-decoration: none;
  background-color: #40b36e;
  border-radius: 5px;
  padding: 0.2em;
  margin: 0.2em auto 0.2em;
  display: inline-block;
}

a.facebook {
  background-color: #3b5998;
}

a.youtube {
  background-color: #e15759;
}

a.mail {
  background-color: #f28e2c;
}

ul {
  list-style: none;
  padding: 0;
}

footer h2 {
  margin-bottom: 0px;
}

footer p {
  margin-top: 0px;
  font-size: 0.8em;
}

div#charts li {
  text-decoration: none;
}

/* Map Search Styles */
.map-search-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  width: 300px;
}

#church-search {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  font-family: "Work Sans";
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#church-search:focus {
  outline: none;
  border-color: #40b36e;
  box-shadow: 0 2px 4px rgba(64, 179, 110, 0.2);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.search-result {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.search-result:hover {
  background-color: #f5f5f5;
}

.search-result:last-child {
  border-bottom: none;
}

.search-result-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 2px;
}

.search-result-address {
  font-size: 12px;
  color: #666;
}

.search-no-results {
  padding: 10px;
  color: #666;
  font-style: italic;
  text-align: center;
}

.pie-chart {
  width: 100%;
  max-width: 200px;
  height: 200px;
  margin: 0 auto;
  overflow: visible;
  position: relative;
}

figure {
  display: block;
  text-align: center;
}

figcaption {
  font-size: smaller;
  text-align: center;
  margin-top: 10px;
}

/* Monthly Chart */
#monthly-chart {
  margin-bottom: 40px;
}

#monthly-chart h3 {
  text-align: center;
  margin-bottom: 20px;
}

#monthly-chart-container {
  max-width: 800px;
  margin: 0 auto;
  height: 300px;
}

/* City Ranking Table */
#city-ranking {
  margin-bottom: 40px;
}

#city-ranking h3 {
  text-align: center;
  margin-bottom: 20px;
}

.city-table-container {
  max-width: 600px;
  margin: 0 auto;
  overflow-x: auto;
}

.city-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.city-table th {
  background-color: #40b36e;
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

.city-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

.city-table tbody tr:hover {
  background-color: #f8f9fa;
}

.city-table tbody tr:last-child td {
  border-bottom: none;
}

.city-table .rank {
  font-weight: bold;
  color: #40b36e;
  text-align: center;
  width: 80px;
}

.city-table .city-name {
  font-weight: 500;
}

.city-table .count {
  text-align: right;
  font-weight: 600;
  color: #666;
}
