/* General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: Roman;
  background: linear-gradient(to right, rgb(79, 168, 109), rgb(79, 168, 109));
  color: #fcfafa;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  text-align: center;
}

.container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Header */
header h2,
header p {
  color: #1565c0;
  margin-bottom: 20px;
}

/* Notification Bar */
.notification-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #8e24aa 60%, #7c4dff 100%);
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.07);
  padding: 10px 16px;
  margin-bottom: 18px;
  gap: 18px;
  font-size: 1.3em;
}

.notification-bar .icon {
  position: relative;
  cursor: pointer;
  margin-right: 2px;
  color: #fff;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bar .icon.active {
  color: #ffd600;
  font-weight: bold;
}

.notification-bar .count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #e53935;
  color: #fff;
  font-size: 0.7em;
  border-radius: 50%;
  padding: 2px 6px;
  font-weight: bold;
}

.notification-bar .profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #eee;
  margin-left: 8px;
  cursor: pointer;
}

.main-menu-icon {
  font-size: 1.3em;
  color: #fff;
  margin: 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Post, Comment, and Reply Structure */
.post,
.comment,
.reply,
.sub-reply {
  background: white;
  padding: 15px;
  margin: 15px 0;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  color: #000;
  text-align: center;
  word-wrap: break-word;
}

.author {
  font-weight: bold;
  color: #1565c0;
  display: flex;
  align-items: center;
}

.author img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 5px;
}

.timestamp {
  font-size: 0.85em;
  color: #777;
}

.content {
  font-family: 'Times New Roman', serif;
  color: #000;
  margin-bottom: 10px;
  text-align: left;
  white-space: pre-line;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Post Box & General Inputs */
.post-box textarea,
textarea,
input {
  width: 100%;
  max-width: 500px;
  padding: 10px;
  margin: 10px auto;
  font-size: 1em;
  border-radius: 8px;
  border: 1px solid #ccc;
  display: block;
  color: #000;
}

#postInput {
  min-height: 80px;
  max-height: 300px;
  resize: vertical;
  font-size: 1.1em;
  margin-bottom: 0;
  text-align: left;
  transition: min-height 0.2s;
}

#postInput:focus {
  min-height: 200px;
}

/* Input boxes for comments, edits, etc. */
.input-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px auto;
  max-width: 500px;
}

.input-box input {
  flex: 1;
  min-height: 40px;
}

/* CONSOLIDATED: All styles for the edit textarea are now in one block */
.input-box textarea {
  flex-grow: 1;
  height: 120px;
  min-height: 80px;
  max-height: 300px;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.4;
}

.input-box button {
  margin-left: 10px;
}

/* Buttons */
button {
  background: #1565c0;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

#postButton {
  display: block;
  margin: 15px auto;
  width: fit-content;
}

/* Media Upload & Preview */
.media-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 10px 0 0 0;
}

.media-icon {
  font-size: 2em;
  color: #1565c0;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px;
  border-radius: 50%;
  background: #e3f2fd;
  border: 2px solid #8e24aa;
}

.media-icon:hover {
  color: #7c4dff;
  background: #ede7f6;
}

#godsAnswerIcon {
  display: inline-flex;          /* allows centering */
  align-items: center;           /* vertical center */
  justify-content: center;       /* horizontal center */
  width: 50px;                   /* circle size */
  height: 50px;                  /* circle size */
  background-color: goldenrod;   /* circle color */
  color: white;                  /* text color */
  font-size: 22px;               /* text size */
  font-weight: bold;             /* bold text */
  border-radius: 50%;            /* makes it a circle */
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

#godsAnswerIcon:hover {
  transform: scale(1.2);
  opacity: 0.8;
  background-color: gold;        /* hover effect */
}

#hiddenImageInput,
#hiddenVideoInput {
  display: none;
}

#mediaPreview {
  margin: 10px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#mediaPreview img,
#mediaPreview video {
  max-width: 300px;
  max-height: 250px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #fafafa;
}

.media-remove {
  color: #c00;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
}

.upload-progress-item {
  margin-bottom: 12px;
  font-size: 0.9em;
  color: rgb(13, 202, 13);
}

.progress-bar-container {
  width: 100%;
  background-color: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  height: 20px;
  margin-top: 4px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background-color: #007bff;
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
  background-size: 40px 40px;
  animation: progress-bar-stripes 2s linear infinite;
}

.progress-text-below {
  text-align: center;
  font-weight: bold;
  color: #13878b;
  font-size: 0.85em;
  margin-top: 2px;
}

@keyframes progress-bar-stripes {
  from { background-position: 40px 0; }
  to { background-position: 0 0; }
}


/* Interaction Bar & Reactions */
.interaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  margin-top: 10px;
  justify-content: space-between;
}

.comment .interaction-bar {
  font-size: 0.8em;
  padding-top: 4px;
  justify-content: flex-start;
}

.comment-icon,
.reply-label,
.share-label,
.edit-label,
.delete-label,
.comment-delete-label,
.reply-delete-label {
  color: #1565c0;
  font-weight: bold;
  cursor: pointer;
  margin: 0 5px;
}

.edit-label:hover,
.delete-label:hover,
.reply-label:hover,
.comment-delete-label:hover,
.reply-delete-label:hover {
  color: #dc3545;
}

.reaction-block {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.comment .reaction-block {
  margin-right: 15px;
}

.selected-emoji {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(200, 200, 200, 0.1);
  transition: background 0.2s;
}

.selected-emoji:hover {
  background: rgba(200, 200, 200, 0.2);
}

.reaction-count {
  font-size: 1em;
  color: #1565c0;
  margin-left: 2px;
  min-width: 1.5em;
}

/* Emoji Picker */
.emoji-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 5px;
  z-index: 1000;
  white-space: nowrap;
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
  justify-content: center;
  align-items: center;
}

.emoji-picker.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.emoji-picker:not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.emoji-picker span {
  cursor: pointer;
  font-size: 20px;
  padding: 5px;
  border-radius: 5px;
  transition: background 0.2s;
}

.emoji-picker span:hover {
  background: rgba(200, 200, 200, 0.3);
}


/* Media Display In Posts (Images, Videos, Grids) */
.media-preview video,
.video-container video,
.media-grid img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  margin: 10px auto;
  background: #000;
}
.media-preview img {
  cursor: zoom-in;
}

.video-container {
  position: relative;
  width: 100%;
}

.media-grid {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  overflow: hidden;
}

.media-grid-1 { grid-template-columns: 1fr; }
.media-grid-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.media-grid-3 { grid-template-columns: 1fr 1fr 1fr; aspect-ratio: 3 / 2; }
.media-grid-2x2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 1 / 1; }

.media-grid .grid-item {
  position: relative;
  overflow: hidden;
  background-color: #eee;
}

.media-grid img {
  height: 100%;
  cursor: pointer;
  transition: transform 0.2s;
  margin: 0;
}

.media-grid img:hover {
  transform: scale(1.05);
}

.more-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5em;
  font-weight: bold;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

/* Zoom Modal for Images */
.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.zoom-modal img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 10px;
  box-shadow: 0 0 20px #000;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

/* Video/Live Options Menu */
.video-overlay-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1999;
}

.video-overlay-menu.active {
  display: block;
}

.video-options-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #f505c1;
  border-radius: 10px;
  padding: 20px;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  text-align: center;
  color: #333; /* Set default text color */
}

.video-options-menu h3 {
  margin-top: 0;
  color: #f505c1;
}

.video-options-menu button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: none;
  background: #f505c1;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.video-options-menu button:hover {
  background: #d004a0;
}

.video-options-menu button.cancel {
  background: #999;
}

.video-options-menu button.cancel:hover {
  background: #777;
}

#liveStreamSetup p {
  font-size: 0.9em;
  margin: 10px 0;
}

#liveStreamSetup textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  resize: vertical;
}

/* Delete Confirmation UI */
.delete-confirm-ui span {
  font-size: 14px;
  color: #d32f2f;
  margin-right: 8px;
  vertical-align: middle;
}

.confirm-yes,
.confirm-no {
  padding: 4px 10px;
  margin: 0 3px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #ccc;
  font-size: 12px;
  font-weight: bold;
  vertical-align: middle;
}

.confirm-yes {
  background-color: #d32f2f;
  color: white;
  border-color: #b71c1c;
}

.confirm-no {
  background-color: #e2e3e5;
  color: #333;
  border-color: #ccc;
}

/* Live Stream Specific Styles */
.live-video-post {
  border: 2px solid #ff0000;
  border-radius: 8px;
  padding: 10px;
  background: #fff0f0;
}

.live-badge {
  display: inline-block;
  background-image: linear-gradient(135deg, #ff4444, #ff0000);
  color: white;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin: 0 8px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.live-video-post .media-preview {
  width: 100%;
  min-height: 250px;
  max-height: 70vh;
  background: #000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
  overflow: hidden;
  position: relative;
}

.live-video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-viewer span, .ended-stream span {
  color: white;
  font-weight: bold;
  padding: 20px;
}

.streamer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 10px;
}
.pause-btn, .stop-btn {
  padding: 8px 15px;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}
.stop-btn { background-color: #ff4444; }
.pause-btn { background-color: #ffc107; color: black; }

/* Doctor Icon */
.doctor-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  line-height: 1;
}

/* Utility classes, like Read More link */
.read-more-link {
  color: #1565c0;
  font-weight: bold;
  cursor: pointer;
  margin-top: 5px;
  display: inline-block;
}
.read-more-link:hover {
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .emoji-picker {
    max-width: 90vw;
    overflow-x: auto;
  }

  .media-preview video,
  .video-container video {
    max-height: 50vh;
  }

  .live-video-post .media-preview {
    max-height: 50vh;
  }
}

.upload-progress-item { margin-bottom: 12px; font-size: 0.9em; color: rgb(13, 202, 13)e13; }
    .progress-bar-container { width: 100%; background-color: #e0e0e0; border-radius: 4px; overflow: hidden; height: 20px; margin-top: 4px; }
    .progress-bar { width: 0%; height: 100%; background-color: #007bff; border-radius: 4px; transition: width 0.3s ease-in-out; background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; animation: progress-bar-stripes 2s linear infinite; }
    .progress-text-below { text-align: center; font-weight: bold; color: #13878b; font-size: 0.85em; margin-top: 2px; }
    @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } }

    /* --- Style for Edit Textarea --- */
    .input-box textarea {
      flex-grow: 1;
      height: 120px; /* Increased default height for easier editing */
      min-height: 80px; /* A sensible minimum height */
      resize: vertical; /* Allow the user to resize the textarea vertically */
      overflow-y: auto; /* Add a scrollbar if the content overflows */
      border: 1px solid #ccc;
      border-radius: 4px;
      padding: 8px;
      font-family: inherit;
      font-size: 1em;
      line-height: 1.4;
    }
    
    /* Ensure interaction bar on comments is styled correctly */
    .comment .interaction-bar {
        font-size: 0.8em;
        padding-top: 4px;
        justify-content: flex-start;
    }
    .comment .reaction-block {
        margin-right: 15px;
    }