@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Space+Mono:wght@700&display=swap");
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Nunito Sans", "Space Mono", sans-serif;
}
:root {
  --bg-color: hsl(0, 0%, 98%);
  --text-color: hsl(200, 15%, 8%);
  /* --element-color: hsl(209, 23%, 22%); */
  --element-color: hsl(0, 0%, 100%);
  --secondary-text-color: hsl(0, 0%, 52%);
}
.dark-mode {
  --bg-color: hsl(207, 26%, 17%);
  --text-color: hsl(0, 0%, 100%);
  --secondary-text-color: hsl(0, 0%, 52%);
  /* --element-color: hsl(0, 0%, 52%); */
  --element-color: hsl(209, 23%, 22%);
}
body {
  font-family: "Space Mono", sans-serif;
  background-color: var(--bg-color);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--element-color);
  color: var(--text-color);
  padding: 1rem 2.7rem 1rem 2.7rem;
  width: 100%;
}
header #mode {
  display: flex;
  align-items: center;
  gap: 1rem;
}
header .dark-light-container:hover {
  cursor: pointer;
}

.search-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 2rem 2rem;
  width: 100%;
}
.search-container {
  display: flex;
  background-color: var(--element-color);
  gap: 1rem;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  width: 500px;
}
.search-container .material-symbols-outlined {
  color: var(--text-color);
}
.search-filter-bar .search-bar {
  width: 100%;
  background-color: var(--element-color);
  outline: none;
  color: var(--secondary-text-color);
  border: none;
  font-weight: 700;
}
.search-filter-bar .search-bar::placeholder {
  color: var(--secondary-text-color);
  font-weight: 700;
}
.search-filter-bar .search-bar:focus {
  outline: none;
  border: none;
}
#filter {
  padding: 1rem 2rem;
  padding-right: 3.5rem; /* Add extra padding on the right for the arrow */
  background-color: var(--element-color);
  color: var(--secondary-text-color);
  border-radius: 0.5rem;
  border: none;
  appearance: none; /* This ensures consistent arrow styling across browsers */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23CCCCCC%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.65em auto;
  cursor: pointer;
}
#countries-container {
  padding: 1rem 4.5rem;
  justify-content: left;
  display: flex;
  flex-wrap: wrap;
  gap: 4.1rem;
  text-align: left;
  border-radius: 1rem;
}
.country-card {
  width: 250px;
  padding-bottom: 1.5rem;
  border-radius: 0.3rem;
  background-color: var(--element-color);
  overflow: hidden;
}
.country-card:hover {
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.country-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center;
  margin-bottom: 0.5rem;
}
.country-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  padding-left: 1rem;
  color: var(--text-color);
}
.country-card p {
  font-size: 0.7rem;
  padding: 0.3rem 1rem;
  color: var(--text-color);
}

/* Second Page */

/* Main container */
.country-details-page {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
}

/* Back Button */
.back-btn {
  background-color: var(--element-color);
  color: var(--text-color);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

/* Second Page */
/* Country Details Container */
.country-details-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  justify-content: center;
}
.country-details-section {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 2rem;
}
/* Country Flag */
.country-flag img {
  width: 100%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
}

/* Country Info Box */
.country-info-box {
  max-width: 600px;
  display: flex;
  flex-direction: column;

  justify-content: center;
}

/* Country Name */
.country-name {
  color: var(--text-color);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Country Info Sections */
.country-info {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 1rem;
}
.country-info strong {
  color: var(--text-color) !important;
}
.country-info p {
  color: var(--secondary-text-color);
  margin: 0.5rem 0;
}

/* Border Countries Section */
.border-countries {
  margin-top: 2rem;
}

.border-countries p {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.border-countries-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.border-country {
  color: var(--text-color);
  background: var(--element-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
}
/* This is the class we are adding dynamically through JS */
.not-found-message {
  color: var(--text-color);
}

/* Responsive Design */
@media (max-width: 932px) {
  header h1 {
    font-size: 1rem;
  }
  #mode {
    font-size: 0.8rem;
    gap: 0.7rem;
  }
  #mode #light-mode-icon,
  #mode #dark-mode-icon {
    width: 19px;
    height: 19px;
  }
  .search-filter-bar {
    flex-direction: column;
    align-items: start;
  }
  .search-container {
    width: 100%;
  }
  #filter {
    padding-right: 3rem;
    width: 150px;
  }
  #filter option {
    font-size: 0.5rem;
  }
  .country-details-section {
    flex-direction: column;
  }
}
@media (max-width: 768px) {
  .country-details-container {
    flex-direction: column;
    align-items: center;
  }

  .country-info {
    flex-direction: column;
  }
}
