body {
  font-family: Arial, sans-serif;
  background-color: #f3f3f3;
  margin: 0;
  padding: 0;
}

header {
  background-color: #333;
  padding: 30px;
  text-align: center;
}

header h1 {
  color: white;
  font-size: 32px;
  margin: 0;
}

main {
  padding: 40px;
}

.container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

#gridContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.selected {
  outline: 5px solid rgba(255, 0, 0, 0.5);
}

.hidden {
  display: none;
}

#generateBtn {
  background-color: deepskyblue;
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
}

.modal {
  position: fixed;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden; /* 이미지 크기에 맞게 모달 크기 조절 */
  transition: opacity 0.3s; /* 부드러운 페이드 인/아웃 효과를 위한 트랜지션 */
}

.modal img {
  display: block;
  width: 100%; /* 이미지를 모달 크기에 맞추기 */
  height: auto; /* 이미지의 가로세로 비율을 유지하면서 크기 조절 */
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden; /* 배경 스크롤 방지 */
}