/*스타일링은 GPT에게 짬때렸어.*/
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: #202023; /* Dark Blue/Violet Background */
  color: #e0e0e0; /* Light text */
  margin: 0;
  padding: 20px;

  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

footer {
  margin-top: 40px;
  font-size: 0.8em;
  color: #666;
  display: block;
  position: relative;
  bottom: 0;
  width: 100%;
  text-align: center;
}

a {
  color: #4a90e2; /* Vibrant Blue links */
}

.container {
  max-width: 900px;
  margin: 0 auto;
}
.search-container {
  display: flex;
  margin-bottom: 30px;
}
#searchInput {
  flex-grow: 1;
  border: 2px solid #44446a; /* Darker border */
  background-color: #27273f; /* Component background */
  color: #e0e0e0; /* Input text color */
  padding: 12px 15px;
  font-size: 16px;
  border-radius: 8px 0 0 8px;
  outline: none;
  transition: border-color 0.2s;
}
#searchInput:focus {
  border-color: #4a90e2; /* Vibrant Blue focus */
}
#searchButton {
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  color: #e0e0e0; /* Light text on button */
  background-color: #4a90e2; /* Vibrant Blue accent */
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background-color 0.2s;
}
#searchButton:hover {
  background-color: #3873be; /* Darker Blue hover */
}
#loading {
  text-align: center;
  padding: 20px;
  font-size: 18px;
  color: #a0a0c0; /* Light grey loading text */
}
#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.result-item {
  background-color: #27273f; /* Component background */
  border: 1px solid #33334f; /* Darker, subtle border */
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); /* Darker shadow */
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.result-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* More pronounced hover shadow */
}
.result-item h3 {
  margin-top: 0;
  font-size: 1.2em;
  word-break: keep-all;
  color: #ffffff; /* White title for contrast */
}
.result-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 15px;
}
.result-item p {
  font-size: 0.95em;
  line-height: 1.6;
  color: #b0b0c0; /* Lighter grey for body text */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85); /* Darker modal overlay */
  align-items: center;
  justify-content: center;
}
.modal-content {
  background-color: #27273f; /* Component background */
  color: #e0e0e0; /* Light text */
  margin: auto;
  padding: 30px;
  border-radius: 8px;
  max-width: 700px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
  display: flex;
  flex-direction: column;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa; /* Light grey close icon */
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
#modalDate {
  font-size: 0.85em;
  color: #a0a0c0; /* Light grey date */
  margin-top: -10px;
  margin-bottom: 20px;
}
#modalImage {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 5px;
  margin-bottom: 15px;
}
#modalText {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 45vh;
  overflow-y: auto;
  line-height: 1.7;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid #33334f; /* Darker border separator */
  padding-top: 20px;
}
.modal-actions a {
  flex: 1;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: #1a1a2e; /* Dark text for contrast on bright button */
  background-color: #63d297; /* Bright Green accent */
  border-radius: 5px;
  font-weight: bold;
  transition: opacity 0.2s;
}
.modal-actions a:hover {
  opacity: 0.85;
}
.modal-actions a.link-arca {
  background-color: #4a90e2; /* Vibrant Blue accent */
  color: #1a1a2e; /* Dark text for contrast on bright button */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
