/* 메인 컨테이너: 좌우 배치를 위한 Flexbox */
.main-container {
  width: 80%;
  margin: 20px auto;
  display: flex;
  /* 좌우 섹션 사이 간격 */
  gap: 16px;
  /* 위쪽 헤더와 맞추려면 align-items: flex-start 로 두시면 됩니다. */
  align-items: flex-start;
  margin-top: 80px;
  margin-bottom: 128px;
}

/* 왼쪽(에디터) 섹션, 오른쪽(미리보기) 섹션 각각을 flex 컨테이너로 설정 */
.editor-container,
#previewContainer {
  flex: 1;                  /* 1:1로 공간을 나눠 씀 */
  display: flex;
  flex-direction: column;   /* 내부는 세로 배치 */
}

/* h2.subtitle(제목) 스타일과 간격 통일 */
.editor-container h2.subtitle,
#previewContainer h2.subtitle {
  color: #ffffff;
  margin: 0 0 16px 0; /* 아래쪽만 16px 간격 */
}

/* 텍스트에어리어(왼쪽 에디터) 스타일 */
.editor-container #inputArea {
  width: 100%;
  border: 1px solid #ffffff50;
  border-radius: 4px;
  background-color: #18181a;
  min-height: 576px;
  color: #ffffff;
  font-size: 1.2em;
  padding: 16px;
  resize: none;
  /* h2와 textarea 간격은 위에서 margin-bottom을 h2에 줬으므로 여기서는 불필요
     버튼과의 간격은 상황에 맞게 조절하세요. */
  margin-bottom: 16px;
  outline: none;
  overflow: auto;
  scrollbar-width: none;
}
.editor-container #inputArea:-webkit-scrollbar {
  display: none;
}


/* Render 버튼 스타일 */
.editor-container .post-button {
  width: 100%;
  height: 48px;
  padding: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid #ffffff;
  background: #ffffff;
  border-radius: 4px;
}

.editor-container #uploadBtn {
  border: 1px solid #ffffff50;
  background-color: #18181a;
  color: #ffffff;
  transition: color 0.1s;
}
.editor-container #uploadBtn:hover {
  border: 1px solid #ffffff;
  background-color: #ffffff;
  color: #000000;
}

/* 미리보기 박스(오른쪽) 스타일 */
#previewContainer #preview {
  width: 100%;
  min-height: 640px;
  border: 1px solid #ffffff50;
  background: #18181a;
  padding: 16px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #ffffff;
}

.post-click {
  text-decoration: none;
  color: #007BFF;
  transition: 0.1s;
}

.post-click:hover {
  color: #005abb;
}

.dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
  border-radius: 4px;
  background-color: #18181a;
  margin-bottom: 16px;
}
.dropdown input {
  width: 100%;
  padding: 16px;
  font-size: 1em;
  border: 1px solid #ffffff50;
  background-color: #18181a;
  color: #ffffff;
  border-radius: 4px;
  outline: none;
  transition: 0.1s;
}
.dropdown input:hover {
  border-color: #ffffff;
}
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #18181a;
  border: 1px solid #ffffff50;
  width: 100%;
  z-index: 1;
  border-radius: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.dropdown-content div {
  padding: 16px;
  cursor: pointer;
  color: #ffffff;
  transition: 0.1s;
}
.dropdown-content div:hover {
  color: #000000;
  background-color: #ffffff;
}

#galleryBtn {
  width: 100%;
  margin-bottom: 16px;
  height: 48px;
  background-color: #18181a;
  color: #fff;
  border: 1px solid #ffffff50;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: 0.1s;
}
#galleryBtn:hover {
  color: #000000;
  background-color: #ffffff;
}

#galleryGrid div img {
  border: 1px solid #ffffff50;
  transition: 0.1s;
}
#galleryGrid div img:hover {
  border: 1px solid #ffffff;
}

@media (max-width: 1024px) {
  #previewContainer {
    display: none;
  }
  #renderBtn {
    display: none;
  }
}