/* CONTENEDOR DE LAS TARJETAS */
.modal-fullscreen-feed-options {
  position: absolute;
  inset: 0;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
}

.modal-content-feed-options {
  width: 80%;
  max-width: 280px;
}

.clase-btn-seguir-flotante {
  background-color: #555657;
  color: white;
  border-radius: 20px;
  padding: 8px 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.clase-btn-seguir-flotante:hover {
  background-color: #6a6b6c;
}
.following-btn-flotante {
  background: linear-gradient(45deg, #00c3ff, #0080ff);
}
.following-btn-flotante:hover {
  opacity: 0.9;
}
.follower-count-flotante {
  padding: 5px;
  font-size: 0.9em;
  color: #b0b3b8;
}
.copiar-url-btn-feed {
  padding: 10px;
  text-decoration: none;
  color: #e4e6eb;
  font-size: 0.9em;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}
.copiar-url-btn-feed:hover {
  background-color: #3a3b3c;
}
.copiar-url-btn-feed i {
  margin-right: 8px;
}

/* Estilos del modal de autenticación */
.feed-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;
}
.auth-modal-content {
  background-color: var(--bg-secondary);
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  max-width: 350px;
  width: 90%;
}
.auth-modal-content p {
  margin-bottom: 20px;
  font-size: 1.1em;
}
.auth-button {
  width: 100%;
  padding: 12px 0;
  margin: 10px 0;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  color: white;
  transition: background-color 0.2s ease;
}
.auth-login-btn { background-color: #007BFF; }
.auth-login-btn:hover { background-color: #0056b3; }
.auth-register-btn { background-color: #555657; }
.auth-register-btn:hover { background-color: #6a6b6c; }

/* CONTENEDOR DE LAS TARJETAS */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px;
  justify-content: center;
}
.feed-container {
  display: grid;
  gap: 20px;
}
@media (min-width: 600px) {
  .feed-container {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* TARJETA INDIVIDUAL CON ASPECTO 16:9 */
.post-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #1a1a1a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CONTENEDOR DE MEDIA (FONDO Y PRIMER PLANO) */
.media-wrapper {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
}

/* IMAGEN O VIDEO CENTRAL (SIN FONDO) */
.media-foreground {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Llena el contenedor */
  z-index: 2;
}

/* AVATAR */
.post-avatar {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 3;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

/* NOMBRE DE PERFIL */
.post-profile-name {
  position: absolute;
  top: 12px;
  left: 60px;
  font-size: 14px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 5px black;
  z-index: 3;
  text-decoration: none;
}

/* USUARIO (SECUNDARIO) */
.post-username {
  position: absolute;
  top: 32px;
  left: 60px;
  font-size: 13px;
  color: #ccc;
  z-index: 3;
  text-decoration: none;
}

/* ÍCONO VERIFICADO OPCIONAL */
.verified-icon {
  width: 17px;
  height: 17px;
  vertical-align: middle;
  fill: currentColor;
}

/* --- INICIO: Corrección de Título y Vistas --- */

/* TÍTULO DE LA PUBLICACIÓN (Contenedor Flex) */
.post-title {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  
  /* Flexbox para alinear texto y vistas */
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box; 
  
  padding: 0 15px; 
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  color: white;
  z-index: 3;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
  
  /* Se eliminan propiedades de desbordamiento */
}

/* Texto del Título (El que se acorta) */
.post-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1; /* Ocupa el espacio disponible */
  min-width: 0; /* Necesario para que flexbox acorte */
  margin-right: 8px; /* Espacio entre título y vistas */
}
/* --- FIN: Corrección --- */


/* RESPONSIVE OPCIONAL MÁS ESTRICTO */
@media (min-width: 1024px) {
  .feed-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .feed-grid {
    grid-template-columns: 1fr;
  }
  .post-card {
    aspect-ratio: 16 / 9;
  }
}


