.card-forum {
  display: flex;
  flex-direction: column;
  width: 746px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-card-forum h4 {
  color: gray;
  font-size: 14px;
}

.header-card-forum h2 {
  margin-top: 8px;
  font-size: 24px;
}

.body-card-forum p {
  font-size: 14px;
  line-height: 1.5;
}

.footer-card-forum span {
  font-size: 14px;
  color: gray;
}

.trending-list li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
  
.more-info {
  color: gray;
  font-size: 11px;
  display: flex;
  align-items: center;
}

.header-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.circle {
  width: 5px;
  height: 5px;
  border: 1px solid gray;
  background-color: gray;
  border-radius: 100%;
  margin: 0 5px;
}

.img-forum {
  object-fit: cover;
  height: 250px;
  width: 100%; 
  border-radius: 10px;
}

.title-upload {
  font-size: 25px;
  width: 20rem;
}

.field-txt {
  padding: 5px;
  font-size: 15px;
  resize: none; /* Mencegah resize */
  overflow: auto; /* Scroll otomatis jika teks terlalu panjang */
  word-wrap: break-word; /* Memastikan teks terbungkus */
  line-height: 1.5; /* Menambah jarak antar baris */
}

.submit-forum {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submit-forum button {
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.cursor-pointer {
  cursor: pointer;
}

.img-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

li span:nth-child(1) {
  font-weight: 500;
}

.hidden {
  display: none;
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-50 {
  z-index: 50;
}

.bg-gray-600 {
  background-color: rgba(75, 85, 99, 1);
}

.bg-opacity-50 {
  background-color:rgba(0, 0, 0, 0.5)
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem;
}

.border-l {
  border-left-width: 1px;
}

.ml-6 {
  margin-left: 1.5rem;
}

.scrollable-content {
  max-height: calc(100vh - 150px);
  overflow-y: auto; 
  padding-right: 1rem; 
}

/* Modal Styling */
#detailModal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.5);
}

#detailModal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 100%;
  max-width: 1000px;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
}

#modalDescription {
  overflow-y: auto;
  max-height: 50vh;
  padding-right: 0.5rem;
}

#modalComments {
  overflow-y: auto;
  height: 100%;
  padding-right: 0.5rem;
}

.card {
  min-height: 20vh;
  height: 550px;
  border-radius: 20px;
  max-width: 80%;
  width: 100%;
}

/* Center the image in the modal */
#detailModal .image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background-color: #f9f9f9; /* Optional background for better contrast */
}

#detailModal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Maintain image aspect ratio */
}

/* Default: Kontainer gambar disembunyikan */
#imageContainer.hidden {
  display: none;
}

/* Jika gambar tidak ada, konten mengambil full width */
#contentSection.full-width {
  width: 100%;
}

/* Overflow scrolling untuk komentar */
#commentsSection {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  width: 25%; /* Atur lebar area komentar */
  background-color: #f9f9f9;
  padding: 1rem;
}

#detailModal .flex {
  display: flex;
  flex-direction: row; /* Default: layout horizontal */
  gap: 1rem;
}

#imageContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35%; /* Pastikan gambar mendapat ruang tetap */
  border-right: 2px solid #f9f9f9;
  padding: 20px;
}

#imageContainer img {
  border-radius: 20px;
  width: 100%;
}

#contentSection {
  flex: 1; /* Ambil sisa ruang */
}


#detailModal .column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-like {
  padding: 0.5rem;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.btn-like[data-liked="true"] {
  color: #f56565;
}

.btn-like[data-liked="false"] {
  color: black;
}

.text-border {
  border: 1px solid #d0d0d0;
}

@media screen and (max-width: 1024px) {
  /* Header */
  .navbar-burger {
    display: flex;
  }

  .navbar-menu {
    display: none;
  }

  .navbar-menu.active {
    display: flex;
    flex-direction: column;
  }

  .navbar-menu li {
    margin-bottom: 1rem;
  }

  /* Forum Content */
  .content-forum {
    flex-direction: column-reverse;
  }

  .scrollable-content {
    padding: 1rem;
    max-height: calc(100vh - 200px);
  }

  .submit-forum {
    justify-content: center;
    flex-direction: column;
  }

  .submit-forum button {
    width: 100%;
  }

  /* Footer */
  .footer-2 {
    padding: 2rem;
    text-align: center;
  }

  .footer-2 .flex {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-2 .lg\:w-1\/2 {
    width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .content-forum {
    width: 100%;
    flex-direction: column-reverse;
  }
  .submit-forum {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .submit-forum button {
    width: 20%;
  }
  /* Header */
  nav ul {
    display: none;
  }

  .navbar-burger {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  /* Forum Content */
  .content-forum {
    padding: 1rem;
  }

  .card-forum {
    width: 100%;
  }

  .img-forum {
    height: auto;
  }

  /* Detail Modal */
  #detailModal .flex {
    height: 80%;
    flex-direction: column;
  }

  #detailModal {
    padding: 0.5rem; /* Lebih kecil untuk perangkat mobile */
  }

  #detailModal .modal-content {
    max-width: 100%; /* Modal mengambil lebar penuh */
    max-height: 100vh; /* Maksimalkan tinggi untuk perangkat kecil */
  }

  #modalComments {
    height: 100%;
    padding-right: 0.5rem;
  }

  #imageContainer {
    padding: 0;
    width: 100%;
    max-height: 20vh;
    border: none;
  }

  #modalTitle {
    font-size: .8rem;
  }

  #contentSection {
    height: 100%;
  }

  #modalImage {
    border-radius: 0px;
    width: 100%;
    height: auto;
  }

  #commentsSection {
    width: 100%;
    max-height: 25vh;
    padding: 0.5rem; /* Kurangi padding */
  }

  .headerContent {
    display: flex;
    width: 100%;
  }

  #commentInput {
    padding: 10px 0; 
  }

  #modalDescription {
    height: 100%;
    max-height: 100vh;
  }

  .commentInput {
    flex-direction: row;
    width: 100%;;
  }

  /* Footer */
  .footer-2 {
    flex-direction: column;
    text-align: center;
  }
}
