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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9faff;
  color: #222;
}

#navigation {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: baseline;
  width: 100%;
}

a {
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  transition: color 0.25s ease;
  color: #fff;
  text-decoration: none;
}

#divider {
  height: 1.25rem;
  width: 0.1875rem;
  background-color: #ffffffaf;
  transform: scaleX(1.5);
}

.info-header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.info-header .favorite {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  align-items: center;
  justify-content: center;
}

header {
  background-color: #163172;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
  color: #fff;
  user-select: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

header h1 {
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  transition: color 0.25s ease;
  cursor: default;
}

header h1:hover {
  color: #a8cdfd;
}

button.remove {
  display: block;
  width: 100%;
  max-width: 43.75rem;
  height: 2.5rem;
  margin: 0 auto 2rem;
  background-color: #fff;
  color: #222;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

button.remove:hover {
  background-color: #ffffff;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.15);
}

.country-card {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  max-width: 43.75rem;
  margin: 0 auto 1.5rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.1);
}

.country-media {
  box-shadow: 0 0.125rem 0.375rem #1e56a03b;
  width: 7.5rem;
  height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 0.375rem;
}

.country-media img {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 0.375rem 0.375rem 0 0;
}

button.favorite {
  line-height: 20px;
  width: 100%;
  background-color: gold;
  border: none;
  padding: 0.4rem 0.5rem;
  border-radius: 0 0 0.375rem 0.375rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #000;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button.favorite:hover {
  background-color: #e6c200;
}

.country-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.country-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 0.5rem;
}

.country-info p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: #444;
  margin: 0;
}

.country-detail-card {
  position: relative;
  max-width: 56.25rem;
  margin: 2.5rem auto;
  padding: 1.25rem;
  padding-right: 15rem;
  background: #fff;
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
}

.country-detail-card .flag {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 12.5rem;
  max-width: 35%;
  height: auto;
  object-fit: contain;
  border-radius: 0.375rem;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.15);
}

.country-detail-card .country-info {
  padding-right: 13.75rem;
}

.country-detail-card .country-info h2 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 2.5rem;
  color: #111;
}

.country-detail-card .country-info p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.country-detail-card .country-info strong {
  color: #444;
}

.favorite i {
  color: #000;
  height: 100%;
}

.centered-message {
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 10rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.toolbar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto;
  max-width: 43.75rem;
  padding: 0;
  flex-wrap: wrap;
}

#search {
  flex: 3;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #222;
  background-color: #fff;
  border: 2px solid #1E56A0;
  border-radius: 0.5rem;
  height: 3.25rem;
}

.sort-dropdown {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: #222;
  background-color: #fff;
  border: 2px solid #1E56A0;
  border-radius: 0.5rem;
  height: 3.25rem;
}

#search:focus,
.sort-dropdown:focus {
  outline: none;
  border-color: #1E56A0;
  background-color: #F6F6F6;
}

.spinner {
  display: none;
  justify-content: center;
  align-items: center;
  height: 4rem;
  width: 4rem;
  margin: 2rem auto;
}

.spinner svg {
  animation: rotate 2s linear infinite;
  width: 100%;
  height: 100%;
}

.spinner .path {
  stroke: #357abd;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.filter-button {
  width: 3.25rem;
  height: 3.25rem;
  background-color: #fff;
  border: 2px solid #1E56A0;
  border-radius: 0.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #1E56A0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.filter-button:hover {
  background-color: #f0f4ff;
}

.filter-menu {
  position: absolute;
  top: 5.5rem;
  right: 1rem;
  background: white;
  border: 2px solid #1E56A0;
  border-radius: 0.5rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
  padding: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 12rem;
}

.filter-menu label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.filter-menu button {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: none;
  background-color: #1E56A0;
  color: white;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
}

.filter-menu button:hover {
  background-color: #163172;
}

.hidden {
  display: none;
}
