/* ═══════════════════════════════════════════════════════════════════════════════
   18. MENSAJES DESTACADOS (STARRED)
   Sistema de mensajes favoritos con estrellas
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Botón de estrella en cada mensaje */
.message-star {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #8696a0;
    padding: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tooltip del botón */
.message-star::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: #111b21;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

/* Flecha del tooltip */
.message-star::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 8px;
    margin-bottom: 2px;
    border: 5px solid transparent;
    border-top-color: #111b21;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Mostrar tooltip al hover */
.message-star:hover::before,
.message-star:hover::after {
    opacity: 1;
}

.message:hover .message-star {
    opacity: 1;
}

.message-star:hover {
    color: #ffd700;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.message-star.starred {
    opacity: 1;
    color: #ffd700;
    background: rgba(255, 237, 78, 0.2);
}

.message-star.starred:hover {
    color: #ffed4e;
    background: rgba(255, 237, 78, 0.3);
}

/* Indicador visual para mensajes destacados */
.message.starred {
    border-left: 3px solid #ffd700;
    background: linear-gradient(
        to right,
        rgba(255, 215, 0, 0.05) 0%,
        transparent 50%
    );
}

.message.sent.starred {
    border-left: none;
    border-right: 3px solid #ffd700;
    background: linear-gradient(
        to left,
        rgba(255, 215, 0, 0.05) 0%,
        transparent 50%
    );
}

/* Botón para ver mensajes destacados */
.starred-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f0f2f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #667781;
    transition: all 0.3s ease;
    margin: 10px 15px;
}

.starred-filter-btn:hover {
    background: #e9edef;
    color: #111b21;
}

.starred-filter-btn.active {
    background: #ffd700;
    color: #111b21;
    font-weight: 600;
}

.starred-filter-btn i {
    font-size: 16px;
}

.starred-count {
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Animación al marcar/desmarcar */
@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.message-star.animating {
    animation: starPulse 0.5s ease;
}

/* Banner de modo destacados */
.starred-mode-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #111b21;
    font-weight: 600;
    border-bottom: 1px solid #e0c200;
}

.starred-mode-banner.active {
    display: flex;
}

.starred-mode-banner button {
    background: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #111b21;
    transition: all 0.2s ease;
}

.starred-mode-banner button:hover {
    background: #f0f2f5;
    transform: translateY(-1px);
}

/* Mensajes destacados vacío */
.no-starred-messages {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #8696a0;
}

.no-starred-messages.show {
    display: flex;
}

.no-starred-messages i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-starred-messages h3 {
    margin-bottom: 10px;
    color: #111b21;
}

.no-starred-messages p {
    text-align: center;
    max-width: 300px;
}

/* Responsive - Estrellas en móvil */
@media (max-width: 768px) {
    /* En móvil: ocultar estrella por defecto */
    .message-star {
        opacity: 0;
        font-size: 14px;
        padding: 8px;
        top: 50%;
        right: -40px;
        transform: translateY(-50%);
        background: #00a884;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        color: white;
        transition: all 0.2s ease;
        pointer-events: none;
    }
    
    /* Solo mostrar icono si está marcado como favorito (discreto) */
    .message-star.starred {
        opacity: 1;
        position: static;
        display: inline;
        background: transparent;
        color: #ffd700;
        padding: 0;
        box-shadow: none;
        font-size: 10px;
        pointer-events: auto;
        transform: none;
    }
    
    /* Mostrar botón al hacer tap */
    .message.show-actions .message-star {
        opacity: 1;
        right: 8px;
        pointer-events: auto;
    }
    
    .message.show-actions .message-star.starred {
        position: absolute;
        background: #ffd700;
        color: #111b21;
        padding: 8px;
        font-size: 14px;
    }
    
    /* Efecto visual al mostrar acciones */
    .message.show-actions {
        box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.5);
    }
    
    /* Ocultar tooltip en móvil */
    .message-star::before,
    .message-star::after {
        display: none !important;
    }
    
    .starred-filter-btn {
        margin: 8px 10px;
        padding: 8px 12px;
        font-size: 13px;
    }
}

