* {
    box-sizing: border-box;
}

body {
    --background-color: white;
    --text-color: black;
    --elements-color: white;
    margin: 0;
    font-family: Nunito, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

body.dark {
    --background-color: hsl(207, 26%, 17%); 
    --text-color: white;
    --elements-color: hsl(209, 23%, 22%);
}

main {
    padding: 24px;
}

a {
    text-decoration-line: none;
    color: inherit;
}

.header-container {
    box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.1);
    padding-inline: 24px;
    background-color: var(--elements-color);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin-inline: auto;
}

.title {
    font-weight: 800;
}

.theme-changer {
    cursor: pointer;
}

.countries-container {
    max-width: 1200px;
    margin-top: 16px;
    display: flex;
    gap: 64px;
    flex-wrap: wrap;
    margin-inline: auto;
    justify-content: space-between;
}

.country-card {
    display: inline-block;
    width: 250px;
    border-radius: 8px;
    overflow: hidden;
    padding-bottom: 24px;
    box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease-in-out;
    background-color: var(--elements-color);
}

.country-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 16px 0px rgba(0, 0, 0, 0.2);
}

.card-title {
    font-size: 24px;
    margin-block: 16px;
}

.card-text {
    padding-inline: 16px;
}

.card-text p {
    margin-block: 8px;
}

.country-card img {
    width: 100%;
}


.search-filter-container {
    max-width: 1200px;
    margin-inline: auto;
    margin-top: 16px;
    margin-bottom: 48px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.search-container {
    box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    width: 100%;
    border-radius: 4px;
    padding-left: 24px;
    color: #999;
    overflow: hidden;
    background-color: var(--elements-color);
    color: var(--text-color);
}

.search-container input {
    border: none;
    outline: none;
    padding: 16px;
    width: 90%;
    background-color: inherit;
    color: inherit;
}

.search-container input::placeholder {
    color: #999;
}

.filter-by-region {
    width: 250px;
    padding: 16px;
    border: none;
    outline: none;
    box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background-color: var(--elements-color);
    color: var(--text-color);
}

@media(max-width: 768px) {
    .countries-container {
        justify-content: center;
    }

    .title {
        font-size: 16px;
    }

    .header-content p {
        font-size: 12px;
    }

    .search-filter-container {
        flex-direction: column;
    }
    
}
/* Shimmer Loader */
.shimmer-card {
  width: 250px;
  height: 300px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--elements-color) 25%,
    #e0e0e0 50%,
    var(--elements-color) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
/* Shimmer Loader Style */
.shimmer-card {
  width: 100%;
  height: 280px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    var(--elements-color) 25%,
    #e0e0e0 50%,
    var(--elements-color) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
