/* === General === */
.main-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1400px;
  gap: 20px;
  padding: 20px;
}

/* === Columnas laterales === */
.left-sidebar,
.right-sidebar {
  width: 250px;
  flex-shrink: 0;
}

.center-content {
  flex-grow: 1;
  max-width: 700px;
}

.post-container {
  padding: 15px;
  background: var(--bg-secondary);
  /* Cambiado de #242526 */
  border-radius: 10px;
  margin: 20px auto;
  max-width: 100%;
}

/* === Encabezado de usuario === */
.user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-header img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.user-header a {
  color: var(--text-color);
  /* Cambiado de #fff */
  text-decoration: none;
}

.user-header a:hover {
  text-decoration: none;
}

/* === Tarideo de POST.PHP (Modal de incrustación/eliminación) === */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--modal-bg);
  /* Usando variable de tema */
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: var(--bg-secondary);
  /* Cambiado de #2c2c2c */
  margin: auto;
  padding: 20px;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 5px 15px var(--shadow-color);
  /* Usando variable de tema */
  position: relative;
  color: var(--text-color);
  /* Cambiado de #fff */
}

.close-button {
  color: var(--text-light);
  /* Cambiado de #aaa */
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: var(--text-color);
  /* Cambiado de #fff */
  text-decoration: none;
}

.embed-code-container {
  background-color: var(--input-bg);
  /* Cambiado de #1e1e1e */
  border: 1px solid var(--border-color);
  /* Cambiado de #444 */
  padding: 15px;
  border-radius: 5px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-color);
  /* Cambiado de #e0e0e0 */
  margin-top: 15px;
  position: relative;
}

.copy-embed-btn {
  background-color: var(--blue-color);
  /* Cambiado de #007bff */
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.copy-embed-btn:hover {
  background-color: var(--blue-hover-color);
  /* Cambiado de #0056b3 */
}

.embed-post-btn {
  background: var(--blue-hover-color);
  /* Cambiado de #0056b3 */
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  margin-top: 20px;
}

.delete-button {
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  margin-top: 20px;
  background: var(--red-color);
  /* Cambiado de #ff2b2b */
}

/* --- Nuevos estilos para seguidores y botón --- */
.user-info-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.follower-count {
  font-size: 0.9em;
  color: var(--text-light);
  /* Cambiado de #b0b3b8 */
}

.follow-btn {
  background-color: var(--bg-element);
  /* Cambiado de #555657 */
  color: var(--text-color);
  /* Cambiado de white */
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.follow-btn i {
  color: var(--text-color);
  /* Cambiado de #fff */
}

.follow-btn:hover {
  background-color: var(--hover-color);
  /* Cambiado de #6a6b6c */
}

.following-btn {
  background: linear-gradient(45deg, var(--primary-color), var(--blue-hover-color));
  /* Usando variables de tema */
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.following-btn i {
  color: #fff;
}

.following-btn:hover {
  opacity: 0.9;
}

/* Estilos para el modal de autenticación */
.post-auth-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.post-auth-modal-content {
  background-color: var(--bg-secondary);
  /* Cambiado de #242526 */
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 10px var(--shadow-color);
  /* Usando variable de tema */
  max-width: 350px;
  width: 90%;
}

.post-auth-modal-content p {
  margin-bottom: 20px;
  font-size: 1.1em;
}

.close-modal-pst-mod {
  float: right;
  background: var(--bg-element);
  /* Cambiado de #595959 */
  padding: 4px 10px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

.auth-button {
  width: 100%;
  padding: 12px 0;
  margin: 10px 0;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-color);
  transition: background-color 0.2s ease;
}

.auth-login-btn {
  background-color: var(--primary-color);
  /* Cambiado de #007BFF */
}

.auth-login-btn:hover {
  background-color: var(--blue-hover-color);
}

.auth-register-btn {
  background-color: var(--bg-element);
  /* Cambiado de #555657 */
}

.auth-register-btn:hover {
  background-color: var(--hover-color);
  /* Cambiado de #6a6b6c */
}

/* === Contenido === */
h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-color);
  /* Cambiado de #fff */
}

.post-meta {
  color: var(--text-light);
  /* Cambiado de #aaa */
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.post-desc {
  white-space: pre-line;
  line-height: 1.5;
  margin-bottom: 20px;
}

.share-post-btn {
  padding: 8px 9px;
  border-radius: 50%;
}

/* === Swiper y Plyr === */
.swiper {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  margin: 20px 0;
  overflow: hidden;
  border-radius: 12px;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
}

.plyr--video {
  background: transparent !important;
  overflow: hidden;
}

.media-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) brightness(0.5);
  opacity: 0.5;
  z-index: 0;
}

.plyr__video-wrapper {
  background: transparent !important;
}

.media-foreground,
.plyr {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

/* === Botón de edición === */
.edit-btn {
  background: var(--blue-color);
  /* Cambiado de #007bff */
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  margin-top: 10px;
}

/* === Modal de edición === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  /* Usando variable de tema */
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: var(--bg-secondary);
  /* Cambiado de #222 */
  padding: 20px;
  border-radius: 10px;
  width: 95%;
  max-width: 600px;
  color: var(--text-color);
  /* Cambiado de white */
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-top: 0;
}

.modal-content label {
  display: block;
  font-weight: bold;
  margin-top: 1rem;
}

.modal-content input[type="text"],
.modal-content textarea,
.modal-content input[type="file"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border-radius: 8px;
  border: none;
  background: var(--input-bg);
  /* Cambiado de #333 */
  color: var(--text-color);
  /* Cambiado de #fff */
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  gap: 10px;
  flex-wrap: wrap;
}

.form-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.form-actions button:first-child {
  background-color: var(--blue-color);
  /* Cambiado de #007bff */
  color: white;
}

.form-actions button:last-child {
  background-color: var(--bg-element);
  /* Cambiado de #444 */
  color: var(--text-color);
  margin-top: auto;
  border-radius: 50px;
  /* Cambiado de white */
}

/* === Galería de medios del modal === */
.media-scroll-container {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

#preview-new-media {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.media-index {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-color);
  /* Cambiado de #fff */
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 3px;
  z-index: 2;
}

.media-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}

.media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dragging {
  opacity: 0.5;
}

.media-item.over {
  border: 2px dashed var(--border-color);
  /* Cambiado de #888 */
}

.media-item {
  position: relative;
  flex: 0 0 auto;
  width: 100px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}

.media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.delete-icon {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--bg-secondary);
  /* Cambiado de #fff */
  color: var(--text-color);
  /* Cambiado de #000 */
  font-size: 12px;
  border-radius: 50%;
  padding: 2px 6px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Área de subida */
.upload-box {
  width: 100px;
  height: 100px;
  border: 2px dashed var(--border-color);
  /* Cambiado de #aaa */
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.upload-box:hover {
  border-color: var(--text-color);
  /* Cambiado de #fff */
}

.hidden-checkbox {
  display: none;
}

/* === Sidebars === */
.sidebar-block {
  background: var(--bg-secondary);
  /* Cambiado de #1e1e1e */
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.sidebar-block h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.user-card,
.post-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.user-card img,
.post-card img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-card a,
.post-card a {
  color: var(--text-color);
  /* Cambiado de #fff */
  text-decoration: none;
}

.user-card button {
  margin-left: auto;
  padding: 5px 10px;
  font-size: 0.8rem;
  background: var(--success-color);
  /* Usando variable de tema */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.user-card button:hover {
  background: var(--success-color);
  /* Mantener el mismo color o definir un hover específico */
}

.verified-tooltip-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.verified-tooltip {
  display: none;
  position: absolute;
  top: 125%;
  /* Aparece debajo del elemento */
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-secondary);
  /* Cambiado de #242526 */
  color: var(--text-color);
  /* Cambiado de #f0f2f5 */
  padding: 10px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 6px;
  box-shadow: 0 2px 10px var(--shadow-color);
  /* Usando variable de tema */
  z-index: 999;
  text-align: left;
  max-width: 260px;
  line-height: 1.4;
}

.verified-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  /* Aparece arriba del tooltip */
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--bg-secondary) transparent;
  /* Usando variable de tema */
}

.verified-tooltip-wrapper:hover .verified-tooltip {
  display: block;
}

.verified-icon {
  width: 17px;
  height: 17px;
  vertical-align: middle;
}

.verified-color {
  fill: currentColor;
}

/* === Responsive === */
@media screen and (max-width: 1000px) {
  .main-wrapper {
    flex-direction: column;
    align-items: center;
    padding: 10px;
  }

  .left-sidebar,
  .right-sidebar {
    width: 100%;
  }

  .center-content {
    max-width: 100%;
  }
}

@media screen and (max-width: 600px) {
  h1 {
    font-size: 1.2rem;
  }

  .swiper {
    height: auto;
  }

  .media-foreground {
    width: 100%;
  }

  .modal-content {
    padding: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .user-card img,
  .post-card img {
    width: 30px;
    height: 30px;
  }

  .user-card button {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

@media (max-width: 768px) {
  .plyr--paused.plyr--video .plyr__controls {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
  }

  .post-container {
    width: auto !important;
    padding: 15px;
    background: var(--bg-secondary);
    /* Cambiado de #242526 */
    border-radius: 10px;
    margin: 20px auto;
    max-width: 100%;
  }
}

/* Estilos para el botón de like y la barra de acciones */
a {
  color: var(--text-color);
  text-decoration: none;
}

.post-actions-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #4e4e4e5e;
}

.like-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 25px;
  /* Pill shape */
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s ease;
  background: var(--bg-primary);
  /* Default gray background */
  color: var(--text-color);
  /* Default text color */
  position: relative;
  overflow: hidden;
  /* For gradient animation */
}

.like-button .heart-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  /* Default gray heart */
  transition: fill 0.3s ease;
}

.like-button.liked {
  background: linear-gradient(135deg, #ff66cc, #cc3399);
  /* Pinkish gradient */
  color: white;
  /* White text for liked state */
}

.like-button.liked .heart-icon {
  fill: white;
  /* White heart when liked */
  animation: heartBeat 0.5s ease-out;
  /* Animation on like */
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.2);
  }

  50% {
    transform: scale(1);
  }

  75% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* Optional: Hover effect for the like button */
.like-button:hover:not(.liked) {
  background-color: #7c7c7c42;
  /* Slightly lighter gray on hover */
}

/* Share button styles (moved from inline) */
.share-post-btn {
  background: var(--bg-primary);
  /* Dark background */
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-color);
  /* White icon */
  padding: 8px 12px;
  /* Add some padding */
  border-radius: 25px;
  /* Make it rounded */
  transition: background-color 0.3s ease;
}

.share-post-btn:hover {
  background-color: #7c7c7c42;
  /* Slightly lighter on hover */
}

/* --- ESTILOS PARA MODAL DE EDICIÓN RESPONSIVE --- */
.modal {
  display: none;
  /* Oculto por defecto */
  position: fixed;
  /* Posición fija para cubrir toda la ventana */
  z-index: 1000;
  /* Asegura que esté encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  /* Ancho completo */
  height: 100%;
  /* Alto completo */
  overflow: auto;
  /* Habilitar scroll si es necesario */
  background-color: rgba(0, 0, 0, 0.7);
  /* Fondo semi-transparente oscuro */
  align-items: center;
  /* Centrar verticalmente */
  justify-content: center;
  /* Centrar horizontalmente */
}

.modal-content {
  background-color: #242526;
  /* Color de fondo oscuro del modal */
  margin: auto;
  padding: 20px;
  border: 1px solid #444;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  position: relative;
  width: 90%;
  /* Ancho por defecto */
  max-width: 600px;
  /* Ancho máximo en escritorio */
  max-height: 90vh;
  /* Altura máxima para permitir scroll */
  overflow-y: auto;
  /* Habilitar scroll dentro del contenido */
  color: #e4e6eb;
  /* Texto claro */
}

.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close-button:hover,
.close-button:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

/* Responsive adjustments for modal on small screens */
@media (max-width: 768px) {
  .modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 15px;
    border-radius: 0;
    overflow-y: auto;
  }

  .modal .form-actions {
    flex-direction: column;
    gap: 10px;
  }
}

/* Estilos para el botón de subida de portada/thumbnail */
.upload-cover-box {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* Relación de aspecto 16:9 */
  background-color: #3a3b3c;
  border: 2px dashed #5a5b5c;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #b0b3b8;
  font-size: 1.2rem;
  transition: background-color 0.3s ease;
  overflow: hidden;
  /* Para la previsualización de la imagen */
}

.upload-cover-box:hover {
  background-color: #4e4f50;
}

.upload-cover-box svg {
  margin-bottom: 10px;
}

.upload-cover-box img.cover-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ajusta la imagen para cubrir el área */
  border-radius: 8px;
  z-index: 1;
  /* Para que la imagen quede debajo del icono + */
}

.upload-cover-box .icon-plus-text {
  position: relative;
  /* Para que el texto e icono estén encima de la imagen */
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.upload-cover-box .icon-plus-text svg {
  stroke: #b0b3b8;
  /* Color del + */
}

.upload-cover-box .icon-plus-text span {
  font-size: 0.9em;
  /* Ajusta el tamaño del texto "Subir portada/thumbnail" */
}

/* --- COMENTARIOS - ESTILOS NUEVOS --- */
.main-content-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 777px;
  margin: auto;
  width: 100%;
}

.post-content-area {
  flex: 2;
  /* Toma más espacio en escritorio */
}

/* ====== Comentarios (desktop) ====== */
.comments-area-desktop {
  color: #e8eaed;
}

.comments-area-desktop h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 15px 15px 15px;
  color: var(--text-color);
}

/* El formulario actúa como contenedor posicionado */
#commentFormDesktop.comment-form {
  position: relative;
  margin: 0;
  background: var(--bg-secondary);
  padding: 15px;
  border-radius: 10px;
}

/* Textarea estilo “barra de chat” */
#commentInputDesktop {
  width: 100%;
  min-height: 52px;
  max-height: 180px;
  /* evita crecer infinito si lo haces auto-resize */
  padding: 14px 56px 14px 16px;
  /* espacio a la derecha para el botón interno */
  background: var(--bg-primary);
  /* cuerpo oscuro */
  color: var(--text-color);
  border-radius: 10px;
  /* súper redondeado */
  outline: none;
  resize: none;
  line-height: 1.35;
  font-family: 'SFProDisplay', sans-serif;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#commentInputDesktop::placeholder {
  color: #9aa0a6;
}

/* Resalta cuando tiene foco */
#commentFormDesktop:focus-within #commentInputDesktop {
  border-color: #3b82f6;
  /* azul */
}

/* Botón de enviar dentro del input (a la derecha) */
#submitCommentBtnDesktop {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9999px;
  background: #1a73e8;
  /* azul estilo “send” */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(26, 115, 232, .35);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease;
  padding: 0;
}

/* Icono dentro del botón (Font Awesome o similar) */
#submitCommentBtnDesktop i {
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  color: #fff;
}

/* Hover/active/disabled */
#submitCommentBtnDesktop:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 8px 22px rgba(26, 115, 232, .42);
}

#submitCommentBtnDesktop:active {
  transform: translateY(-50%) scale(.98);
}

#submitCommentBtnDesktop:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
}


/* Layout para escritorio (post a la izquierda, comentarios a la derecha) */
@media (min-width: 1024px) {

  .comments-area-desktop {
    margin-left: 20px auto;
    /* Espacio entre el post y los comentarios */
  }

  .comments-mobile-fab {
    display: none !important;
    /* Ocultar el FAB en escritorio */
  }
}

/* Estilos del modal de comentarios para móvil */
.comments-modal {
  display: flex;
  /* Oculto por defecto */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50vh;
  /* La mitad de la pantalla */
  background-color: #242526;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  flex-direction: column;
  z-index: 1001;
  transform: translateY(100%);
  /* Iniciar fuera de la pantalla */
  transition: transform 0.3s ease-out;
  overflow: hidden;
  /* Para el contenido interno */
}

.comments-modal.active {
  transform: translateY(0);
  /* Deslizar hacia arriba */
}

.comments-modal-header {
  padding: 15px;
  text-align: center;
  border-bottom: 1px solid #3a3b3c;
  position: relative;
  cursor: grab;
  /* Indica que es arrastrable */
  color: #e4e6eb;
}

.comments-modal-header .drag-handle {
  width: 40px;
  height: 5px;
  background-color: #5a5b5c;
  border-radius: 2.5px;
  margin: 0 auto 10px auto;
}

.comments-modal-header .close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

.comments-modal-body {
  flex-grow: 1;
  /* El cuerpo toma el espacio restante */
  overflow-y: auto;
  /* Hacer el cuerpo deslizable */
  padding: 0 15px 15px 15px;
}

.comments-mobile-fab {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(150deg, #00eeff 0%, #0080ff 100%);
  /* Color de tu marca */
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 999;
  /* Por encima de todo, pero debajo del modal */
}

.comments-mobile-fab svg {
  width: 28px;
  height: 28px;
}

@media (min-width: 1024px) {
  .comments-mobile-fab {
    display: none;
    /* Ocultar en escritorio */
  }

  .comments-modal {
    display: none !important;
    /* Ocultar el modal en escritorio */
  }
}


/* Estilos para el formulario de comentarios */
.comment-form {
  display: flex;
  gap: 10px;
}

.comment-form textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-color);
  resize: vertical;
  /* Permitir redimensionar verticalmente */
  min-height: 20px;
}

.comment-form button {
  background-color: #0080ff;
  color: white;
  width: 40px;
  /* Fixed width for icon button */
  height: 40px;
  /* Fixed height for icon button */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
  /* Prevent button from shrinking */
}

.comment-form button i {
  font-size: 1.2em;
  /* Icon size */
}

.comment-form button:hover {
  background-color: #0090ff;
}

.comment-form button:disabled {
  background-color: #5a5b5c;
  cursor: not-allowed;
}

/* Lista de comentarios */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.comment-item {
  /* Top-level comments */
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 15px;
  color: #e4e6eb;
}

.comment-item .comment-header,
.reply-item .reply-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-item .comment-header img,
.reply-item .reply-header img {
  width: 40px;
  /* Larger for main comments */
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.reply-item .reply-header img {
  /* Smaller for replies */
  width: 30px;
  height: 30px;
}

.comment-item .comment-author-info,
.reply-item .reply-author-info {
  display: flex;
  flex-direction: column;
}

.comment-item .comment-author-name,
.reply-item .reply-author-name {
  font-weight: bold;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

.comment-item .comment-author-name .verified-icon,
.reply-item .reply-author-name .verified-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  /* Un color para verificado */
}

.comment-item .comment-meta,
.reply-item .reply-meta {
  font-size: 0.85em;
  color: #7f7f7f;
}

.comment-item .comment-text,
.reply-item .reply-text {
  margin-bottom: 10px;
  line-height: 1.5;
  color: var(--text-color);
  white-space: pre-wrap;
  /* Preserve whitespace and allow wrapping */
  word-break: break-word;
  /* Break long words */
}

/* New styles for editable comment textarea */
.comment-item .edit-comment-textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-color);
  resize: vertical;
  min-height: 60px;
  font-family: 'SFProDisplay';
  margin-bottom: 10px;
  box-sizing: border-box;
  /* Include padding in width */
}

.comment-item .edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.comment-item .edit-actions button {
  padding: 8px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.comment-item .edit-actions .save-edit-btn {
  background-color: #0080ff;
  color: white;
}

.comment-item .edit-actions .save-edit-btn:hover {
  background-color: #0090ff;
}

.comment-item .edit-actions .cancel-edit-btn {
  background-color: #5a5b5c;
  color: white;
}

.comment-item .edit-actions .cancel-edit-btn:hover {
  background-color: #4e4f50;
}


.comment-item .comment-actions,
.reply-item .reply-actions {
  display: flex;
  gap: 15px;
  font-size: 0.9em;
}

.comment-item .comment-actions button,
.reply-item .reply-actions button {
  background: none;
  border: none;
  color: #0090ff;
  cursor: pointer;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.comment-item .comment-actions button:hover,
.reply-item .reply-actions button:hover {
  color: #0080ff;
}

/* Nested comments styling 
        .nested-comments-section {
            margin-top: 15px;
            padding-left: 20px;
            Indentation for nested comments 
        } */

.reply-item {
  /* Styles for any nested comment (replies) */
  background-color: var(--bg-primary);
  /* Slightly different background for visual distinction */
  border-radius: 8px;
  padding: 10px;
  /* Smaller padding than main comments */
  margin-top: 10px;
  border: solid 1px var(--bg-secondary);
}

/* Estilos para el menú de 3 puntos y su modal flotante */
.post-options-container {
  position: relative;
  /* display: inline-block; */
  /* Asegura que el contenedor no ocupe todo el ancho */
  margin-left: auto;
  /* Empuja el botón a la derecha */
}

.three-dots-button {
  background: var(--bg-primary);
  border: none;
  color: var(--text-color);
  /* Color del icono */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  /* Para que sea circular */
  transition: background-color 0.3s ease;
}

.three-dots-button:hover {
  background-color: var(--bg-secondary);
  color: var(--text-color);
  /* Fondo al pasar el ratón */
}

.options-dropdown-modal {
  display: none;
  /* Oculto por defecto */
  position: absolute;
  top: 100%;
  /* Debajo del botón de tres puntos */
  right: 0;
  /* Alineado a la derecha del botón */
  background: var(--bg-secondary);
  /* Fondo oscuro */
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 300px;
  z-index: 1002;
  /* Por encima de otros elementos, debajo de los modales principales */
  padding: 10px;
}

.options-dropdown-modal.active {
  display: block;
}

.options-dropdown-modal button {
  display: block;
  width: 100%;
  padding: 12px 15px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-radius: 0;
  /* Para que los bordes redondeados sean del contenedor */
}

.options-dropdown-modal button:hover {
  background-color: var(--bg-primary);
  /* Fondo al pasar el ratón por las opciones */
  border-radius: 8px;
}

.options-dropdown-modal button i {
  margin-right: 10px;
}

/* Estilos para el modal de confirmación personalizado */
.custom-alert-modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  /* Asegurar que esté encima de todo */
  align-items: center;
  justify-content: center;
}

.custom-alert-content {
  background-color: var(--bg-primary);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  color: var(--text-color);
  max-width: 400px;
  width: 90%;
  position: relative;
}

.custom-alert-content h4 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 1.3em;
  margin-bottom: 20px;
}

.custom-alert-content p {
  margin-bottom: 25px;
  line-height: 1.6;
}

.custom-alert-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.custom-alert-buttons button {
  padding: 10px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.custom-alert-buttons .confirm-btn {
  background-color: #e63946;
  /* Rojo para confirmar acción destructiva */
  color: white;
}

.custom-alert-buttons .confirm-btn:hover {
  background-color: #d12e3b;
}

.custom-alert-buttons .cancel-btn {
  background-color: #5a5b5c;
  /* Gris para cancelar */
  color: white;
}

.custom-alert-buttons .cancel-btn:hover {
  background-color: #4e4f50;
}

/* Estilos para el indicador de post fijado */
.pinned-indicator {
  margin-left: 10px;
  color: #0080ff;
  /* Color para el icono de fijado */
  font-size: 1em;
}

/* Estilos para el modal de privacidad */
.privacy-modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.privacy-modal-options button {
  background: var(--bg-primary);
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.privacy-modal-options button:hover {
  background: #c1c1c185;
  color: var(--text-color);
}

.privacy-modal-options button.selected {
  background-color: #0080ff;
  font-weight: bold;
  color: white;
}