/* ==========================
   posts.css
   ========================== */

/* Feed container */
section.feed {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px;
}

/* Post card */
.post {
  padding: 25px;
  max-width: 100%;
  width: 100%;
  display: flex;
  border-bottom: 1px solid var(--border-default);
}

/* Post header */
.post__header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.post__header img {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  margin-right: 8px;
  object-fit: cover;
  border: 1px solid var(--sidebar-border);
}

/* Ã¢â‚¬Å“Ã¢â‚¬Â¦Ã¢â‚¬Â menu button */
.post__menu {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: auto;
}
.post__menu i {
  font-size: 20px;
}

/* Author & timestamp */
.post__author {
  font-weight: bold;
  color: var(--text-primary);
  margin-right: 8px;
}
.post__timestamp {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Post body text */
.post__body {
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Media wrapper */
.post__media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.post__media img,
.post__media video {
  width: 100%;
  max-height: calc(100vh - 115px);
  object-fit: contain;
  background: black;
  border-radius: 8px;
}

/* Footer: counts + controls */
.post__footer {
  width: 100%;
}

.post__counts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  margin: 8px 0px;
}

.post__count {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  font-size: 15px;
  color: var(--text-primary);
}

.post__count--like i,
.post__count--comment i {
  border-radius: 50%;
  color: white;
  padding: 9px;
  margin-right: 8px;
}

.post__count--like i {
  background: green;
}

.post__count--comment i {
  background: maroon;
}

.post__divider {
  border: 0;
  border-top: 1px solid var(--border-default);
  margin: 0 0 8px;
}

.post__controls {
  display: flex;
  justify-content: space-evenly;
  padding-bottom: 8px;
}

.post__control-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
}

.post__control-btn i {
  font-size: 18px;
  margin-right: 8px;
}

button.post__control-btn:hover {
    color: var(--text-primary);
}

button.post__menu:hover {
    color: var(--text-primary);
}

.post__meta {
    font-size: 15px;
    margin-top: -2px;
    padding-right: 12px;
}

.post__info {
    font-size: 13px;
}

.post__meta > div > a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
}

.post__meta > div > a:hover {
    text-decoration: underline;
}

.post__header img:hover {
    border: 1px solid var(--text-tertiary);
}

/* Neutralize any box-shadow on the video element itself */
video {
  box-shadow: none !important;
  filter: none !important;
}

/* Wipe out backgrounds & shadows on WebKitâ€™s controls chrome */
video::-webkit-media-controls,
video::-webkit-media-controls-enclosure,
video::-webkit-media-controls-panel,
video::-webkit-media-controls-overlay-play-button,
video::-webkit-media-controls-start-playback-button {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* And just in case thereâ€™s a border or extra line: */
video::-webkit-media-controls-panel {
  border: none !important;
}

/* POPUP MENU & BACKDROP */
.post-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 66%);
  z-index: 1000;
}

.post-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  background: var(--bg-surface);
  border-radius: 18px;
  overflow: hidden;
  z-index: 1001;
  font-size: 16px;
  box-shadow: 0 0 20px -9px #000;
}

.post-menu__item {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  color: var(--text-primary);
  text-align: center;
  user-select: none;
  transition: background 0.2s;
}

.post-menu__item:last-child {
  border-bottom: none;
}

.post-menu__item:hover {
  background: var(--bg-search);
}

/* â€œReportâ€ in red */
.post-menu__item.report {
  color: var(--logo-color); /* or your alert color */
  font-weight: 500;
}

/* initial state: hidden & slightly small */
.post-menu-backdrop {
  opacity: 0;
  transition: opacity 200ms ease;
}
.post-menu-backdrop.open {
  opacity: 1;
}

.post-menu {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 200ms ease, transform 200ms ease;
}
.post-menu.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ----------------------------------------------------------------------------
   comment-modal.css  
   ---------------------------------------------------------------------------- */

/* backdrop */
.comment-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 1000;
}
.comment-backdrop.open {
  opacity: 1;
}

/* modal container */
.comment-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90vw;        /* adjust as needed */
  max-width: 970px;
  max-height: 570px;
  height: 80vh;
  border-radius: 9px;
  transform: translate(-50%,-50%) scale(0.9);
  opacity: 0;
  display: flex;
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 1001;
  box-shadow: 0 0 20px -9px #000;
}
.comment-modal.open {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}

/* close â€œXâ€ */
.comment-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
}
.comment-modal__close:hover {
  color: #333;
}

/* left side: media */
.comment-media {
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
}
.comment-media img,
.comment-media video {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* right side: comments panel */
.comment-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* scrollable list */
.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: none;
}

/* each comment */
.comment-item {
  display: flex;
  margin-bottom: 16px;
}
.comment-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}
.comment-item .comment-body {
  flex: 1;
}
.comment-item .comment-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.comment-item .comment-text {
  font-size: 14px;
  color: var(--text-secondary);
}
.comment-item .comment-ts {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* input at bottom */
.comment-input {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border-default);
  padding: 11px 22px;
}
.comment-input input {
  flex: 1;
  border: none;
  font-size: 14px;
  outline: none;
}
.comment-input button {
  background: none;
  border: 1px solid var(--btn-border);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  padding: 9px 16px 8px 16px;
  border-radius: 8px;
}
.comment-input button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* â€”â€”â€”â€”â€”â€”â€”â€”â€”â€” Comment Modal Header â€”â€”â€”â€”â€”â€”â€”â€”â€”â€” */
.comment-modal-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
}
.comment-modal-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
}
.comment-modal-header__username {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.comment-modal-header__close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0px 0px 0px 20px;
}
.comment-modal-header__close:hover {
  color: var(--text-primary);
}

/* hide the old standalone close button */
.comment-modal__close {
  display: none;
}

/* make sure each comment-item can position its delete button */
.comment-item {
  position: relative;
  padding-right: 32px; /* room for the trash icon */
}

/* style the trash button */
.comment-delete {
  position: relative;
  top: 0px;
  left: 4px;
  background: none;
  border: none;
  color: #ff0000;       /* a nice red */
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
}

/* if youâ€™d like the icon itself not to steal hover clicks */
.comment-delete i {
  pointer-events: none;
}

.comment-delete:hover {
    opacity: 1;
}

/* ======================================
   report modal & toast
   ====================================== */
.report-backdrop {
  position: fixed;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background: rgb(0 0 0 / 66%);
  opacity: 0;
  transition: opacity .2s;
  z-index: 1000;
}
.report-backdrop.open {
  opacity: 1;
}

.report-modal {
  position: fixed;
  top:50%;
  left:50%;
  transform: translate(-50%,-50%) scale(0.9);
  width: 90%;
  max-width: 410px;
  background: var(--bg-surface);
  border-radius: 7px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 1001;
  font-size: 12px;
}
.report-modal.open {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
}

.report-modal__header {
  padding: 11px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--border-default);
}

.report-modal__list {
  display: flex;
  flex-direction: column;
  padding-bottom: 2px;
}
.report-modal__item {
  padding: 8px 16px;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-default);
}
.report-modal__item:last-child {
  border-bottom: none;
}
.report-modal__item:hover {
  background: var(--bg-search);
}
.report-modal__cancel {
  color: var(--text-secondary);
}

a.comment-modal-header__avatar-link {
    display: flex;
    width: max-content;
    height: max-content;
}

a.comment-item__user-link {
    color: var(--text-primary);
    text-decoration: none;
}

img.post__avatar {width: 40px;height: 40px;object-fit: contain;}

a.post__avatar-link {
    width: 40px;
    height: 40px;
    display: block;
    border-radius: 99px;
    overflow: hidden;
    box-shadow: 0 0 2px 0 #d1d1d1;
}

.post-right-content {
    display: flex;
    flex-direction: column;
    padding: 0px 12px;
    width: 100%;
}

.post__media img {
    cursor: pointer;
    object-fit: cover;
}

.feed-loading {
  text-align: center;
  padding: 1rem 0;
}

.feed-loading i {
  font-size: 1.5rem;
  color: var(--text-secondary);
}

.page-loader img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: top 0.6s ease, left 0.6s ease, transform 0.6s ease, width 0.6s ease;
}

.page-loader.move-to-corner img {
    top: 20px;
    left: 19px;
    transform: none;
    width: 43px;
}