@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #f5f5f5;
}

/* Header */
header {
  text-align: center;
  padding: 30px 20px;
}

header h1 {
  margin-bottom: 10px;
}

header p {
  color: #555;
}

/* Gallery */
.gallery-container {
  background-color: #263c79;
  margin: 40px auto;
  width: 90%;
  max-width: 1400px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 15px 20px 35px rgba(0, 0, 0, 0.3);

  /* Grid Layout */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.image-container {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 8px;
  transition: .3s;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 3px solid white;
  cursor: pointer;
  transition: transform .4s ease, box-shadow .4s ease;
}

.image-container img:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  transform: scale(1.08);
}

.controls {
  width: 90%;
  max-width: 1400px;
  margin: auto;
  text-align: center;
}

#search {
  width: 100%;
  max-width: 450px;
  padding: 12px 18px;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  outline: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .2);
}

.buttons {
  margin-top: 20px;
}

.filter-btn {
  padding: 10px 22px;
  margin: 6px;
  border: none;
  border-radius: 25px;
  background: #ddd;
  cursor: pointer;
  transition: .3s ease;
  font-size: 15px;
}

.filter-btn:hover {
  background: #263c79;
  color: white;
}

.filter-btn.active {
  background: #263c79;
  color: white;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

.modal img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
}

.caption {
  color: white;
  margin-top: 15px;
  font-size: 18px;
}

.modal.show {
  display: flex;
}

/* Tablet */
@media (max-width: 768px) {
  .gallery-container {
    width: 95%;
    margin: 25px auto;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
  }

  .image-container {
    height: 180px;
  }

  header h1 {
    font-size: 28px;
  }

  header p {
    font-size: 15px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .gallery-container {
    width: 95%;
    padding: 15px;
    grid-template-columns: 1fr;
  }

  .image-container {
    height: 220px;
  }

  header {
    padding: 20px 15px;
  }

  header h1 {
    font-size: 22px;
  }

  header p {
    font-size: 14px;
  }
}