

/* ===== LISTADO DE TEMAS ===== */
.sidebar-right__nav .topics-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topic-item {
  margin-bottom: 0.75rem;
}
.topic-toggle {
  width: 100%;
  background: none;
  border: none;
  color: var(--color-texto);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
  transition: color var(--transicion);
}
.topic-toggle::after {
  content: '▸';
  position: absolute;
  right: 0;
  font-size: 0.8rem;
  transition: transform var(--transicion);
}
.topic-toggle.open {
  color: var(--color-acento);
}
.topic-toggle.open::after {
  transform: rotate(90deg);
}

.subtopics-list {
  list-style: none;
  margin: 6px 0 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transicion) ease, opacity var(--transicion);
  opacity: 0;
}
.subtopics-list li {
  padding: 3px 0;
  font-size: 0.85rem;
  color: var(--color-texto);
}
.topic-toggle.open + .subtopics-list {
  max-height: 300px;
  opacity: 1;
}


/* ===== AL ABRIR EN MÓVIL ===== */
.toggle-sidebar-right.open + .sidebar-right,
.sidebar-right:not(.hidden) {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
/* ==== ÚLTIMOS POST (panel derecho) ==== */
.latest-posts {
  position: fixed;             /* fijo en viewport */
  top: 120px;                    /* justo debajo del header fijo */
  right: 40px;                   /* margen a la derecha */
  width: 280px;
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
  padding: 1rem;
  font-family: var(--fuente-principal);
  transition: var(--transicion);
}

.latest-posts h4 {
  font-size: 1.1rem;
  color: var(--color-acento);
  margin-bottom: 0.75rem;
  text-align: center;
}

.latest-posts ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(211, 211, 211, 0.1);
}

.post-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.post-user {
  font-size: 0.85rem;
  color: #a19bac;
}

.post-date {
  font-size: 0.75rem;
  color: rgba(211, 211, 211, 0.7);
}

.post-title {
  font-size: 0.8rem;
  color: var(--color-texto);
  font-weight: 500;
  line-height: 1.3;
}

/* Hover sutil sobre cada ítem */
.post-item:hover {
  background: rgba(69, 50, 175, 0.05);
  cursor: pointer;
}
/* ==== TEMAS (columna izquierda) ==== */
.topic-item {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 80%;                /* un poco más ancho */
  padding: 12px 16px;        /* más espacio interno */
  font-size: 1rem;           /* texto más grande */
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  background: var(--color-sidebar);
  transition: background var(--transicion);
}
.topic-item + .topic-item {
  margin-top: 10px;          /* más separación entre ítems */
}
.topic-item:hover {
  background: rgba(69, 50, 175, 0.15);
  cursor: pointer;
}

.topic-title {
  font-size: 1.1rem;         /* título más grande */
  font-weight: 600;
  color: var(--color-texto);
  margin-bottom: 6px;        /* más separación del desc */
}
.topic-desc {
  font-size: 0.9rem;         /* descripción más legible */
  color: rgba(211, 211, 211, 0.8);
  margin-bottom: 12px;       /* separa el bloque de stats */
}

.topic-stats {
  display: flex;
  gap: 90px;                 /* más separación entre stats */
  position: absolute;
  top: 50%;
  right: 150px;               /* desplazado más hacia la izquierda */
  transform: translateY(-50%);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-count {
  font-weight: 700;
  color: var(--color-acento);
  font-size: 1.2rem;         /* número más grande */
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;         /* etiqueta un poco más grande */
  color: rgba(211, 211, 211, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;       /* más espaciado de letras */
}
:root {
  --purple: #1e0055;
  --purple-dark: #5a3a88;
  --text-light: #fff;
  --transition: 0.25s;
}

/* Contenedor centrado y auto‑width */
.topics-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--purple-light);
  border-radius: 6px;
  margin: 0 auto;            /* centrar en su contenedor padre */
}

/* Botones simples */
.tab-btn {
  background: var(--purple-light);
  border: 2px solid transparent;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--purple-dark);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.tab-btn:hover {
  background: var(--purple);
  color: var(--text-light);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: #230075;
  color: var(--text-light);
  transform: translateY(-1px);
}
@media (max-width: 768px) {
  /* Contenedor scrollable sin flechas */
  .topics-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    margin: 0 auto;
  }

  /* Scrollbar más delgado y elegante */
  .topics-tabs::-webkit-scrollbar {
    height: 4px;
  }
  .topics-tabs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
  }

  /* Botones más pequeños y compactos */
  .tab-btn {
    display: inline-block;
    margin: 0 0.2rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 3px;
    transition: background var(--transition), color var(--transition);
  }
  .tab-btn:hover {
    background: var(--purple);
    color: var(--text-light);
  }
  .tab-btn.active {
    background: var(--purple-dark);
    color: var(--text-light);
  }
}

/* ==== AJUSTES PARA MÓVIL ==== */
@media (max-width: 768px) {
  /* Oculta el panel de Últimos post en móvil */
  .latest-posts {
    display: none !important;
  }

  /* Asegura que la lista de temas ocupe todo el ancho disponible */
  .topics-container-multiple,
  .topics-list,
  .topic-item {
    width: 100% !important;
    margin: 0 !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

 /* Ajusta las estadísticas para que quepan bien */
.topic-stats {
  position: static;
  transform: none;
  margin-top: 4px;       /* menos espacio arriba */
  gap: 8px;              /* gap reducido */
  justify-content: flex-start;
  font-size: 0.8rem;     /* escala global un poco más pequeña */
}

.topic-stats .stat {
  flex-direction: column;
  align-items: center;
  padding: 2px 4px;      /* un pelín de padding interno */
}

.stat-count {
  font-size: 0.9rem;     /* número algo más pequeño */
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.6rem;     /* etiqueta más chica */
}

}

/* ===== BANNER CON BOTONES FLECHA ===== */
#topic-banner {
  display: block;
  margin: 20px 5px;
}
/* === Override móvil (max-width:600px) === */
@media (max-width: 600px) {
  .topic-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 8px;
  }
  .topic-title {
    font-size: 0.9rem;
  }
  .topic-desc {
    font-size: 0.7rem;
    margin-bottom: 0; /* menos espacio en móvil */
  }
  .topic-stats {
    position: static;
    transform: none;
    gap: 8px;
  }
}
/* Contenedor de botones */
.banner-btn-container {
  display: flex;
  gap: 0.5rem;
}

/* Estilos comunes */
.banner-btn {
  background: #1e0055;
  color: var(--text-light);
  border: none;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

/* Flecha completa para “General” */
.banner-btn--back {
  clip-path: polygon(
    0%   0%,   /* esquina superior izquierda */
    85%  0%,   /* antes de la punta */
    100% 50%,  /* punta derecha */
    85%  100%, /* abajo antes de la punta */
    0%   100%  /* esquina inferior izquierda */
  );
}

/* Flecha con abertura en el inicio para enganchar (tema actual) */
.banner-btn--current {
  clip-path: polygon(
    0%  0%,   /* desplaza inicio para notch */
    85%  0%,   /* antes de la punta */
    100% 50%,  /* punta derecha */
    85%  100%, /* abajo antes de la punta */
    0%  100%, /* desplaza fin para notch */
    0%   100%   /* notch triangular */
  );
}

/* Hover */
.banner-btn:hover {
  background: #2a004a;
}
@media (max-width: 768px) {
  /* Ajuste del banner */
  #topic-banner {
    margin: 10px 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Contenedor de botones en línea y scrollable */
  .banner-btn-container {
    display: inline-flex;
    gap: 0.25rem;
    scroll-behavior: smooth;
  }

  /* Scrollbar del banner más discreta */
  #topic-banner::-webkit-scrollbar {
    height: 4px;
  }
  #topic-banner::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
  }

  /* Botones más compactos */
  .banner-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 3px;
  }
  .banner-btn--back {
    clip-path: polygon(
      0%   0%,
      85%  0%,
      100% 50%,
      85%  100%,
      0%   100%
    );
  }
  .banner-btn--current {
    clip-path: polygon(
      0%  0%,
      85%  0%,
      100% 50%,
      85%  100%,
      0%  100%,
      0%   100%
    );
  }

  /* Hover tactil */
  .banner-btn:hover {
    background: #2a004a;
  }
}

/* Ajusta separación con la lista de subcategorías */
#subcategories-list {
  margin-top: 12px;
  margin-left: 24px;
  margin-bottom: 28px;
  padding-left: 12px;
  list-style: disc;
  color: #ccc;
}
/* Overlay del modal */
.modal {
  position: fixed;
  inset: 0;                             /* top:0; right:0; bottom:0; left:0 */
  background: rgba(0, 0, 0, 0.5);       /* fondo oscuro semi‑transparente */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

/* Cuando el modal está activo */
.modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* Contenido del modal */
.modal-content {
  background: #2a004a;                  /* tono púrpura oscuro */
  color: #b1adad;
  width: 90%;
  max-width: 480px;
  padding: 20px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-30px);
  transition: transform 0.3s ease;
  position: relative;
}

/* Animación de entrada */
.modal:not(.hidden) .modal-content {
  transform: translateY(0);
}

/* Botón de cierre */
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}
.modal-close:hover {
  color: #e0d7f5;
}

/* Encabezado */
.modal-content h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Formularios dentro del modal */
.modal-content label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.modal-content input[type="text"],
.modal-content textarea,
.modal-content select,
.modal-content input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #242424;
  color: #eee;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}
.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: #272033;
}

/* Botón de envío */
.modal-content .btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: #7b5bb5;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.modal-content .btn:hover {
  background: #9166c3;
  transform: translateY(-1px);
}
@media (max-width: 768px) {

  /* ===== MODAL EN MÓVIL ===== */
  .modal {
    padding: 1rem;             /* espacio interior para scroll si content largo */
  }
  .modal-content {
    width: 100%;               /* ocupa todo el ancho útil */
    max-width: none;           /* sin límite máximo */
    height: 90vh;              /* casi toda la altura */
    overflow-y: auto;          /* scroll interno si hace falta */
    padding: 1rem;             /* menos relleno */
    border-radius: 8px;        /* esquinas más suaves */
    transform: translateY(-10px);
  }
  .modal-content h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  .modal-content label {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  .modal-content input[type="text"],
  .modal-content textarea,
  .modal-content select,
  .modal-content input[type="file"] {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
  }
  .modal-content .btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-top: 1rem;
  }
  .modal-close {
    top: 8px;
    right: 8px;
    font-size: 1.25rem;
  }
}

/* ===== POSTS DINÁMICOS (contenido de #posts-container) ===== */

/* Contenedor principal de posts */
.posts-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: -2rem 0;
}

/* Cada ítem de post creado por JS */
.post-item-container {
  display: flex;
  flex-direction: column;
  width: 100%;                /* ocupa todo el contenedor padre */
  max-width: 1300px;          /* recorta a la derecha, ajusta según gusto */
  margin-left: 265px;                  /* alineado a la izquierda */
  padding: 0.75rem 1rem;
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
  transition: background var(--transicion), box-shadow var(--transicion);
  cursor: default;
}

.post-item-container:hover {
  background: rgba(69, 50, 175, 0.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Encabezado: username (izquierda) + fecha (derecha) */
.post-item-container .post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-item-container .post-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-acento);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-item-container .post-date {
  font-size: 0.8rem;
  color: rgba(var(--color-texto-rgb), 0.7);
  white-space: nowrap;
}

/* Cuerpo: título + metadatos debajo */
.post-item-container .post-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-item-container .post-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-texto);
  line-height: 1.2;
}

/* Meta: hilo, carrera, institución */
.post-item-container .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: rgba(var(--color-texto-rgb), 0.7);
}

.post-item-container .post-meta .meta-item {
  white-space: nowrap;
}
/* === Ajustes móviles para posts dinámicos === */
@media (max-width: 600px) {
  .posts-container {
    margin: 0.1rem 1rem;
    gap: 0.5rem;
  }

  .post-item-container {
    margin-left: 0px;                  /* alineado a la izquierda */
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }

  .post-item-container .post-header {
    margin-bottom: 0.25rem;
  }

  .post-item-container .post-user {
    font-size: 0.75rem;
  }

  .post-item-container .post-date {
    font-size: 0.7rem;
  }

  .post-item-container .post-body {
    gap: 0.15rem;
  }

  .post-item-container .post-title {
    font-size: 0.85rem;
    line-height: 1.1;
  }

  .post-item-container .post-meta {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .post-item-container .post-meta .meta-item {
    /* opcional: si quieres menos wrap */
    white-space: nowrap;
  }
}



/* ===== DETALLE DE POST ===== */

/* ===== BANNER DE DETALLE REFINADO ===== */
#post-detail-banner {
  display: flex;
  flex-direction: column;
  background: var(--color-sidebar);
  border: 1px solid rgba(46, 5, 100, 0.4);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(52, 6, 117, 0.3);
  padding: 0.75rem;
  margin-left: 265px;
  /* Limita el ancho para dejar un espacio a la derecha */
  max-width: calc(100% - 600px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#post-detail-banner:hover {
  border-color: #28105f;
  box-shadow: 0 4px 12px rgba(31, 6, 66, 0.5);
}

/* Resto de estilos igual… */
#post-detail-banner .post-detail-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.post-detail-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-acento);
  line-height: 1.2;
}

.post-detail-meta {
  font-size: 0.75rem;
  color: rgba(var(--color-texto-rgb), 0.6);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ===== ENVOLTORIO PRINCIPAL ===== */
.post-detail-wrapper {
  display: flex;
  gap: 1.5rem;
  /* sin margen superior: el banner ya da espacio */
  margin-left: 265px;
}

/* Columna izquierda: info de usuario */
.post-detail-left {
  flex: 0 0 250px; /* ancho fijo o mínimo */
}

/* Columna derecha: contenido del post */
.post-detail-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Cuerpo de detalle */
.post-detail-body {
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  padding: 1rem;
}

.post-detail-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-texto);

  /* Conserva saltos de línea y espacios múltiples */
  white-space: pre-wrap;
  word-wrap: break-word;     /* rompe palabras muy largas si es necesario */
  overflow-wrap: anywhere;   /* soporte extra para ajuste de línea */
}


/* Botón de descarga limpio, más pequeño y centrado */
.post-detail-download {
  display: block;                   /* bloque para que margin auto centre */
  width: max-content;               /* ancho justo al contenido */
  margin: 0.5rem auto;              /* centra horizontalmente y separa */
  background: none;                 /* sin fondo */
  border: none;                     /* sin borde */
  padding: 0.25rem 0.5rem;          /* compacto */
  font-size: 0.875rem;              /* más pequeño */
  font-weight: 500;
  color: #4e00cc;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}

/* Hover sutil */
.post-detail-download:hover {
  color: #3d03a8;
  transform: translateY(-1px);
}


/* Estadísticas */
.post-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  padding: 0.2rem;
}

.post-detail-stats .meta-item {
  font-size: 0.9rem;
  color: var(--color-texto);
}

.post-detail-stats .meta-item strong {
  color: var(--color-acento);
}

/* ===== CONTENEDOR INFO DE USUARIO ===== */
.user-info-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
}

.user-info-avatar {
  width: 150px;
  height: 150px;
  border-radius: 0%;
  object-fit: cover;
  border: 2px solid var(--color-acento);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.user-info-username {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-acento);
  text-align: center;
}

.user-info-bio {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(211, 211, 211, 0.8);
  line-height: 1.3;
  text-align: center;
}

.user-info-rank {
  display: inline-block;
  margin: 0;
  padding: 0.05rem 0.8rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--purple-dark);
  background: transparent;
  border: 2px solid var(--purple-dark);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(90, 58, 136, 0.6);
  animation: glow-purple 2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-info-rank:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(90, 58, 136, 0.8);
}

@keyframes glow-purple {
  0%, 100% {
    box-shadow: 0 0 6px rgba(59, 34, 94, 0.6);
  }
  50% {
    box-shadow: 0 0 16px rgba(53, 28, 88, 0.8);
  }
}
@media (max-width: 600px) {
  /* Contenedor global centrado y con padding */
  .post-detail-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;      /* centra todo */
    gap: 1rem;
    margin: 0.5rem auto;
    padding: 0 0rem;
    width: 100%;
  }

  /* Banner al principio, full width */
  #post-detail-banner {
    width: 100%;
    max-width: 100%;
    margin: 0 ;
    padding: 0.8rem;
    border-radius: 0.6rem;
  }

  /* Sección de usuario: ocupa todo y con fondo */
  .post-detail-left {
    width: 100%;
    background: var(--color-sidebar);
    border: 1px solid var(--color-borde);
    border-radius: 0.6rem;
    box-shadow: var(--sombra-suave);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* Avatar un poco más grande */
  .user-info-avatar {
    width: 140px;
    height: 140px;
  }

  .user-info-username {
    font-size: 1.1rem;
  }
  .user-info-bio {
    font-size: 0.85rem;
    text-align: center;
  }
  .user-info-rank {
    font-size: 1.1rem;
    padding: 0.4rem 0.8rem;
  }

  /* Contenido del post debajo de la info */
  .post-detail-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-detail-body {
    padding: 0.75rem;
    border-radius: 0.6rem;
  }
  .post-detail-description {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  /* Botón de descarga y stats agrupados */
  .post-detail-download {
    margin: 0 auto;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
  }
  .post-detail-stats {
    width: 100%;
    padding: 0.6rem;
    gap: 0.6rem;
    font-size: 0.85rem;
    border-radius: 0.6rem;
  }
}


/* ===== ESTILO PARA “Se unió:” ===== */
.user-info-joined {
  margin: 0;                           /* sin márgenes extra */
  color: #c4bfcc;                      /* texto blanco puro */
  font-size: 0.90rem;                  /* ligeramente más pequeño */
  line-height: 1.2;                    /* altura de línea ajustada */
  font-style: italic;                  /* un toque coqueto */
  background: transparent;             /* sin fondo */
  text-align: center;                  /* centrado bajo el nombre */
}


/* Banner de Comentarios */
.post-comments-banner {
  width: 90%;                           /* que ocupe todo el ancho del contenedor */
  background: var(--color-sidebar);
  color: var(--text-light);              /* texto en color claro */
  padding: 0.75rem 1.5rem;                 /* espacio interno generoso */
  margin-top: 1.5rem;                    /* separación respecto al bloque superior */
  border-radius: 0.5rem;                 /* esquinas redondeadas */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);  /* sombra suave */
}

/* Título dentro del banner */
.post-comments-banner h3 {
  color:#3705ac;
  margin: 0;
  font-size: 1.25rem;    /* tamaño un poco más grande */
  font-weight: 600;      /* peso seminegreto */
  text-transform: uppercase; /* opcional: mayúsculas */
}
/* Overlay del modal */
.modal {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  place-items: center;
  justify-content: center;
  z-index: 1000;

}

/* Oculto */
.modal.hidden {
  display: none;
}

/* Contenedor principal */
.modal-content {
  background: #1e1e1e;
  padding: 1rem 1.25rem;       /* un poco menos de relleno */
  border-radius: 0.75rem;      /* esquinas más suaves */
  width: clamp(300px, 80%, 480px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  font-family: "Helvetica Neue", sans-serif;
  color: #e0e0e0;
  line-height: 1.4;
}

/* Cabecera */
.modal-content h3 {
  margin: 0 0 0.75rem;
  font-weight: 300;
  font-size: 1.4rem;
  color: #fafafa;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

/* Área de texto */
.modal-content textarea {
  width: 100%;
  background: #2b2b2b;
  border: 1px solid #444;
  padding: 0.5rem;              /* menos padding y más redondeo */
  color: #eee;
  font-size: 0.95rem;
  font-weight: 300;
  resize: vertical;
  margin-bottom: 1rem;
}

/* Botonera */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Estilos base para botones */
.modal-btn {
  padding: 0.4rem 0.8rem;       /* menos relleno */
  font-size: 0.9rem;
  font-weight: 300;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.modal-btn:active {
  transform: scale(0.98);
}

/* Cancelar */
.modal-btn--cancel {
  background: transparent;
  color: #bbb;
}
.modal-btn--cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Enviar */
.modal-btn--send {
  background: #444;
  color: #fff;
}
.modal-btn--send:hover {
  background: #666;
}
/* Botón “Responder” */
.post-reply-btn,
#reply-btn {
  background: transparent;
  border: 1px solid #444;
  color: #ddd;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 300;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.post-reply-btn:hover,
#reply-btn:hover {
  background: #444;
  color: #fff;
}

.post-reply-btn:active,
#reply-btn:active {
  transform: scale(0.97);
}
/* Forzar alineación a la derecha */
.post-reply-btn,
#reply-btn {
  display: block;      /* ocupa todo el ancho disponible */
  margin-left: auto;   /* empuja el botón hacia la derecha */
  /* opcional: ajusta el espacio derecho si quieres separarlo del borde */
  margin-right: 0.5rem;
}
/* ===== ESTILOS PARA COMENTARIOS ===== */
.comment-item {
  width: 100%;
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
  padding: 0.75rem 0.80rem;
  margin: 1rem auto;               /* centro y separación vertical */
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background var(--transicion), box-shadow var(--transicion);
}

.comment-item:hover {
  background: rgba(69, 50, 175, 0.05);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.comment-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comment-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-acento);
}

.comment-nickname {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-acento);
}

.comment-date {
  font-size: 0.75rem;
  color: rgba(211, 211, 211, 0.7);
}

.comment-text {
  font-size: 0.95rem;
  color: var(--color-texto);
  line-height: 1.4;
  padding-left: 3.45rem;
  /* forzar wrap en palabras largas y respetar múltiples líneas */
  white-space: pre-wrap;     /* conserva saltos de línea del usuario */
  word-wrap: break-word;     /* rompe palabras muy largas */
  overflow-wrap: anywhere;   /* soporte adicional de wrap */
}


/* Botón “Responder” dentro de un comentario */
.comment-reply-btn {
  margin-top: 0.5rem;
  background: transparent;
  border: none;
  color: var(--color-acento);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transicion);
}
.comment-reply-btn:hover {
  color: var(--purple-dark);
}

/* Línea lateral para el comentario que respondemos */
.comment-item.replied {
  border-left: 4px solid var(--color-acento);
  padding-left: calc(1rem - 4px); /* compensa el ancho de la línea */
  background: rgba( var(--color-acento-rgb), 0.05 );
}
.hidden { display: none; }
.toggle-replies-btn {
  margin: 4px 0;
  font-size: 0.9em;
  cursor: pointer;
  background: none;
  border: none;
  color: #007bff;
}
/* Contenedor de acciones */
.comment-actions {
  margin-left: auto;
  position: relative;
  display: inline-block;
}

/* Botón ⋮ sin fondo, sin borde, cursor pointer, texto blanco */
.comment-ellipsis-btn {
  background: none;
  border: none;
  padding: 4px;
  margin-left: 8px;
  cursor: pointer;
  color: #fff;            /* texto (o símbolo ⋮) en blanco */
  font-size: 1.2em;
}

/* Si en vez de texto usas un <svg>, asegúrate de que su fill sea blanco */
.comment-ellipsis-btn svg {
  width: 1em;
  height: 1em;
  fill: #fff;
}

/* El menú de acciones, por defecto oculto y sin fondo */
.comment-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  position: absolute;
  top: 100%;
  right: 0;
  background: transparent;   /* traslúcido/transparente */
  border: none;
  box-shadow: none;
}

/* Cada opción dentro del menú */
.comment-menu-item {
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  color: #fff;               /* texto blanco */
}

/* Hover sobre cada opción */
.comment-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Cuando ocultas con .hidden */
.hidden {
  display: none;
}
/* ===== EDICIÓN INLINE DE COMENTARIOS ===== */
.edit-textarea {
  width: 100%;
  padding: 0.75rem;                           /* igual que .comment-item */
  margin-left: 3.45rem;                       /* mismo indent que .comment-text */
  background: var(--color-sidebar);
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  color: var(--color-texto);
  font-size: 0.95rem;
  line-height: 1.4;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.edit-textarea:focus {
  outline: none;
  border-color: var(--color-acento);
  box-shadow: 0 0 4px rgba(var(--color-acento-rgb), 0.5);
}

/* ===== BOTONES INLINE MÁS PEQUEÑOS ===== */
.btn-save,
.btn-cancel {
  display: inline-block;
  padding: 0.25rem 0.5rem;      /* menos relleno */
  font-size: 0.75rem;           /* texto más pequeño */
  font-weight: 300;
  border-radius: var(--radio);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 0.25rem;          /* un poco de espacio arriba */
}

/* Alinearlos con la indentación del textarea */
.btn-save {
  margin-left: 3.45rem;
  background: var(--color-acento);
  color: var(--text-light);
  border: none;
}
.btn-cancel {
  margin-left: 0.5rem;          /* separación entre botones */
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--color-borde);
}

/* Hover / Active suavitos */
.btn-save:hover {
  background: rgba(var(--color-acento-rgb), 0.8);
  transform: translateY(-1px);
}
.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.btn-save:active,
.btn-cancel:active {
  transform: scale(0.97);
}
/* ===== PAGINACIÓN DE COMENTARIOS ===== */
#comments-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

#comments-pagination button {
  background: var(--purple-light);
  border: 1px solid var(--purple-dark);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  color: var(--purple-dark);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

#comments-pagination button:hover {
  background: var(--purple);
  color: var(--text-light);
  transform: translateY(-1px);
}

#comments-pagination button.active-page {
  background: var(--purple-dark);
  color: var(--text-light);
  border-color: var(--purple-dark);
}
@media (max-width: 600px) {
  /* “Se unió:” más compacto y centrado */
  .user-info-joined {
    font-size: 0.8rem;
    line-height: 1.2;
    margin: 0.25rem 0;
  }

  /* Banner de comentarios full‑width y más ajustado */
  .post-comments-banner {
    width: 100%;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    border-radius: 0.5rem;
  }
  .post-comments-banner h3 {
    font-size: 1rem;
  }

  /* Comentarios: bloque y padding reducido */
  .comment-item {
    padding: 0.5rem 0.6rem;
    margin: 0.2rem auto;
    gap: 0.15rem;
  }
  .comment-user {
    gap: 0.4rem;
  }
  .comment-avatar {
    width: 35px;
    height: 35px;
  }
  .comment-nickname {
    font-size: 0.85rem;
  }
  .comment-date {
    font-size: 0.65rem;
  }
  .comment-text {
    font-size: 0.85rem;
    padding-left: 2.8rem;
  }

  /* Botón “Responder” inline más pequeño y margen ajustado */
  .comment-reply-btn,
  .post-reply-btn,
  #reply-btn {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    margin-left: auto;
    margin-right: 0.5rem;
  }

  /* Edición inline y botones de guardado/cancelar */
  .edit-textarea {
    margin-left: 2.8rem;
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  .btn-save,
  .btn-cancel {
    font-size: 0.7rem;
    margin-top: 0.2rem;
    margin-left: 2.8rem;
  }
  .btn-cancel { margin-left: 0.4rem; }

  /* Paginación centrada con botones más pequeños */
  #comments-pagination {
    margin: 0.75rem 0;
    gap: 0.4rem;
  }
  #comments-pagination button {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}
 @media (max-width: 600px) {
  /* =========== Modal “Responder” más pequeño =========== */
  #reply-modal .modal-content {
    width: 90%;             /* ocupa el 90% del ancho */
    max-width: 300px;       /* nunca más ancho que esto */
    padding: 0.6rem;        /* menos padding */
  border-radius: 0.5rem;
     max-height: 25vh;       /* que no exceda el 60% de la altura */
    overflow-y: auto;       /* permite scroll si el contenido supera */
  }

  #reply-modal .modal-content h3 {
    font-size: 1rem;        /* título más pequeño */
    margin-bottom: 0.5rem;
  }

  #reply-modal textarea#reply-text {
    width: 100%;
    height: 100px;          /* altura reducida */
    font-size: 0.9rem;
    padding: 0.4rem;
  }

  #reply-modal .modal-actions {
    gap: 0.4rem;
    justify-content: flex-end;
  }

  #reply-modal .modal-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
  /* =========== fin Modal “Responder” =========== */
 }

/* Si sólo quieres que el <strong> (“Hilo:”, etc.) sea marrón, y el resto no */
.post-item-container .post-meta .meta-item strong {
  color: rgb(148, 136, 180);
}
    .sidebar__nav a.active {
      background: var(--color-acento);
      color: white;
    }
    .sidebar__nav a.active .icon-sidebar {
      stroke: white;
    }
/* MÓVIL: subir “Últimos post” y “topics‑tabs” */
@media (max-width: 768px) {
  /* Elimina espacio extra encima */
  .latest-posts,
  .topics-tabs {
    margin-top: 0;
    padding-top: 0;
  }

  /* Si siguen muy abajo, súbelos ligeramente con márgenes negativos */
  .latest-posts {
    margin-top: -0.75rem;   /* ajústalo al valor que necesites */
  }
  .topics-tabs {
    margin-top: -4rem;
  }
}
.topics-list > .topic-item:first-child {
  display: none;
}
.post-downloads {
  margin-left: 30px;
  margin-top: -30px;
}
.role-tag {
  display: inline-block;
  position: relative;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 6px 14px;
  margin: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  border: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.3s;
  animation: pulse-rol 2s ease-in-out infinite alternate;
  color: var(--c);
}

/* Hover general */
.role-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px var(--c);
}

/* Glow genérico si no se redefine */
@keyframes pulse-rol {
  from { box-shadow: 0 0 6px var(--c); }
  to   { box-shadow: 0 0 16px var(--c); }
}

/* Roles estándar */
.role-tag[data-role="Usuario"]      { --c: #52525b; }
.role-tag[data-role="Asistidor"]    { --c: #0cd4c4; }
.role-tag[data-role="Contribuidor"] { --c: #bb5e1c; }
.role-tag[data-role="Importante"]   
{  --c: rgb(255, 220, 25);
  /* efecto de luz deslizante */
  background: linear-gradient(
    90deg,
    rgba(255,220,25,0.2) 0%,
    rgba(255,220,25,0.2) 40%,
    rgba(255,220,25,0.5) 50%,
    rgba(255,220,25,0.2) 60%,
    rgba(255,220,25,0.2) 100%
  );
  background-size: 200% 100%;
  animation: shine 3s linear infinite;}
@keyframes shine {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}
/* ——— Mejoras para Colaborador ——— */
.role-tag[data-role="Colaborador"] {
  --c: #00cc66;
  background: linear-gradient(145deg, rgba(0,204,102,0.2), rgba(0,204,102,0.05));
  border-color: #00cc66;
  box-shadow: inset 0 0 6px rgba(0,204,102,0.4);
}

/* ——— Mejoras para Administrador ——— */
.role-tag[data-role="Administrador"] {
  --c: #9b5de5;
  background: linear-gradient(145deg, rgba(155,93,229,0.25), rgba(155,93,229,0.07));
  border-color: #9b5de5;
  box-shadow: 0 2px 8px rgba(155,93,229,0.4), inset 0 0 4px rgba(155,93,229,0.6);
}

/* ——— Mejoras para Creador ——— */
.role-tag[data-role="Creador"] {
  --c: #f31010;
  background: linear-gradient(145deg, rgba(243,16,16,0.3), rgba(243,16,16,0.1));
  border-color: #f31010;
  box-shadow: 
    0 2px 10px rgba(243,16,16,0.5),   /* glow exterior */
    inset 0 0 6px rgba(243,16,16,0.7); /* luz interior */
  animation: pulse-rol-slow 3s ease-in-out infinite alternate;
}

/* Pulsación más suave para Creador */
@keyframes pulse-rol-slow {
  from { box-shadow: 0 0 10px var(--c), inset 0 0 4px var(--c); }
  to   { box-shadow: 0 0 20px var(--c), inset 0 0 8px var(--c); }
}

/* Separación extra */
.post-user-roles,
.user-info-roles {
  margin-top: 10px;
  padding: 0 0 1rem 0;
}
.user-info-reputation {
  margin: 0;
  color: #c4bfcc;
  font-size: 0.90rem;
  line-height: 1.2;
  font-style: italic;
  background: transparent;
  text-align: center;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
/* — Bloque de Ayuda / Reputación (compacto, tema oscuro) — */
.help-message {
  max-width: 1300px;         /* ancho reducido */
  padding: 1rem;
  background: #0b0012;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;       /* texto más pequeño */
  color: #c9c8ca;
  box-shadow: 0 4px 12px rgba(20, 0, 45, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Título principal más discreto */
.help-message h2 {
  margin: 0 0 0.8rem;
  font-size: 1.3rem;
  color: #7a4eff;
  text-shadow: 0 0 6px rgba(122, 78, 255, 0.6);
}
.help-message h2::after {
  display: none;            /* ocultamos subrayado para simplificar */
}

/* Subtítulos de rol compactos */
.help-message h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: 1rem;
  position: relative;
  padding: 0.15rem 0;
}
.help-message h3::after {
  /* glow muy sutil */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  filter: blur(6px);
  opacity: 0.3;
  border-radius: 4px;
}

/* Roles con glow contenido */
.role-Usuario {
  color: #b0afb1; text-shadow: 0 0 3px rgba(176,175,177,0.5);
}
.role-Usuario::after { background: rgba(176,175,177,0.3); }

.role-Asistidor {
  color: #40c4ff; text-shadow: 0 0 4px rgba(64,196,255,0.6);
}
.role-Asistidor::after { background: rgba(64,196,255,0.3); }

.role-Contribuidor {
  color: #ffab40; text-shadow: 0 0 4px rgba(255,171,64,0.6);
}
.role-Contribuidor::after { background: rgba(255,171,64,0.3); }

.role-Importante {
  color: #ffd740; text-shadow: 0 0 4px rgba(255,215,64,0.6);
}
.role-Importante::after { background: rgba(255,215,64,0.3); }

.role-Colaborador {
  color: #1de9b6; text-shadow: 0 0 4px rgba(29,233,182,0.6);
}
.role-Colaborador::after { background: rgba(29,233,182,0.3); }

.role-Administrador {
  color: #d500f9; text-shadow: 0 0 4px rgba(213,0,249,0.6);
}
.role-Administrador::after { background: rgba(213,0,249,0.3); }

.role-Creador {
  color: #ff1744; text-shadow: 0 0 4px rgba(255,23,68,0.6);
}
.role-Creador::after { background: rgba(255,23,68,0.3); }

/* Listas compactas */
.help-message ul {
  margin: 0.6rem 0;
  padding-left: 1.2rem;
}
.help-message li {
  margin-bottom: 0.6rem;
  line-height: 1.4;
  position: relative;
  padding-left: 1rem;
}
.help-message li::before {
  content: '▹';
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: #7a4eff;
  font-size: 1em;
}
/* — Ajustes para móvil — */
@media (max-width: 600px) {
  .help-message {
    max-width: 100%;
    padding: 0.75rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  .help-message h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
  }
  .help-message h3 {
    font-size: 0.9rem;
    margin: 0.6rem 0 0.3rem;
  }
  .help-message ul {
    padding-left: 1rem;
    margin: 0.5rem 0;
  }
  .help-message li {
    margin-bottom: 0.5rem;
    padding-left: 0.9rem;
  }
  .help-message li::before {
    font-size: 0.9em;
  }
}
/* Animación de glow más intenso */
@keyframes glow {
  0% {
    /* glow suave */
    text-shadow:
      0 0 6px var(--glow-color),
      0 0 12px var(--glow-color);
  }
  100% {
    /* glow potente */
    text-shadow:
      0 0 12px var(--glow-color),
      0 0 24px var(--glow-color),
      0 0 36px var(--glow-color);
  }
}

/* Estilos base para todos los roles */
.post-user[class*="role-"],
.user-info-username[class*="role-"] {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--role-color) !important;
  animation: glow 1.8s ease-in-out infinite alternate;
}

/* Variables de color por rol */
.post-user.role-Usuario,
.user-info-username.role-Usuario {
  --role-color: #b0afb1;
  --glow-color: rgba(176,175,177,0.8);
}

.post-user.role-Asistidor,
.user-info-username.role-Asistidor {
  --role-color: #40c4ff;
  --glow-color: rgba(64,196,255,0.8);
}

.post-user.role-Contribuidor,
.user-info-username.role-Contribuidor {
  --role-color: #ffab40;
  --glow-color: rgba(255,171,64,0.8);
}

.post-user.role-Importante,
.user-info-username.role-Importante {
  --role-color: #ffd740;
  --glow-color: rgba(255,215,64,0.8);
}

.post-user.role-Colaborador,
.user-info-username.role-Colaborador {
  --role-color: #1de9b6;
  --glow-color: rgba(29,233,182,0.8);
}

.post-user.role-Administrador,
.user-info-username.role-Administrador {
  --role-color: #d500f9;
  --glow-color: rgba(213,0,249,0.8);
}

.post-user.role-Creador,
.user-info-username.role-Creador {
  --role-color: #ff1744;
  --glow-color: rgba(255,23,68,0.8);
}
/* Contenedor de vídeos para Tutoriales */
.video-container {
  margin: 2rem auto;
  max-width: 800px;
  text-align: center;
}

.video-container h2 {
  color: var(--color-acento);
  margin-bottom: 1rem;
}

.videos-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.video-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-texto);
}

.video-item video {
  width: 100%;
  border-radius: var(--radio);
  box-shadow: var(--sombra-suave);
  background: #000;
}
