/* Reset for explore page */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.main {
  margin: 0 auto;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding-top: 65px;
  margin-bottom: 65px;
  overflow: hidden;
}

.categories {
  margin: 0 auto;
  display: flex;
  gap: 15px;
  padding: 20px;
  margin-bottom: 10px;
  width: 100%; /* Ensure it fits within the viewport */
  max-width: 1100px; /* Prevents it from growing beyond the viewport */
  overflow-x: scroll; /* Enables horizontal scrolling */
  white-space: nowrap; /* Prevents items from wrapping */
}

/* Hide scrollbar for WebKit browsers */
.categories::-webkit-scrollbar {
  display: none;
}

/* Individual Category */
.category {
  margin: 0 auto;
  text-wrap: none;
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid #bababa;
  cursor: pointer;
  font-size: 16px;
  border-radius: 7.75px;
  transition: background-color 0.3s ease;
  background-color: #fff;
}

.category {
  flex: 0 0 auto; /* Prevents them from growing beyond their content */
  min-width: fit-content; /* Ensures they don’t stretch too much */
}

/* Hover & Active States */
.category:hover {
  background-color: #fc440f;
  border-color: #fc440f;
  color: white;
}
.category.active {
  background-color: #3bae31;
  color: white;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .categories {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .categories {
    gap: 8px;
  }
  .category {
    padding: 8px 15px;
  }
}

@media (max-width: 480px) {
  .categories {
    gap: 5px;
  }
  .category {
    padding: 6px 12px;
  }
}

.masonry-container {
  columns: 4;
  column-gap: 10px;
  width: 100%;
  padding: 0 5vw;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
}
.masonry-item img {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 5px;
}

/* Responsive Design for Smaller Screens */
@media (max-width: 1024px) {
  .masonry-container {
    columns: 3;
  }
}

@media (max-width: 768px) {
  .masonry-container {
    columns: 2;
  }
}

@media (max-width: 480px) {
  .masonry-container {
    columns: 1;
  }
}
.image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
}

.hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  align-items: center;
  gap: 15px; /* Space between elements */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  padding: 10px;
  border-radius: 0 0 5px 5px;
}

.image-wrapper {
  position: relative;
}

.image-wrapper:hover .hover-overlay {
  opacity: 1;
}

.user-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-info .avatar {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 14px;
}

.post-stats img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.likes,
.comments {
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Gray overlay */
  justify-content: center;
  align-items: center;
  overflow: auto; /* Ensures the modal content can be scrolled if too big */
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px; /* Or adjust to your preferred max width */
  text-align: center;
  position: relative;
  overflow: hidden; /* Prevents content from overflowing */
  animation: fadeIn 0.3s ease;
}

.modal-image {
  width: 100%;
  border-radius: 10px;
}

.modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.modal-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.modal-username {
  font-weight: bold;
}

.modal-caption {
  font-size: 14px;
  margin-bottom: 8px;
  text-align: left;
}

/* Comment Section */
.comment-section {
  font-size: 14px;
  text-align: left; /* Ensures comments are left-aligned */
}

/* Comment Preview */
.comment-preview {
  margin-bottom: 5px;
  text-align: left; /* Ensures comment preview is left-aligned */
}

/* Individual Comment */
.comment {
  padding: 5px;
  border-radius: 8px;
  margin-bottom: 5px;
  display: flex; /* Allows content to be aligned left and right */
  justify-content: space-between; /* Distributes space between comment and like counter */
}

/* Like Counter */
.comment .like-counter {
  font-size: 12px;
  color: #333;
  text-align: right; /* Right-aligns the like counter */
  margin-left: 10px; /* Adds space between comment text and like counter */
}

/* View More/Less Button */
.toggle-comments {
  background: none;
  border: none;
  color: #007bff;
  cursor: pointer;
  font-size: 13px;
  padding: 5px 0;
  text-align: left;
}

/* All Comments (Initially Hidden) */
.all-comments {
  display: none;
  margin-top: 5px;
  text-align: left; /* Keeps comments left-aligned when displayed */
}

/* Show Comments when Active */
.all-comments.active {
  display: block;
}

/* Right-aligned like counter for individual comments */
.comment .like-counter {
  align-self: flex-end; /* Makes sure the like counter stays at the bottom right */
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #000;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
